/**
 * Estilos para el frontend del plugin Abaca B2B Bulk Order
 */

/* Variables globales */
:root {
    --abaca-primary-color: #2271b1;
    --abaca-primary-hover: #135e96;
    --abaca-border-color: #e0e0e0;
    --abaca-text-color: #333;
    --abaca-light-bg: #f8f9fa;
    --abaca-bg: #ffffff;
    --abaca-text: #333;
    --abaca-bg-light: #f8f9fa;
    --abaca-text-light: #666;
    --abaca-border: #e0e0e0;
    --abaca-bg-hover: #e9ecef;
    --abaca-primary: #007cba;
    --abaca-success-bg: #d4edda;
    --abaca-success-text: #155724;
    --abaca-error-bg: #f8d7da;
    --abaca-error-text: #721c24;
    --abaca-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --abaca-radius: 8px;
    --abaca-spacing: 1em;
}

/* Protección contra clics rápidos */
.processing {
    opacity: 0.6 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.quantity-plus.processing,
.quantity-minus.processing,
.quantity-plus-mobile.processing,
.quantity-minus-mobile.processing {
    background-color: #ccc !important;
    color: #666 !important;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

/* Contenedor principal */
body.page .abaca-b2b-bulk-order {
    margin: 2em 0;
    font-family: inherit;
    width: var(--theme-container-width, 100%);
    max-width: var(--theme-block-max-width, 100%);
    margin-inline: auto;
}

/* Galería */
.abaca-b2b-bulk-order-gallery {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.abaca-b2b-bulk-order-gallery .swiper {
    width: 100%;
    height: 300px;
}

.abaca-b2b-bulk-order-gallery .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.abaca-b2b-bulk-order-gallery .swiper-slide img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.abaca-b2b-bulk-order-gallery .swiper-button-next,
.abaca-b2b-bulk-order-gallery .swiper-button-prev {
    color: #000;
    background: rgba(255, 255, 255, 0.8);
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.abaca-b2b-bulk-order-gallery .swiper-button-next:after,
.abaca-b2b-bulk-order-gallery .swiper-button-prev:after {
    font-size: 16px;
}

.abaca-b2b-bulk-order-gallery .swiper-pagination {
    position: relative;
    margin-top: 10px;
}

/* Tabla */
.abaca-b2b-bulk-order-items {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.abaca-b2b-bulk-order-items th,
.abaca-b2b-bulk-order-items td {
    padding: 1em;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.abaca-b2b-bulk-order-items th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Nombre y descripción del producto */
.abaca-b2b-bulk-order-product-name {
    font-weight: 600;
    margin-bottom: 0.5em;
}

.abaca-b2b-bulk-order-product-description {
    font-size: 0.9em;
    color: #666;
}

/* Input de cantidad */
.abaca-b2b-bulk-order-qty {
    width: 80px;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Botón de añadir */
.abaca-b2b-bulk-order-add {
    padding: 0.5em 1em;
    background: var(--abaca-primary-color);
    color: #fff;
    border: none;
    border-radius: var(--abaca-radius);
    cursor: pointer;
    transition: background 0.3s;
}

.abaca-b2b-bulk-order-add:hover {
    background: var(--abaca-primary-hover);
}

/* Estado del stock */
.stock {
    display: inline-block;
    padding: 0.25em 0.5em;
    border-radius: var(--abaca-radius);
    font-size: 0.9em;
}

.stock.in-stock {
    background: var(--abaca-success-bg);
    color: var(--abaca-success-text);
}

.stock.out-of-stock {
    background: var(--abaca-error-bg);
    color: var(--abaca-error-text);
}

/* Grupos */
.abaca-b2b-bulk-order-group {
    margin-bottom: 2em;
}

.abaca-b2b-bulk-order-group-title {
    margin: 0 0 1em;
    padding: 0.5em 1em;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Resumen */
.abaca-b2b-bulk-order-summary {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 1em;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.abaca-b2b-bulk-order-summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.abaca-b2b-bulk-order-summary-totals {
    display: flex;
    gap: 2em;
}

.abaca-b2b-bulk-order-summary-total {
    font-weight: 600;
}

/* Estilos para la tabla matriz */
body.page .abaca-b2b-bulk-order .matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: var(--abaca-shadow);
    border-radius: var(--abaca-radius);
    overflow: hidden;
    margin: var(--abaca-spacing) 0;
}

body.page .abaca-b2b-bulk-order .matrix-table th,
body.page .abaca-b2b-bulk-order .matrix-table td {
    padding: calc(var(--abaca-spacing) * 0.75);
    text-align: center;
    border: 1px solid var(--abaca-border-color);
    vertical-align: middle;
}

body.page .abaca-b2b-bulk-order .matrix-table th {
    background: var(--abaca-light-bg);
    font-weight: 600;
    color: var(--abaca-text-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Color cell */
body.page .abaca-b2b-bulk-order .color-cell {
    background: #fff;
    padding: 1em;
    min-width: 120px;
}

body.page .abaca-b2b-bulk-order .color-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
}

body.page .abaca-b2b-bulk-order .color-name {
    font-weight: 600;
    color: var(--abaca-text-color);
}

body.page .abaca-b2b-bulk-order .color-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

/* Variation cell */
body.page .abaca-b2b-bulk-order .variation-cell {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: center;
    padding: 0.5em;
}

body.page .abaca-b2b-bulk-order .variation-price {
    font-weight: 600;
    color: var(--abaca-text-color);
}

body.page .abaca-b2b-bulk-order .variation-sku {
    font-size: 0.8em;
    color: #666;
}

/* Stock status */
body.page .abaca-b2b-bulk-order .stock {
    display: inline-block;
    padding: 0.25em 0.5em;
    border-radius: var(--abaca-radius);
    font-size: 0.9em;
    margin: 0.25em 0;
}

body.page .abaca-b2b-bulk-order .stock.in-stock {
    background: var(--abaca-success-bg);
    color: var(--abaca-success-text);
}

body.page .abaca-b2b-bulk-order .stock.out-of-stock {
    background: var(--abaca-error-bg);
    color: var(--abaca-error-text);
}

/* Quantity inputs */
body.page .abaca-b2b-bulk-order .variation-quantity input[type="number"] {
    width: 60px;
    padding: 0.5em;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    text-align: center;
    -moz-appearance: textfield;
}

body.page .abaca-b2b-bulk-order .variation-quantity input[type="number"]::-webkit-outer-spin-button,
body.page .abaca-b2b-bulk-order .variation-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Mobile styles */
@media (max-width: 768px) {
    body.page .abaca-b2b-bulk-order {
        margin: 1em 0;
    }

    body.page .abaca-b2b-bulk-order .matrix-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 14px;
        margin: 0;
        border-radius: 0;
    }

    body.page .abaca-b2b-bulk-order .matrix-table th,
    body.page .abaca-b2b-bulk-order .matrix-table td {
        padding: 0.5em;
    }

    body.page .abaca-b2b-bulk-order .color-cell {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        min-width: 100px;
        border-right: 2px solid var(--abaca-border-color);
    }

    body.page .abaca-b2b-bulk-order .color-info {
        gap: 0.25em;
    }

    body.page .abaca-b2b-bulk-order .color-name {
        font-size: 0.9em;
    }

    body.page .abaca-b2b-bulk-order .color-image img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }

    body.page .abaca-b2b-bulk-order .variation-cell {
        padding: 0.25em;
        gap: 0.25em;
    }

    body.page .abaca-b2b-bulk-order .variation-price {
        font-size: 0.9em;
    }

    body.page .abaca-b2b-bulk-order .variation-sku {
        font-size: 0.75em;
    }

    body.page .abaca-b2b-bulk-order .stock {
        font-size: 0.8em;
        padding: 0.15em 0.35em;
    }

    body.page .abaca-b2b-bulk-order .variation-quantity input[type="number"] {
        width: 45px;
        height: 35px;
        padding: 0.15em;
        font-size: 0.9em;
    }

    /* Hide desktop table in mobile */
    body.page .abaca-b2b-bulk-order .desktop-view {
        display: none;
    }

    /* Show mobile accordion */
    body.page .abaca-b2b-bulk-order .mobile-view {
        display: block;
    }

    /* Accordion styles */
    body.page .abaca-b2b-bulk-order .accordion-color {
        margin-bottom: 1em;
        border: 1px solid var(--abaca-border-color);
        border-radius: var(--abaca-radius);
        overflow: hidden;
    }

    body.page .abaca-b2b-bulk-order .accordion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1em;
        background: #fff;
        cursor: pointer;
    }

    body.page .abaca-b2b-bulk-order .color-info {
        display: flex;
        align-items: center;
        gap: 1em;
    }

    body.page .abaca-b2b-bulk-order .color-thumbnail {
        width: 40px;
        height: 40px;
        border-radius: var(--abaca-radius);
        object-fit: cover;
    }

    body.page .abaca-b2b-bulk-order .color-name {
        font-weight: 600;
        color: var(--abaca-text-color);
    }

    body.page .abaca-b2b-bulk-order .pieces-badge {
        background: var(--abaca-primary-color);
        color: white;
        padding: 0.25em 0.5em;
        border-radius: 1em;
        font-size: 0.8em;
        min-width: 2em;
        text-align: center;
    }

    body.page .abaca-b2b-bulk-order .color-total {
        display: flex;
        align-items: center;
        gap: 1em;
    }

    body.page .abaca-b2b-bulk-order .total-amount {
        font-weight: 600;
        color: var(--abaca-text-color);
    }

    body.page .abaca-b2b-bulk-order .expand-button {
        background: none;
        border: none;
        padding: 0.5em;
        cursor: pointer;
        transition: transform 0.3s;
    }

    body.page .abaca-b2b-bulk-order .expand-button svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }

    body.page .abaca-b2b-bulk-order .accordion-color.expanded .expand-button {
        transform: rotate(180deg);
    }

    body.page .abaca-b2b-bulk-order .accordion-content {
        display: none;
        background: var(--abaca-light-bg);
        border-top: 1px solid var(--abaca-border-color);
    }

    body.page .abaca-b2b-bulk-order .accordion-color.expanded .accordion-content {
        display: block;
    }

    body.page .abaca-b2b-bulk-order .size-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1em;
        border-bottom: 1px solid var(--abaca-border-color);
    }

    body.page .abaca-b2b-bulk-order .size-row:last-child {
        border-bottom: none;
    }

    body.page .abaca-b2b-bulk-order .size-info {
        display: flex;
        flex-direction: column;
        gap: 0.25em;
    }

    body.page .abaca-b2b-bulk-order .size-name {
        font-weight: 600;
        color: var(--abaca-text-color);
    }

    body.page .abaca-b2b-bulk-order .size-price {
        font-size: 0.9em;
        color: var(--abaca-text-color);
    }

}

/* Desktop View */
@media (min-width: 769px) {
    body.page .abaca-b2b-bulk-order .mobile-view {
        display: none;
    }
}

@media (max-width: 480px) {
    body.page .abaca-b2b-bulk-order .matrix-table {
        font-size: 13px;
    }

    body.page .abaca-b2b-bulk-order .color-cell {
        min-width: 90px;
    }

    body.page .abaca-b2b-bulk-order .color-image img {
        width: 35px;
        height: 35px;
    }

    body.page .abaca-b2b-bulk-order .variation-quantity input[type="number"] {
        width: 40px;
        height: 32px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .abaca-b2b-bulk-order-items {
        display: block;
        overflow-x: auto;
    }

    .abaca-b2b-bulk-order-gallery {
        max-width: 200px;
    }

    .abaca-b2b-bulk-order-gallery .swiper {
        height: 200px;
    }

    .abaca-b2b-bulk-order-summary-content {
        flex-direction: column;
        gap: 1em;
    }

    .abaca-b2b-bulk-order-summary-totals {
        flex-direction: column;
        gap: 0.5em;
    }
}

/* Estilos para productos separados */
.abaca-b2b-bulk-order-products {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.abaca-b2b-product-section {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.abaca-b2b-product-section:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.product-header {
    background: #f8f9fa;
    color: #333;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

/* Fondo verde para headers de productos con items en carrito */
.abaca-b2b-bulk-order .abaca-b2b-product-block.has-items .product-header {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
}

.product-title {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-id {
    font-size: 0.8em;
    color: #666;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: normal;
}

.product-description {
    margin: 10px 0;
    color: #555;
    line-height: 1.4;
}

.product-sku {
    margin: 5px 0 0 0;
    font-size: 0.9em;
    color: #666;
}

/* Botones específicos para productos separados */
.abaca-b2b-bulk-order-clear-product {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.abaca-b2b-bulk-order-clear-product:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.abaca-b2b-global-actions {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.abaca-b2b-bulk-order-clear-all {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.abaca-b2b-bulk-order-clear-all:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Mejorar la tabla dentro de cada producto */
.abaca-b2b-product-section .matrix-table {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.abaca-b2b-product-section .matrix-table th {
    background: #f1f3f4;
    color: #333;
}

/* Responsive para productos separados */
@media (max-width: 768px) {
    .abaca-b2b-bulk-order-products {
        gap: 20px;
    }
    
    .product-header {
        padding: 15px;
    }
    
    .product-title {
        font-size: 1.3em;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .product-id {
        align-self: flex-start;
    }
}

/* Estilos para la tabla de pedidos a granel */
.abaca-b2b-bulk-table,
.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--abaca-spacing-xl);
    font-family: var(--abaca-font-family);
    background-color: var(--abaca-bg-primary);
    border-radius: var(--abaca-border-radius);
    overflow: hidden;
}

.abaca-b2b-bulk-table th,
.woocommerce table.shop_table th {
    background-color: var(--abaca-table-header-bg);
    padding: var(--abaca-table-cell-padding);
    text-align: left;
    font-weight: var(--abaca-btn-font-weight);
    color: var(--abaca-secondary);
    border-bottom: var(--abaca-table-border);
}

.abaca-b2b-bulk-table td,
.woocommerce table.shop_table td {
    padding: var(--abaca-table-cell-padding);
    border-bottom: var(--abaca-table-border);
}

/* Inputs de cantidad */
.abaca-b2b-bulk-table input[type="number"],
.woocommerce .quantity .qty {
    width: var(--abaca-input-height);
    height: var(--abaca-input-height);
    padding: var(--abaca-input-padding);
    border: var(--abaca-input-border);
    border-radius: var(--abaca-input-border-radius);
    text-align: center;
}

/* Botones */
.abaca-b2b-bulk-table button,
.abaca-b2b-add-to-cart,
.woocommerce .button {
    padding: var(--abaca-btn-padding);
    background-color: var(--abaca-primary);
    color: var(--abaca-bg-primary);
    border: none;
    border-radius: var(--abaca-btn-border-radius);
    font-weight: var(--abaca-btn-font-weight);
    cursor: pointer;
    transition: background-color var(--abaca-transition-speed) var(--abaca-transition-timing);
}

.abaca-b2b-bulk-table button:hover,
.abaca-b2b-add-to-cart:hover,
.woocommerce .button:hover {
    background-color: var(--abaca-secondary);
}

/* Botón de limpiar */
.abaca-b2b-clear-all {
    background-color: var(--abaca-danger);
}

/* Encabezados de producto */
.abaca-b2b-product-header {
    background-color: var(--abaca-bg-secondary);
    padding: var(--abaca-spacing-md);
    margin-bottom: var(--abaca-spacing-md);
    border-radius: var(--abaca-border-radius);
}

.abaca-b2b-product-header h3 {
    font-size: var(--abaca-font-size-lg);
    margin-bottom: var(--abaca-spacing-sm);
}

/* Totales */
.abaca-b2b-totals,
.cart_totals {
    margin-top: var(--abaca-spacing-lg);
    padding: var(--abaca-spacing-md);
    background-color: var(--abaca-bg-secondary);
    border-radius: var(--abaca-border-radius);
}

.cart_totals {
    float: right;
    width: 40%;
}

.cart_totals h2 {
    font-size: var(--abaca-font-size-lg);
    margin-bottom: var(--abaca-spacing-md);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .abaca-b2b-bulk-table,
    .woocommerce table.shop_table {
        display: block;
        overflow-x: auto;
    }
    
    .abaca-b2b-bulk-table td,
    .abaca-b2b-bulk-table th,
    .woocommerce table.shop_table td,
    .woocommerce table.shop_table th {
        padding: var(--abaca-spacing-sm);
    }
    
    .abaca-b2b-product-header {
        padding: var(--abaca-spacing-sm);
    }
    
    .cart_totals {
        width: 100%;
        float: none;
    }
}

/**
 * Estilos para Abaca B2B Bulk Add-to-Cart
 * Layout tipo wholesale con integración visual Blocksy
 */

/* Variables CSS compatibles con Blocksy */
:root {
    --abaca-primary: var(--theme-palette-color-1, #2271b1);
    --abaca-primary-hover: var(--theme-palette-color-1-hover, #135e96);
    --abaca-text: var(--theme-text-color, #333333);
    --abaca-text-light: var(--theme-text-color-light, #666666);
    --abaca-border: var(--theme-border-color, #e0e0e0);
    --abaca-bg: var(--theme-background-color, #ffffff);
    --abaca-bg-light: var(--theme-background-color-alt, #f8f9fa);
    --abaca-shadow: var(--theme-box-shadow, 0 2px 8px rgba(0,0,0,0.1));
    --abaca-radius: var(--theme-border-radius, 8px);
    --abaca-spacing: var(--theme-spacing, 1rem);
    --abaca-font-family: var(--theme-font-family, inherit);
    --abaca-font-size: var(--theme-font-size, 1rem);
    --abaca-line-height: var(--theme-line-height, 1.5);
}

/* Contenedor principal wholesale */
.abaca-b2b-wholesale-matrix {
    font-family: var(--abaca-font-family);
    font-size: var(--abaca-font-size);
    line-height: var(--abaca-line-height);
    color: var(--abaca-text);
    margin: calc(var(--abaca-spacing) * 2) 0;
}

/* Grid de productos */
.abaca-b2b-products-grid {
    display: grid;
}

/* Bloque de producto individual */
/* .abaca-b2b-product-block {
    background: var(--abaca-bg);
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    box-shadow: var(--abaca-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
} */


/* Encabezado del producto */
.product-header {
    padding: var(--abaca-spacing);
    border-bottom: 1px solid var(--abaca-border);
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
}

.product-details-link-wrapper {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.accordion-item.expanded .product-details-link-wrapper {
    opacity: 1;
    pointer-events: auto;
}

.product-details-link-wrapper a,
.product-details-link-wrapper a:visited {
    text-decoration: none;
    color: var(--abaca-text, #333);
}

.product-details-link-wrapper a h5 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.product-details-link-wrapper a:hover h5 {
    color: var(--abaca-primary, #2271b1);
}

.with-accordion .product-header.accordion-trigger {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* .with-accordion .product-header.accordion-trigger:hover {
    background-color: var(--abaca-bg-light);
} */

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--abaca-spacing);
    align-items: center;
}

/* Galería Swiper con ratio 9:11, max 300px */
.product-gallery {
    width: 120px;
    height: 146px; /* 120px * 11/9 ≈ 146px para ratio 9:11 */
    max-height: 300px;
    border-radius: var(--abaca-radius);
    overflow: hidden;
    background: var(--abaca-bg-light);
}

.abaca-product-swiper {
    width: 100%;
    height: 100%;
}

.gallery-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abaca-bg);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Controles Swiper */
.abaca-product-swiper .swiper-button-next,
.abaca-product-swiper .swiper-button-prev {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    color: #333;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.15); */
    z-index: 100;
    pointer-events: auto;
    margin-top: -16px;
    transition: all 0.3s ease;
}

.abaca-product-swiper .swiper-button-next:hover,
.abaca-product-swiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transform: scale(1.1);
}

.abaca-product-swiper .swiper-button-next:after,
.abaca-product-swiper .swiper-button-prev:after {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.abaca-product-swiper .swiper-button-next {
    right: 8px;
}

.abaca-product-swiper .swiper-button-prev {
    left: 8px;
}

.abaca-product-swiper .swiper-pagination {
    bottom: 12px;
    z-index: 100;
    pointer-events: auto;
}

.abaca-product-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.7;
    pointer-events: auto;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.abaca-product-swiper .swiper-pagination-bullet:hover {
    opacity: 0.9;
    transform: scale(1.2);
}

.abaca-product-swiper .swiper-pagination-bullet-active {
    background: var(--abaca-primary, #007cba);
    opacity: 1;
    transform: scale(1.3);
}

/* Asegurar que el swiper sea interactivo */
.abaca-product-swiper {
    position: relative;
    overflow: hidden;
}

.abaca-product-swiper .swiper-wrapper {
    position: relative;
}

.abaca-product-swiper .swiper-slide {
    position: relative;
}

/* Información del producto */
.product-info {
    flex: 1;
}

.product-title {
    margin: 0 0 calc(var(--abaca-spacing) * 0.5) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--abaca-text);
    line-height: 1.3;
}

.product-sku {
    font-size: 0.875rem;
    color: var(--abaca-text-light);
    font-weight: 400;
    margin-left: calc(var(--abaca-spacing) * 0.5);
}

.product-description {
    margin: calc(var(--abaca-spacing) * 0.5) 0;
    font-size: 0.9rem;
    color: var(--abaca-text-light);
    line-height: 1.4;
}

/* Summary del producto */
.product-summary {
    display: flex;
    gap: var(--abaca-spacing);
    margin-top: calc(var(--abaca-spacing) * 0.5);
    font-size: 0.9rem;
}

.summary-pieces {
    color: var(--abaca-text-light);
}

.summary-total {
    font-weight: 600;
    color: var(--abaca-primary);
}

/* Icono de acordeón */
.accordion-icon {
    width: 24px;
    height: 24px;
    color: var(--abaca-text-light);
    transition: transform 0.3s ease;
}

.accordion-item.expanded .accordion-icon {
    transform: rotate(180deg);
}

/* Contenido del producto */
.product-content {
    transition: all 0.3s ease;
}

/* Acordeón principal - DESKTOP */
.main-accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.accordion-item.expanded .main-accordion-content {
    max-height: 2000px; /* Suficientemente alto para cualquier contenido */
    opacity: 1;
    padding: var(--abaca-spacing);
}

/* Compatibilidad con clase legacy */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.accordion-item.expanded .accordion-content {
    max-height: 2000px; /* Suficientemente alto para cualquier contenido */
    opacity: 1;
    padding: var(--abaca-spacing);
}

.expanded-content {
    padding: var(--abaca-spacing);
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
}

.product-content.expanded-content {
    padding: 0px;
}

/* Matriz de selección */
.selection-matrix {
    margin-bottom: var(--abaca-spacing);
}

.matrix-table-wrapper {
    overflow-x: auto;
    border-radius: var(--abaca-radius);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--abaca-bg);
    min-width: 600px; /* Asegurar scroll horizontal en móvil */
}

/* Headers sticky */
.matrix-header.sticky-header th {
    position: sticky;
    top: 0;
    background: var(--abaca-bg-light);
    z-index: 10;
    border-bottom: 2px solid var(--abaca-border);
}

.matrix-table th,
.matrix-table td {
    padding: calc(var(--abaca-spacing) * 0.75);
    text-align: center;
    vertical-align: middle;
}

.matrix-table th {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--abaca-text);
    background: var(--abaca-bg-light);
}

/* Columnas específicas */
.color-column {
    text-align: left !important;
    min-width: 120px;
}

.size-column {
    min-width: 80px;
}

.subtotal-column {
    min-width: 100px;
}

.actions-column {
    min-width: 80px;
}

/* Celda de color */
.color-cell {
    text-align: left !important;
}

.color-info {
    display: flex;
    align-items: center;
    gap: calc(var(--abaca-spacing) * 0.5);
}

.color-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 50px;
    overflow: hidden;
    flex-shrink: 0;
}

.color-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.color-name {
    font-weight: 500;
    color: var(--abaca-text);
}

/* Controles de cantidad con botones +/- estilo Blocksy */
.quantity-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--abaca-spacing) * 0.25);
}

/* Desktop quantity inputs - Estilo Blocksy type-2 */
@media (min-width: 1131px) {
    .quantity-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        --quantity-width: 130px;
        --quantity-height: 55px;
        --theme-form-field-border-radius: 3px;
        width: var(--quantity-width);
        height: var(--quantity-height);
        border: 1px solid #ddd;
        border-radius: var(--theme-form-field-border-radius);
    }

    .quantity-input {
        width: 100%;
        height: 100%;
        border: none;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        background: transparent;
        color: #333;
        outline: none;
        border-radius: var(--theme-form-field-border-radius);
        box-sizing: border-box;
        /* Padding igual que Blocksy para hacer espacio a los botones */
        padding-inline: calc(var(--quantity-height, 55px)/1.8 + 9%);
        padding-block: 0px;
    }

    .quantity-minus,
    .quantity-plus {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        z-index: 2;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
        background: transparent;
        transition: all 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
        border: none;
        font-weight: 600;
        font-size: 16px;
        color: var(--abaca-primary, var(--theme-palette-color-1, #2271b1));
        /* Cálculos exactos de Blocksy type-2 */
        top: calc(50% - var(--quantity-height, 55px) / 3.6);
        width: calc(var(--quantity-height, 55px) / 1.8);
        height: calc(var(--quantity-height, 55px) / 1.8);
        border-radius: var(--theme-form-field-border-radius, 3px);
    }

    .quantity-minus {
        inset-inline-start: 9%;
    }

    .quantity-plus {
        inset-inline-end: 9%;
    }

    .quantity-minus:hover,
    .quantity-plus:hover {
        background: var(--abaca-primary, var(--theme-palette-color-1, #2271b1));
        color: white;
    }

    .quantity-minus:disabled,
    .quantity-plus:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: transparent;
        color: #ccc;
    }
}

/* Tablet quantity inputs - Versión compacta horizontal para pantallas intermedias */
@media (min-width: 768px) and (max-width: 1130px) {
    .quantity-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        width: 70px;
        height: 32px;
        border: 1px solid var(--abaca-border);
        border-radius: var(--abaca-radius);
        background: var(--abaca-bg);
        overflow: hidden;
    }
    
    .quantity-input {
        width: 50px !important;
        height: 100% !important;
        border: none !important;
        text-align: center;
        font-size: 0.9rem;
        background: transparent;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: textfield;
        padding: 0;
        margin: 0;
    }
    
    .quantity-minus,
    .quantity-plus {
        width: 20px;
        height: 100%;
        border: none;
        background: var(--abaca-bg-light, #f5f5f5);
        color: var(--abaca-text);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .quantity-minus {
        border-right: 1px solid var(--abaca-border);
    }

    .quantity-plus {
        border-left: 1px solid var(--abaca-border);
    }

    .quantity-minus:hover,
    .quantity-plus:hover {
        background: var(--abaca-primary);
        color: white;
    }

    .quantity-minus:disabled,
    .quantity-plus:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: var(--abaca-bg-light);
        color: var(--abaca-text-light);
    }
}

/* Mobile quantity inputs - Mantener estilo compacto */
@media (max-width: 768px) {
    .quantity-wrapper {
        display: flex;
        align-items: center;
        border: 1px solid var(--abaca-border);
        border-radius: var(--abaca-radius);
        background: var(--abaca-bg);
        overflow: hidden;
    }

    .quantity-minus,
    .quantity-plus {
        width: 20px!important;
        height: 20px!important;
        border: none;
        background: var(--abaca-bg-light);
        color: var(--abaca-text);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.2s ease;
    }

    .quantity-minus:hover,
    .quantity-plus:hover {
        background: var(--abaca-primary);
        color: white;
    }

    .quantity-minus:disabled,
    .quantity-plus:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: var(--abaca-bg-light);
        color: var(--abaca-text-light);
    }

    .quantity-input {
        width: 50px;
        height: 28px;
        border: none;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        background: var(--abaca-bg);
        color: var(--abaca-text);
        outline: none;
    }
}

/* Focus state for desktop Blocksy style */
@media (min-width: 1131px) {
    .quantity-input:focus {
        background: #f9f9f9;
        outline: none;
    }
}

/* Enhanced focus states for tablet - Theme consistent */
@media (min-width: 768px) and (max-width: 1130px) {
    .quantity-input:focus {
        background: var(--abaca-bg-light);
        outline: none;
        box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
    }
    
    .quantity-wrapper:focus-within {
        border-color: var(--abaca-primary-color);
        box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2), 0 0 0 2px rgba(34, 113, 177, 0.15);
    }
}

/* Focus state for mobile */
@media (max-width: 768px) {
    .quantity-input:focus {
        background: var(--abaca-bg-light);
    }
}

/* Ocultar spinners nativos */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* Precio de variación */
.variation-price {
    font-size: 0.8rem;
    color: var(--abaca-text-light);
    font-weight: 500;
}

/* No disponible */
.not-available {
    color: var(--abaca-text-light);
    font-style: italic;
}

/* Subtotal de fila */
.row-subtotal {
    font-weight: 600;
    color: var(--abaca-primary);
}

/* Contenedor de acciones de fila */
.row-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}


/* Botones de acción */
.clear-row-btn,
.clear-product-btn {
    padding: 8px;
    background: transparent;
    color: var(--abaca-text-light);
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.clear-all-btn {
    padding: calc(var(--abaca-spacing) * 0.5) var(--abaca-spacing);
    background: transparent;
    color: var(--abaca-text-light);
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-row-btn:hover,
.clear-product-btn:hover,
.clear-all-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Ocultar texto de screen reader visualmente */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Summary card del producto */
.product-summary-card {
    margin-top: var(--abaca-spacing);
    padding: var(--abaca-spacing);
    background: var(--abaca-bg-light);
    border-radius: var(--abaca-radius);
    border: 1px solid var(--abaca-border);
}

.summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: calc(var(--abaca-spacing) * 0.25);
}

.total-pieces {
    font-size: 0.9rem;
    color: var(--abaca-text-light);
}

.total-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--abaca-primary);
}

/* Acciones globales */
.global-actions {
    margin-top: calc(var(--abaca-spacing) * 2);
    text-align: center;
}

.clear-all-btn {
    padding: calc(var(--abaca-spacing) * 0.75) calc(var(--abaca-spacing) * 1.5);
    font-size: 1rem;
}

/* Mensaje sin productos */
.no-products-message {
    text-align: center;
    padding: calc(var(--abaca-spacing) * 3);
    color: var(--abaca-text-light);
}

/* Estados de loading y sync */
/* .quantity-input.loading,
.quantity-input.syncing,
.quantity-input-mobile.syncing {
    background: linear-gradient(90deg, #e3f2fd 25%, #bbdefb 50%, #e3f2fd 75%);
    background-size: 200% 100%;
    animation: highlight-update 1.5s infinite;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    color: var(--abaca-primary-color);
    font-weight: 600;
    pointer-events: none;
    transition: all 0.2s ease;
} */

/* Animación de actualización */
@keyframes highlight-update {
    0% {
        
        color:#005177
    }
    100% { background-color: transparent; }
}

.summary-total,
.row-subtotal,
.abaca-b2b-bulk-order-total-amount {
    transition: all 0.3s ease;
}

.summary-total.updated,
.row-subtotal.updated,
.abaca-b2b-bulk-order-total-amount.updated {
    animation: highlight-update 1s ease-out;
}

/* Mejoras visuales para los inputs */
.quantity-input:focus {
    border-color: var(--abaca-primary-color);
    box-shadow: 0 0 0 1px var(--abaca-primary-color);
    outline: none;
}

/* Mejoras para los botones */
.quantity-minus,
.quantity-plus {
    transition: all 0.3s ease;
    background: var(--abaca-light-bg);
    border: 1px solid var(--abaca-border-color);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
}

.quantity-minus:hover,
.quantity-plus:hover {
    background: var(--abaca-primary-color);
    border-color: var(--abaca-primary-color);
    color: white;
}

.quantity-minus:disabled,
.quantity-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--abaca-light-bg);
    border-color: var(--abaca-border-color);
    color: var(--abaca-text-color);
}

/* Estados de loading y sync para inputs */
.quantity-input.loading,
.quantity-input.syncing,
.quantity-input-mobile.syncing {
    background: linear-gradient(90deg, #e3f2fd 25%, #bbdefb 50%, #e3f2fd 75%);
    background-size: 200% 100%;
    animation: highlight-update 1.5s infinite;
    /* border-color: #007cba; */
    /* box-shadow: 0 0 0 1px #007cba; */
}


/* Estilos específicos para inputs en filas de tallas/colores */
/* .abaca-b2b-bulk-order .color-row .quantity-input,
.abaca-b2b-bulk-order .size-cell .quantity-input,
.abaca-b2b-bulk-order .variation-line .quantity-input {
    width: 60px;
    height: 32px;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--abaca-bg);
    color: var(--abaca-text);
    outline: none;
    -moz-appearance: textfield;
} */

/* .abaca-b2b-bulk-order .color-row .quantity-input:focus,
.abaca-b2b-bulk-order .size-cell .quantity-input:focus,
.abaca-b2b-bulk-order .variation-line .quantity-input:focus {
    border-color: var(--abaca-primary-color);
    box-shadow: 0 0 0 1px var(--abaca-primary-color);
    background: var(--abaca-bg-light);
} */

/* Ocultar spinners en inputs de filas */
/* .abaca-b2b-bulk-order .color-row .quantity-input::-webkit-outer-spin-button,
.abaca-b2b-bulk-order .color-row .quantity-input::-webkit-inner-spin-button,
.abaca-b2b-bulk-order .size-cell .quantity-input::-webkit-outer-spin-button,
.abaca-b2b-bulk-order .size-cell .quantity-input::-webkit-inner-spin-button,
.abaca-b2b-bulk-order .variation-line .quantity-input::-webkit-outer-spin-button,
.abaca-b2b-bulk-order .variation-line .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
} */

/* Responsive Design */
@media (max-width: 768px) {
    .abaca-b2b-wholesale-matrix {
        margin: var(--abaca-spacing) 0;
    }
    
    /* Inputs más pequeños en móvil */
    .abaca-b2b-bulk-order .color-row .quantity-input,
    .abaca-b2b-bulk-order .size-cell .quantity-input,
    .abaca-b2b-bulk-order .variation-line .quantity-input {
        width: 45px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .abaca-b2b-bulk-order .quantity-wrapper .quantity-input {
        width: 45px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* Header sticky en móvil */
    .product-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #f8f9fa;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .header-content {
        grid-template-columns: auto 1fr;
        gap: calc(var(--abaca-spacing) * 0.75);
    }
    
    .product-gallery {
        width: 80px;
        height: 97px; /* 80px * 11/9 ≈ 97px */
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    /* Ocultar vista desktop en móvil */
    .desktop-matrix-view {
        display: none;
    }
    
    /* Vista móvil: mostrar solo cuando el acordeón esté expandido */
    
    .summary-content {
        flex-direction: column;
        gap: var(--abaca-spacing);
        align-items: stretch;
    }
    
    /* Accordion Stack para móvil */
    .with-accordion .accordion-content {
        padding: calc(var(--abaca-spacing) * 0.75);
    }
    
    /* Grid de tallas móvil */
    .abaca-b2b-bulk-order .sizes-grid-mobile {
        display: flex;
        flex-direction: column;
        margin-bottom: 0.75rem;
    }
    
    .abaca-b2b-bulk-order .size-item-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;


    }
    
    .abaca-b2b-bulk-order .size-info-mobile {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .abaca-b2b-bulk-order .size-name-mobile {
        font-weight: 600;
        color: var(--abaca-text, #333);
        font-size: 0.95rem;
        margin: 0;
    }

    .abaca-b2b-bulk-order .size-price-mobile {
        font-size: 0.85rem;
        color: var(--abaca-text-light, #666);
        font-weight: 500;
        margin: 0;
    }

    .abaca-b2b-bulk-order .size-stock-mobile {
        font-size: 0.8rem;
        color: var(--abaca-text-light, #666);
        margin: 0;
    }

    /* Controles de cantidad móvil */
    .abaca-b2b-bulk-order .quantity-wrapper-mobile {
        display: flex;
        align-items: center;
        border: 1px solid var(--abaca-border, #ddd);
        border-radius: var(--abaca-radius, 4px);
        background: var(--abaca-bg, white);
        overflow: hidden;
        flex-shrink: 0;
        min-width: 140px;
    }
    
    .abaca-b2b-bulk-order .quantity-minus-mobile,
    .abaca-b2b-bulk-order .quantity-plus-mobile {
        width: 44px;
        height: 44px;
        border: none;
        background: var(--abaca-bg-light, #f8f9fa);
        color: var(--abaca-text, #333);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        font-weight: 600;
        transition: background-color 0.2s ease;
        user-select: none;
    }
    
    .abaca-b2b-bulk-order .quantity-minus-mobile:hover,
    .abaca-b2b-bulk-order .quantity-plus-mobile:hover {
        background: var(--abaca-bg-hover, #e9ecef);
    }
    
    .abaca-b2b-bulk-order .quantity-minus-mobile:active,
    .abaca-b2b-bulk-order .quantity-plus-mobile:active {
        background: var(--abaca-primary, #007cba);
        color: white;
    }

    .abaca-b2b-bulk-order .quantity-input-mobile {
        width: 60px;
        height: 44px;
        border: none;
        text-align: center;
        font-size: 1rem;
        font-weight: 600;
        background: var(--abaca-bg, white);
        color: var(--abaca-text, #333);
        outline: none;
    }

    .abaca-b2b-bulk-order .quantity-input-mobile:focus {
        background: var(--abaca-bg-light, #f8f9fa);
    }
    
    /* Ocultar spinners nativos en inputs móviles */
    .abaca-b2b-bulk-order .quantity-input-mobile::-webkit-outer-spin-button,
    .abaca-b2b-bulk-order .quantity-input-mobile::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    
    .abaca-b2b-bulk-order .quantity-input-mobile[type=number] {
        -moz-appearance: textfield;
    }
    
    /* Botones de limpiar móvil */
    .abaca-b2b-bulk-order .clear-size-btn-mobile {
        width: 32px;
        height: 44px;
        border: none;
        background: #dc3545;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        font-weight: 600;
        transition: background-color 0.2s ease;
        margin-left: 2px;
    }
    
    .abaca-b2b-bulk-order .clear-size-btn-mobile:hover {
        background: #c82333;
    }
    
}



@media (min-width: 769px) {
    /* Ocultar vista móvil en desktop */
    .mobile-accordion-stack {
        display: none !important;
    }
    
    /* Mostrar vista desktop */
    .desktop-matrix-view {
        display: block;
    }
}

/* Vista móvil: Accordion Stack por colores */
.mobile-accordion-stack {
    display: none; /* Oculto por defecto */
}

/* Mostrar en móvil */
@media (max-width: 768px) {
    .mobile-accordion-stack {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .accordion-item .mobile-accordion-stack {
        display: block !important;
    }
}

.color-accordion-item {
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    margin-bottom: calc(var(--abaca-spacing) * 0.5);
    background: var(--abaca-bg);
    overflow: hidden;
}

.color-accordion-item:last-child {
    margin-bottom: 0;
}

/* Header del color (trigger) */
.color-accordion-header {
    display: flex;
        align-items: center;
    justify-content: space-between;
    padding: var(--abaca-spacing);
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.color-accordion-header:hover {
    background-color: var(--abaca-bg-light);
}

.color-accordion-item.expanded .color-accordion-header {
    border-bottom-color: var(--abaca-border);
    background-color: var(--abaca-bg-light);
}

.color-info-mobile {
    display: flex;
    align-items: center;
    gap: calc(var(--abaca-spacing) * 0.75);
    flex: 1;
}

.color-thumbnail-mobile {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--abaca-bg-light);
}

.color-thumbnail-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.color-details {
    display: flex;
    flex-direction: column;
    gap: calc(var(--abaca-spacing) * 0.25);
}

.color-name-mobile {
    font-weight: 600;
    font-size: 1rem;
    color: var(--abaca-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-badge-container {
    display: flex;
    align-items: center;
}

.pieces-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--abaca-primary);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 8px;
    line-height: 1;
}

.pieces-badge:empty,
.pieces-badge[data-count="0"] {
    background: var(--abaca-text-light);
    opacity: 0.6;
}

.color-total-mobile {
    display: flex;
    align-items: center;
    margin-right: calc(var(--abaca-spacing) * 0.5);
}

.color-total-mobile .total-amount {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--abaca-primary);
}

.color-total-mobile.is-zero {
    color: #999 !important;
    opacity: 0.7;
}

.color-total-mobile.is-zero .total-amount {
    color: #999 !important;
}

/* Estilos para version desktop cuando valor es 0 */
.color-total.is-zero {
    color: #999 !important;
    opacity: 0.7;
}

.color-total.is-zero .total-amount {
    color: #999 !important;
}

/* Estilos para otros elementos de totales cuando valor es 0 */
.summary-total.is-zero,
.total-amount.is-zero,
.row-subtotal.is-zero {
    color: #999 !important;
    opacity: 0.7;
}

.expand-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--abaca-text-light);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.expand-button svg {
    transition: transform 0.3s ease;
}

.color-accordion-item.expanded .expand-button {
    color: var(--abaca-primary);
}

.color-accordion-item.expanded .expand-button svg {
    transform: rotate(180deg);
}

/* Contenido expandible del color */
.color-accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    background: var(--abaca-bg);
}

.color-accordion-item.expanded .color-accordion-content {
    max-height: 1000px; /* Suficientemente alto para el contenido */
    opacity: 1;
    padding: 0 var(--abaca-spacing) var(--abaca-spacing);
}

/* Lista de tallas */
.sizes-list {
    margin-bottom: var(--abaca-spacing);
}

.size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--abaca-spacing) * 0.75) 0;
    border-bottom: 1px solid var(--abaca-border);
}

.size-row:last-child {
    border-bottom: none;
}

.size-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(var(--abaca-spacing) * 0.25);
}

.size-name {
    font-weight: 500;
    color: var(--abaca-text);
    font-size: 0.95rem;
}

.size-price {
    font-size: 0.85rem;
    color: var(--abaca-text-light);
    font-weight: 500;
}

.size-stock {
    font-size: 0.8rem;
    color: var(--abaca-text-light);
}

/* Controles de cantidad móvil */
.quantity-wrapper-mobile {
    display: flex;
    align-items: center;
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    background: var(--abaca-bg);
    overflow: hidden;
    flex-shrink: 0;
}

.quantity-wrapper-mobile .quantity-minus,
.quantity-wrapper-mobile .quantity-plus {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--abaca-bg-light);
    color: var(--abaca-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.quantity-wrapper-mobile .quantity-minus:hover,
.quantity-wrapper-mobile .quantity-plus:hover {
    background: var(--abaca-primary);
    color: white;
}

.quantity-wrapper-mobile .quantity-minus:disabled,
.quantity-wrapper-mobile .quantity-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--abaca-bg-light);
    color: var(--abaca-text-light);
}

.quantity-wrapper-mobile .quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--abaca-bg);
    color: var(--abaca-text);
    outline: none;
}

.quantity-wrapper-mobile .quantity-input:focus {
    background: var(--abaca-bg-light);
}

.quantity-wrapper-mobile .quantity-input.loading {
    color: var(--abaca-primary-color);
    font-weight: 600;
    pointer-events: none;
    transition: color 0.2s ease;
}

/* Acciones del color en móvil */
.color-actions-mobile {
    text-align: center;
    padding-top: calc(var(--abaca-spacing) * 0.5);
    border-top: 1px solid var(--abaca-border);
}

.clear-color-btn {
    padding: 8px;
    background: transparent;
    color: var(--abaca-text-light);
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.clear-color-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Asegurar que el contenido expandido siempre sea visible */
.expanded-content {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible;
    padding: var(--abaca-spacing);
}

/* Mostrar stack móvil solo cuando el acordeón está expandido */
@media (max-width: 768px) {
  .accordion-item .mobile-accordion-stack {
    display: none;
  }
  .accordion-item.expanded .mobile-accordion-stack {
    display: block !important;
  }
}

/* Vista móvil */
.mobile-view {
    display: none;
}

@media (max-width: 768px) {
    .desktop-view {
        display: none;
    }
    
    .mobile-view {
        display: block !important;
    }

    .accordion-color {
        margin-bottom: 1rem;
        background: var(--theme-background-color);
        border: 1px solid var(--theme-border-color);
        border-radius: var(--theme-border-radius, 4px);
        overflow: hidden;
    }

    .accordion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        cursor: pointer;
        background: #fff;
    }

    .accordion-content {
        display: none;
        padding: 1rem;
        border-top: 1px solid var(--theme-border-color);
    }

    .accordion-color.is-expanded .accordion-content {
        display: block;
    }
}

/* Acordeón móvil: mostrar contenido cuando está expandido */
.accordion-color .accordion-content {
    display: none;
}
.accordion-color.expanded .accordion-content {
    display: block;
}

/* Estilos base para elementos móviles */
  .mobile-only,
  .mobile-product-header,
  .mobile-colors-content,
  .color-section-mobile,
  .color-header-mobile,
  .mobile-product-accordion,
  .mobile-header-content,
  .mobile-product-gallery,
  .mobile-product-info,
  .mobile-product-summary,
  .mobile-accordion-icon {
    display: none;
  }
  
  .desktop-only,
  .desktop-matrix-view {
    display: block;
}

/* Reglas específicas para móvil */
@media (max-width: 768px) {
    /* Ocultar elementos de desktop */
  .desktop-only,
  .desktop-matrix-view {
    display: none !important;
  }

    /* Mostrar elementos móviles */
    .mobile-only,
    .mobile-product-header,
    .mobile-colors-content,
    .color-section-mobile,
    .color-header-mobile,
    .mobile-product-accordion,
    .mobile-header-content,
    .mobile-product-gallery,
    .mobile-product-info,
    .mobile-product-summary,
    .mobile-accordion-icon {
        display: block !important;
    }

    /* Asegurar que el contenedor principal sea visible */
    .abaca-b2b-bulk-order {
        display: block !important;
    }

    /* Ocultar elementos desktop específicos */
    .desktop-view,
    .desktop-matrix,
    .product-header:not(.mobile-product-header) {
    display: none !important;
  }

    /* Mostrar contenedor de acordeón móvil */
    .mobile-colors-stack,
    .mobile-accordion-view {
    display: block !important;
    }
}

/* Estilos para el acordeón móvil */
.mobile-product-accordion {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.mobile-header-content {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-product-gallery {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.mobile-product-info {
    flex: 1;
}

.mobile-colors-content {
    border-top: 1px solid #ddd;
    padding: 1rem;
}

/* ===== RESET COMPLETO: ESTRUCTURA MÓVIL ORIGINAL ===== */

/* 1. ELEMENTOS BASE: Visibilidad por defecto */
.abaca-b2b-bulk-order .desktop-only,
.abaca-b2b-bulk-order .desktop-matrix-view,
.abaca-b2b-bulk-order .desktop-view {
    display: block;
}

.abaca-b2b-bulk-order .mobile-only,
.abaca-b2b-bulk-order .mobile-product-header,
.abaca-b2b-bulk-order .mobile-colors-content,
.abaca-b2b-bulk-order .color-section-mobile,
.abaca-b2b-bulk-order .color-header-mobile,
.abaca-b2b-bulk-order .mobile-product-accordion,
.abaca-b2b-bulk-order .mobile-header-content,
.abaca-b2b-bulk-order .mobile-product-gallery,
.abaca-b2b-bulk-order .mobile-product-info,
.abaca-b2b-bulk-order .mobile-product-summary,
.abaca-b2b-bulk-order .mobile-accordion-icon,
.abaca-b2b-bulk-order .mobile-colors-stack,
.abaca-b2b-bulk-order .mobile-accordion-view {
    display: none;
}

/* 2. REGLAS RESPONSIVE */
@media (min-width: 769px) {
    .abaca-b2b-bulk-order .mobile-only,
    .abaca-b2b-bulk-order .mobile-product-header,
    .abaca-b2b-bulk-order .mobile-colors-content,
    .abaca-b2b-bulk-order .color-section-mobile,
    .abaca-b2b-bulk-order .color-header-mobile,
    .abaca-b2b-bulk-order .mobile-product-accordion,
    .abaca-b2b-bulk-order .mobile-header-content,
    .abaca-b2b-bulk-order .mobile-product-gallery,
    .abaca-b2b-bulk-order .mobile-product-info,
    .abaca-b2b-bulk-order .mobile-product-summary,
    .abaca-b2b-bulk-order .mobile-accordion-icon,
    .abaca-b2b-bulk-order .mobile-colors-stack,
    .abaca-b2b-bulk-order .mobile-accordion-view {
    display: none !important;
  }

    .abaca-b2b-bulk-order .desktop-only,
    .abaca-b2b-bulk-order .desktop-matrix-view,
    .abaca-b2b-bulk-order .desktop-view {
    display: block !important;
    }
}

@media (max-width: 768px) {
    /* CRÍTICO: Forzar que los contenedores desktop estén expandidos en móvil */
    .abaca-b2b-bulk-order .accordion-content,
    .abaca-b2b-bulk-order .main-accordion-content {
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    display: block !important;
        visibility: visible !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Ocultar elementos desktop */
    .abaca-b2b-bulk-order .desktop-only,
    .abaca-b2b-bulk-order .desktop-matrix-view,
    .abaca-b2b-bulk-order .desktop-view {
        display: none !important;
    }
    
    /* Mostrar elementos móviles */
    .abaca-b2b-bulk-order .mobile-only,
    .abaca-b2b-bulk-order .mobile-product-header,
    .abaca-b2b-bulk-order .mobile-colors-content,
    .abaca-b2b-bulk-order .color-section-mobile,
    .abaca-b2b-bulk-order .color-header-mobile,
    .abaca-b2b-bulk-order .mobile-product-accordion,
    .abaca-b2b-bulk-order .mobile-header-content,
    .abaca-b2b-bulk-order .mobile-product-gallery,
    .abaca-b2b-bulk-order .mobile-product-info,
    .abaca-b2b-bulk-order .mobile-product-summary,
    .abaca-b2b-bulk-order .mobile-accordion-icon,
    .abaca-b2b-bulk-order .mobile-colors-stack,
    .abaca-b2b-bulk-order .mobile-accordion-view {
    display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ===== ACORDEÓN DESKTOP ===== */
.abaca-b2b-bulk-order .accordion-item {
    border: 1px solid var(--abaca-border, #ddd);
    border-radius: var(--abaca-radius, 4px);
    margin-bottom: 1rem;
    background: var(--abaca-bg, #fff);
}

.abaca-b2b-bulk-order .product-header.accordion-trigger {
    width: 100%;
    padding: 1rem;
    background: var(--abaca-bg-light, #f8f9fa);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

/* .abaca-b2b-bulk-order .product-header.accordion-trigger:hover {
    background: var(--abaca-bg-hover, #e9ecef);
} */

.abaca-b2b-bulk-order .accordion-content,
.abaca-b2b-bulk-order .main-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.abaca-b2b-bulk-order .accordion-item.expanded .accordion-content,
.abaca-b2b-bulk-order .accordion-item.expanded .main-accordion-content {
    max-height: 2000px;
    padding: 1rem;
    border-top: 1px solid var(--abaca-border, #ddd);
}

.abaca-b2b-bulk-order .accordion-icon {
    transition: transform 0.3s ease;
}

.abaca-b2b-bulk-order .accordion-item.expanded .accordion-icon {
    transform: rotate(180deg);
}

/* ===== ACORDEÓN MÓVIL: ESTRUCTURA ORIGINAL ===== */
@media (max-width: 768px) {
    /* Header del producto móvil */
    .abaca-b2b-bulk-order .mobile-product-header {
        background: var(--abaca-bg-light, #f8f9fa);
        border: 1px solid var(--abaca-border, #ddd);
        border-radius: var(--abaca-radius, 4px);
        margin-bottom: 0;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    
    /* Fondo verde para headers móviles de productos con items en carrito */
    .abaca-b2b-bulk-order .abaca-b2b-product-block.has-items .mobile-product-header {
        background: #d4edda !important;
        border-color: #c3e6cb !important;
    }
    
    .abaca-b2b-bulk-order .mobile-product-header:hover {
        background: var(--abaca-bg-hover, #e9ecef);
    }
    
    .abaca-b2b-bulk-order .mobile-product-header.expanded {
        background: var(--abaca-primary, #007cba);
        color: white;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    .abaca-b2b-bulk-order .mobile-header-content {
        padding: 0.75rem; /* Padding reducido */
        display: flex;
        align-items: flex-start; /* Alinear al inicio para que el icono pueda estar abajo */
        gap: 0.75rem; /* Gap reducido */
        position: relative; /* Para posicionar el icono absolutamente */
    }
    
    /* Galería móvil más grande */
    .abaca-b2b-bulk-order .mobile-product-gallery {
        width: 100px; /* Aumentado de 60px */
        height: 100px; /* Aumentado de 60px */
        flex-shrink: 0;
        border-radius: var(--abaca-radius, 4px);
        overflow: hidden;
        background: var(--abaca-bg-light, #f8f9fa);
    }

    .abaca-b2b-bulk-order .mobile-product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Contenedor para info y summary */
    .abaca-b2b-bulk-order .mobile-product-details-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column; /* Cambiar a columna para apilar info y summary */
        justify-content: space-between;
        min-width: 0;
        height: 100px; /* Misma altura que la imagen */
    }

    /* Info del producto móvil */
    .abaca-b2b-bulk-order .mobile-product-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column; /* Apilar título y SKU */
        justify-content: flex-start; /* Alinear al inicio */
    }

    .abaca-b2b-bulk-order .mobile-product-title {
        font-size: 1.1rem; /* Ligeramente más grande */
        font-weight: 600;
        color: inherit;
        margin: 0 0 0.25rem 0;
        line-height: 1.2;
    }

    .abaca-b2b-bulk-order .mobile-product-sku {
        font-size: 0.9rem; /* Ligeramente más grande */
        color: var(--abaca-text-light, #666);
        margin: 0;
    }

    /* Summary móvil alineado a la derecha */
    .abaca-b2b-bulk-order .mobile-product-summary {
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Alinear texto a la derecha */
        gap: 0.1rem; /* Espacio reducido */
        flex-shrink: 0; /* No encoger */
        margin-top: auto; /* Empujar hacia abajo */
    }

    .abaca-b2b-bulk-order .mobile-summary-pieces {
        font-size: 0.85rem;
        color: var(--abaca-text-light, #666);
    }

    .abaca-b2b-bulk-order .mobile-summary-total {
        font-weight: 600;
        color: var(--abaca-primary, #007cba);
        font-size: 1rem;
    }

    /* Icono acordeón móvil posicionado absolutamente */
    .abaca-b2b-bulk-order .mobile-accordion-icon {
        position: absolute;
        bottom: 0.75rem; /* Mismo padding que el contenedor */
        right: 0.75rem; /* Mismo padding que el contenedor */
        transition: transform 0.3s ease;
    }
}

@media (min-width: 769px) {
    /* Ocultar vista móvil en desktop */
    .mobile-accordion-stack {
        display: none !important;
    }
    
    /* Mostrar vista desktop */
    .desktop-matrix-view {
        display: block;
    }
}

/* Vista móvil: Accordion Stack por colores */
.mobile-accordion-stack {
    display: none; /* Oculto por defecto */
}

/* Mostrar en móvil */
@media (max-width: 768px) {
    .mobile-accordion-stack {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .accordion-item .mobile-accordion-stack {
        display: block !important;
    }
}

.color-accordion-item {
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    margin-bottom: calc(var(--abaca-spacing) * 0.5);
    background: var(--abaca-bg);
    overflow: hidden;
}

.color-accordion-item:last-child {
    margin-bottom: 0;
}

/* Header del color (trigger) */
.color-accordion-header {
    display: flex;
        align-items: center;
    justify-content: space-between;
    padding: var(--abaca-spacing);
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.color-accordion-header:hover {
    background-color: var(--abaca-bg-light);
}

.color-accordion-item.expanded .color-accordion-header {
    border-bottom-color: var(--abaca-border);
    background-color: var(--abaca-bg-light);
}

.color-info-mobile {
    display: flex;
    align-items: center;
    gap: calc(var(--abaca-spacing) * 0.75);
    flex: 1;
}

.color-thumbnail-mobile {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--abaca-bg-light);
}

.color-thumbnail-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.color-details {
    display: flex;
    flex-direction: column;
    gap: calc(var(--abaca-spacing) * 0.25);
}

.color-name-mobile {
    font-weight: 600;
    font-size: 1rem;
    color: var(--abaca-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-badge-container {
    display: flex;
    align-items: center;
}

.pieces-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--abaca-primary);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 8px;
    line-height: 1;
}

.pieces-badge:empty,
.pieces-badge[data-count="0"] {
    background: var(--abaca-text-light);
    opacity: 0.6;
}

.color-total-mobile {
    display: flex;
    align-items: center;
    margin-right: calc(var(--abaca-spacing) * 0.5);
}

.color-total-mobile .total-amount {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--abaca-primary);
}

.expand-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--abaca-text-light);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.expand-button svg {
    transition: transform 0.3s ease;
}

.color-accordion-item.expanded .expand-button {
    color: var(--abaca-primary);
}

.color-accordion-item.expanded .expand-button svg {
    transform: rotate(180deg);
}

/* Contenido expandible del color */
.color-accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    background: var(--abaca-bg);
}

.color-accordion-item.expanded .color-accordion-content {
    max-height: 1000px; /* Suficientemente alto para el contenido */
    opacity: 1;
    padding: 0 var(--abaca-spacing) var(--abaca-spacing);
}

/* Lista de tallas */
.sizes-list {
    margin-bottom: var(--abaca-spacing);
}

.size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--abaca-spacing) * 0.75) 0;
    border-bottom: 1px solid var(--abaca-border);
}

.size-row:last-child {
    border-bottom: none;
}

.size-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(var(--abaca-spacing) * 0.25);
}

.size-name {
    font-weight: 500;
    color: var(--abaca-text);
    font-size: 0.95rem;
}

.size-price {
    font-size: 0.85rem;
    color: var(--abaca-text-light);
    font-weight: 500;
}

.size-stock {
    font-size: 0.8rem;
    color: var(--abaca-text-light);
}

/* Controles de cantidad móvil */
.quantity-wrapper-mobile {
    display: flex;
    align-items: center;
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    background: var(--abaca-bg);
    overflow: hidden;
    flex-shrink: 0;
}

.quantity-wrapper-mobile .quantity-minus,
.quantity-wrapper-mobile .quantity-plus {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--abaca-bg-light);
    color: var(--abaca-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.quantity-wrapper-mobile .quantity-minus:hover,
.quantity-wrapper-mobile .quantity-plus:hover {
    background: var(--abaca-primary);
    color: white;
}

.quantity-wrapper-mobile .quantity-minus:disabled,
.quantity-wrapper-mobile .quantity-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--abaca-bg-light);
    color: var(--abaca-text-light);
}

.quantity-wrapper-mobile .quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--abaca-bg);
    color: var(--abaca-text);
    outline: none;
}

.quantity-wrapper-mobile .quantity-input:focus {
    background: var(--abaca-bg-light);
}

.quantity-wrapper-mobile .quantity-input.loading {
    color: var(--abaca-primary-color);
    font-weight: 600;
    pointer-events: none;
    transition: color 0.2s ease;
}

/* Acciones del color en móvil */
.color-actions-mobile {
    text-align: center;
    padding-top: calc(var(--abaca-spacing) * 0.5);
    border-top: 1px solid var(--abaca-border);
}

.clear-color-btn {
    padding: 8px;
    background: transparent;
    color: var(--abaca-text-light);
    border: 1px solid var(--abaca-border);
    border-radius: var(--abaca-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.clear-color-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Asegurar que el contenido expandido siempre sea visible */
.expanded-content {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible;
    padding: var(--abaca-spacing);
}

/* Mostrar stack móvil solo cuando el acordeón está expandido */
@media (max-width: 768px) {
  .accordion-item .mobile-accordion-stack {
    display: none;
  }
  .accordion-item.expanded .mobile-accordion-stack {
    display: block !important;
  }
}

/* Vista móvil */
.mobile-view {
    display: none;
}

@media (max-width: 768px) {
    .desktop-view {
        display: none;
    }
    
    .mobile-view {
        display: block !important;
    }

    .accordion-color {
        margin-bottom: 1rem;
        background: var(--theme-background-color);
        border: 1px solid var(--theme-border-color);
        border-radius: var(--theme-border-radius, 4px);
        overflow: hidden;
    }

    .accordion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        cursor: pointer;
        background: #fff;
    }

    .accordion-content {
        display: none;
        padding: 1rem;
        border-top: 1px solid var(--theme-border-color);
    }

    .accordion-color.is-expanded .accordion-content {
        display: block;
    }
}

/* Acordeón móvil: mostrar contenido cuando está expandido */
.accordion-color .accordion-content {
    display: none;
}
.accordion-color.expanded .accordion-content {
    display: block;
}

/* Estilos base para elementos móviles */
  .mobile-only,
  .mobile-product-header,
  .mobile-colors-content,
  .color-section-mobile,
  .color-header-mobile,
  .mobile-product-accordion,
  .mobile-header-content,
  .mobile-product-gallery,
  .mobile-product-info,
  .mobile-product-summary,
  .mobile-accordion-icon {
    display: none;
  }
  
  .desktop-only,
  .desktop-matrix-view {
    display: block;
}

/* Reglas específicas para móvil */
@media (max-width: 768px) {
    /* Ocultar elementos de desktop */
  .desktop-only,
  .desktop-matrix-view {
    display: none !important;
  }

    /* Mostrar elementos móviles */
    .mobile-only,
    .mobile-product-header,
    .mobile-colors-content,
    .color-section-mobile,
    .color-header-mobile,
    .mobile-product-accordion,
    .mobile-header-content,
    .mobile-product-gallery,
    .mobile-product-info,
    .mobile-product-summary,
    .mobile-accordion-icon {
        display: block !important;
    }

    /* Asegurar que el contenedor principal sea visible */
    .abaca-b2b-bulk-order {
        display: block !important;
    }

    /* Ocultar elementos desktop específicos */
    .desktop-view,
    .desktop-matrix,
    .product-header:not(.mobile-product-header) {
    display: none !important;
  }

    /* Mostrar contenedor de acordeón móvil */
    .mobile-colors-stack,
    .mobile-accordion-view {
    display: block !important;
    }
}

/* Estilos para el acordeón móvil */
.mobile-product-accordion {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.mobile-header-content {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-product-gallery {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.mobile-product-info {
    flex: 1;
}

.mobile-colors-content {
    border-top: 1px solid #ddd;
    padding: 1rem;
}

/* ===== ANIMACIONES ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== UTILIDADES ===== */
.show {
    display: block !important;
}

.hide {
    display: none !important;
}

.expanded {
    /* Clase para elementos expandidos */
}

/* ===== LIMPIEZA: Eliminar estilos conflictivos ===== */
.abaca-b2b-bulk-order .mobile-only {
    opacity: 1 !important;
    visibility: visible !important;
}

.abaca-b2b-bulk-order .desktop-only {
    opacity: 1 !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .abaca-b2b-bulk-order .mobile-only {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@media (min-width: 769px) {
    .abaca-b2b-bulk-order .desktop-only {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ===== FORZAR VISIBILIDAD MÓVIL - MÁXIMA PRIORIDAD ===== */

/* Forzar ocultamiento en desktop */
@media (min-width: 769px) {
    /* Ocultar elementos móviles PERO mantener inputs visibles para sincronización */
    body .abaca-b2b-bulk-order .mobile-only:not(input),
    body .abaca-b2b-bulk-order .mobile-product-header:not(input),
    body .abaca-b2b-bulk-order .mobile-colors-content:not(input),
    body .abaca-b2b-bulk-order .color-section-mobile:not(input),
    body .abaca-b2b-bulk-order .color-header-mobile:not(input),
    body .abaca-b2b-bulk-order .mobile-product-accordion:not(input),
    body .abaca-b2b-bulk-order .mobile-header-content:not(input),
    body .abaca-b2b-bulk-order .mobile-product-gallery:not(input),
    body .abaca-b2b-bulk-order .mobile-product-info:not(input),
    body .abaca-b2b-bulk-order .mobile-product-summary:not(input),
    body .abaca-b2b-bulk-order .mobile-accordion-icon:not(input),
    body .abaca-b2b-bulk-order .mobile-colors-stack:not(input),
    body .abaca-b2b-bulk-order .mobile-accordion-view:not(input) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Inputs móviles ocultos pero funcionales para sincronización */
    body .abaca-b2b-bulk-order .mobile-only input,
    body .abaca-b2b-bulk-order .mobile-product-header input,
    body .abaca-b2b-bulk-order .mobile-colors-content input,
    body .abaca-b2b-bulk-order .color-section-mobile input,
    body .abaca-b2b-bulk-order .color-header-mobile input,
    body .abaca-b2b-bulk-order .mobile-product-accordion input,
    body .abaca-b2b-bulk-order .mobile-header-content input,
    body .abaca-b2b-bulk-order .mobile-product-gallery input,
    body .abaca-b2b-bulk-order .mobile-product-info input,
    body .abaca-b2b-bulk-order .mobile-product-summary input,
    body .abaca-b2b-bulk-order .mobile-accordion-icon input,
    body .abaca-b2b-bulk-order .mobile-colors-stack input,
    body .abaca-b2b-bulk-order .mobile-accordion-view input {
        position: absolute !important;
        left: -9999px !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Mostrar elementos desktop */
    body .abaca-b2b-bulk-order .desktop-only,
    body .abaca-b2b-bulk-order .desktop-matrix-view,
    body .abaca-b2b-bulk-order .desktop-view,
    body .abaca-b2b-bulk-order .table-only,
    body .abaca-b2b-bulk-order .product-header.accordion-trigger {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Forzar visibilidad en móvil */
@media (max-width: 768px) {
    /* CRÍTICO: Forzar que los contenedores desktop estén expandidos en móvil */
    body .abaca-b2b-bulk-order .accordion-content,
    body .abaca-b2b-bulk-order .main-accordion-content {
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        display: block !important;
        visibility: visible !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Forzar que los bloques de producto estén expandidos */
    body .abaca-b2b-bulk-order .abaca-b2b-product-block {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* NUEVO: Forzar visibilidad de elementos "table only" en móvil */
    body .abaca-b2b-bulk-order .table-only,
    body .abaca-b2b-bulk-order .desktop-table-view,
    body .abaca-b2b-bulk-order .matrix-view {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Forzar visibilidad de elementos móviles */
    body .abaca-b2b-bulk-order .mobile-only,
    body .abaca-b2b-bulk-order .mobile-product-header,
    body .abaca-b2b-bulk-order .color-section-mobile,
    body .abaca-b2b-bulk-order .color-header-mobile,
    body .abaca-b2b-bulk-order .mobile-product-accordion,
    body .abaca-b2b-bulk-order .mobile-header-content,
    body .abaca-b2b-bulk-order .mobile-product-gallery,
    body .abaca-b2b-bulk-order .mobile-product-info,
    body .abaca-b2b-bulk-order .mobile-product-summary,
    body .abaca-b2b-bulk-order .mobile-accordion-icon,
    body .abaca-b2b-bulk-order .mobile-colors-stack,
    body .abaca-b2b-bulk-order .mobile-accordion-view {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Contenido del acordeón inicialmente oculto */
    body .abaca-b2b-bulk-order .mobile-colors-content {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Contenido del acordeón cuando está visible */
    body .abaca-b2b-bulk-order .mobile-colors-content.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Modo table_only móvil: acordeones directos sin anidamiento */
    body .abaca-b2b-bulk-order .mobile-colors-content.table-only-mobile {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* En table_only móvil, reducir márgenes laterales y eliminar doble borde */
    body .abaca-b2b-bulk-order .mobile-colors-content.table-only-mobile {
        border: none !important;
        padding: 10px !important;
        margin: 0 !important;
    }
    
    body .abaca-b2b-bulk-order .mobile-colors-content.table-only-mobile .color-section-mobile {
        margin: 0 0 1px 0 !important;
        border-radius: 0 !important;

    }
    
    body .abaca-b2b-bulk-order .mobile-colors-content.table-only-mobile .color-section-mobile:first-child {
        border-top-left-radius: var(--abaca-radius, 4px) !important;
        border-top-right-radius: var(--abaca-radius, 4px) !important;
    }
    
    body .abaca-b2b-bulk-order .mobile-colors-content.table-only-mobile .color-section-mobile:last-child {
        border-bottom-left-radius: var(--abaca-radius, 4px) !important;
        border-bottom-right-radius: var(--abaca-radius, 4px) !important;
    }
    
    /* Ocultar elementos desktop en móvil PERO mantener inputs visibles para sincronización */
    body .abaca-b2b-bulk-order .desktop-only:not(input),
    body .abaca-b2b-bulk-order .desktop-matrix-view:not(input),
    body .abaca-b2b-bulk-order .desktop-view:not(input) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Inputs desktop ocultos pero funcionales para sincronización */
    body .abaca-b2b-bulk-order .desktop-only input,
    body .abaca-b2b-bulk-order .desktop-matrix-view input,
    body .abaca-b2b-bulk-order .desktop-view input {
        position: absolute !important;
        left: -9999px !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Ocultar headers desktop en móvil */
    body .abaca-b2b-bulk-order .product-header.accordion-trigger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}



/* ===== ESTILOS ACORDEÓN MÓVIL ===== */
@media (max-width: 768px) {
    /* Header del acordeón móvil */
    body .abaca-b2b-bulk-order .mobile-product-header {
        background: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        padding: 15px !important;
        margin-bottom: 0px;
        cursor: pointer !important;
        border-radius: 5px !important;
        position: relative !important;
    }
    
    body .abaca-b2b-bulk-order .mobile-product-header:hover {
        background: #e9ecef !important;
    }
    
    /* Contenido del acordeón móvil */
    body .abaca-b2b-bulk-order .mobile-colors-content {
        background: white !important;
        border: 1px solid #dee2e6 !important;
        border-top: none !important;
        padding: 15px !important;
        margin-bottom: 10px !important;
        border-radius: 0 0 5px 5px !important;
    }
    
    /* Stack de colores móvil */
    body .abaca-b2b-bulk-order .mobile-colors-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 0px !important;
    }
    
    /* Sección de color móvil */
    body .abaca-b2b-bulk-order .color-section-mobile {
        border: none !important;
        padding: 0px !important;
        background: transparent !important;
    }
    
    /* Header de color móvil */
    body .abaca-b2b-bulk-order .color-header-mobile {
        font-weight: bold !important;
        margin-bottom: 10px !important;
        padding: 5px !important;
        background: #f8f9fa !important;
        border-radius: 3px !important;
    }
} 

/* ===== ESTILOS ESPECÍFICOS PARA TEMPLATE SIMPLE (b2b_bulk_table_only) ===== */

/* Header de color móvil mejorado */
body .abaca-b2b-bulk-order .color-header-mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    background: #f8f9fa !important;
    border-radius: 5px !important;
    border: 1px solid #dee2e6 !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

/* FONDO CON IMAGEN cuando acordeón está expandido - MÁXIMA ESPECIFICIDAD */
@media (max-width: 768px) {
    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile {
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        position: relative !important;
        color: white !important;
        border-color: #2c3e50 !important;
    }
    
    /* Forzar imagen de fondo en headers expandidos */
    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile[style*="background-image"] {
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        position: relative !important;
        min-height: 80px !important;
    }
    
    /* Forzar imagen de fondo en TODOS los headers expandidos */
    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile {
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        position: relative !important;
        min-height: 80px !important;
    }


    
    /* Asegurar que el contenido esté por encima del overlay */
    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile > * {
        position: relative;
        z-index: 2;
        color: white !important;
    }

    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile * {
        color: white !important;
    }

    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-name-mobile {
        color: white !important;
    }

    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-total-mobile {
        color: white !important;
    }

    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-badge-mobile {
        background: rgba(255, 255, 255, 0.2) !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }

    body .abaca-b2b-bulk-order .color-section-mobile.expanded .expand-icon-mobile {
        color: white !important;
    }
    
    /* Ocultar thumbnail cuando está expandido */
    body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-thumbnail-mobile {
        display: none !important;
    }
}

/* Color info (thumbnail + name) */
body .abaca-b2b-bulk-order .color-header-mobile .mobile-color-thumbnail,
body .abaca-b2b-bulk-order .color-header-mobile .mobile-color-name {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Color actions (subtotal + clear button) */
body .abaca-b2b-bulk-order .mobile-color-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Elementos móviles del template */
body .abaca-b2b-bulk-order .mobile-sizes-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 10px !important;
    margin-top: 10px !important;
}

body .abaca-b2b-bulk-order .mobile-size-item {
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    padding: 10px !important;
    background: #fff !important;
    text-align: center !important;
}

/* Header de talla con botón limpiar */
body .abaca-b2b-bulk-order .mobile-size-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

body .abaca-b2b-bulk-order .mobile-size-label {
    font-weight: bold !important;
    color: #333 !important;
}

body .abaca-b2b-bulk-order .mobile-quantity-control {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
}

body .abaca-b2b-bulk-order .mobile-quantity-wrapper {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    overflow: hidden !important;
}

body .abaca-b2b-bulk-order .mobile-color-subtotal {
    font-weight: bold !important;
    color: #28a745 !important;
    font-size: 14px !important;
    min-width: 60px !important;
    text-align: right !important;
} 

/* ===== FLOATING CART ===== */
.abaca-floating-cart {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    border-radius: 25px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 14px;
    min-width: 400px;
    max-width: 600px;
    white-space: nowrap;
    overflow: hidden;
}

.abaca-floating-cart:hover {
    background: #218838;
    transform: translateX(-50%) translateY(-2px);
}

.floating-cart-prev,
.floating-cart-next {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  
.floating-cart-prev:hover,
.floating-cart-next:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.floating-cart-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.floating-cart-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  
.floating-cart-quantity {
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    flex-shrink: 0;
}

.floating-cart-product-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.floating-cart-text {
    opacity: 0.9;
    flex-shrink: 0;
    font-size: 12px;
}



.floating-cart-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.floating-cart-button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Tablet - 768px to 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .abaca-floating-cart {
        min-width: 350px;
        max-width: 500px;
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .floating-cart-prev,
    .floating-cart-next {
        width: 30px;
        height: 30px;
    }
    
    .floating-cart-product-name {
        max-width: 200px;
    }
    
    .floating-cart-button {
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* Mobile - max-width 768px */
@media (max-width: 768px) {
    .abaca-floating-cart {
        bottom: 15px;
        padding: 15px 20px;
        font-size: 12px;
        min-width: unset;
        max-width: 95vw;
    }
    
    .floating-cart-prev,
    .floating-cart-next {
        width: 24px;
        height: 24px;
    }
    
    .floating-cart-prev svg,
    .floating-cart-next svg {
        width: 12px;
        height: 12px;
    }
    
    .floating-cart-content {
        gap: 4px;
    }
    
    .floating-cart-info {
        gap: 3px;
    }
    
    .floating-cart-quantity {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .floating-cart-button {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .floating-cart-product-name {
        max-width: 80px;
    }
}

/* OPCIÓN 2: Diseño vertical compacto (comentado)
.abaca-floating-cart-option2 {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 12px;
    max-width: 200px;
}

.floating-cart-content-option2 {
    text-align: center;
}

.floating-cart-info-option2 {
    margin-bottom: 6px;
}

.floating-cart-actions-option2 {
    display: flex;
    gap: 6px;
    justify-content: center;
}
*/

/* OPCIÓN 3: Diseño minimalista (comentado)
.abaca-floating-cart-option3 {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #28a745;
    color: white;
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 13px;
}

.floating-cart-mini-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-cart-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
*/

body:not(.single-product) .abaca-floating-cart {
    display: none !important;
}

/* Forzar imagen de fondo en TODOS los headers expandidos */
body .abaca-b2b-bulk-order .color-section-mobile.expanded .color-header-mobile {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    min-height: 80px !important;
}

/* CSS específico para headers con imagen de fondo */
body .abaca-b2b-bulk-order .color-header-mobile.has-background-image {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    min-height: 80px !important;
} 

/* ===== NUEVA PÁGINA DE CARRITO B2B ===== */

/* Contenedor principal de la página de carrito */
.abaca-b2b-cart-matrix.is-cart-context {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

/* Layout Desktop */
.abaca-b2b-cart-desktop {
    display: block;
}

.cart-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sección de productos (70% en desktop) */
.cart-products-section {
    flex: 1;
    min-width: 0;
}

.cart-section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--abaca-text-color);
    border-bottom: 2px solid var(--abaca-border-color);
    padding-bottom: 10px;
}

/* Tarjetas de producto */
.abaca-cart-product-card {
    background: #fff;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    margin-bottom: 20px;
    box-shadow: var(--abaca-shadow);
    overflow: hidden;
}

.cart-product-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--abaca-light-bg);
    border-bottom: 1px solid var(--abaca-border-color);
}

.cart-product-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    flex-shrink: 0;
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-product-info {
    flex: 1;
    min-width: 0;
}

.cart-product-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--abaca-text-color);
}

.cart-product-sku {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.sku-label {
    font-weight: 500;
}

.cart-product-summary {
    display: flex;
    gap: 15px;
    align-items: center;
}

.product-total-quantity {
    font-weight: 500;
    color: var(--abaca-primary-color);
}

.product-total-price {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--abaca-text-color);
}

.cart-product-toggle {
    margin-left: auto;
}

.color-grouping-toggle {
    background: var(--abaca-primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: var(--abaca-radius);
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.color-grouping-toggle:hover {
    background: var(--abaca-primary-hover);
}

.toggle-icon {
    margin-left: 8px;
    transition: transform 0.3s;
}

/* Contenido expandible por colores */
.cart-product-colors {
    padding: 20px;
    background: #fff;
}

.cart-color-group {
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.cart-color-group:last-child {
    margin-bottom: 0;
}

.cart-color-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid var(--abaca-border-color);
}

.color-thumbnail {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    flex-shrink: 0;
}

.color-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.color-info {
    flex: 1;
}

.color-name {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-transform: capitalize;
}

.color-summary {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.cart-color-variations {
    padding: 15px;
}

.cart-variation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-variation-item:last-child {
    border-bottom: none;
}

.variation-details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.variation-size {
    font-weight: 500;
}

.variation-price {
    color: var(--abaca-primary-color);
    font-weight: 600;
}

.variation-quantity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--abaca-border-color);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-minus,
.quantity-plus {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.quantity-minus:hover,
.quantity-plus:hover {
    background: #e0e0e0;
}

.quantity-input {
    border: none;
    width: 60px;
    height: 20px;
    text-align: center;
    font-weight: 500;
}

.variation-line-total {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* Cart Collaterals (Sticky - 30% pantalla) */
.cart-collaterals-section {
    width: 30%;
    flex-shrink: 0;
}

.cart-collaterals-sticky {
    position: sticky;
    top: 20px;
    background: #fff;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    box-shadow: var(--abaca-shadow);
}

/* .cart-totals-wrapper {
    padding: 20px;
}

.totals-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--abaca-text-color);
    border-bottom: 1px solid var(--abaca-border-color);
    padding-bottom: 10px;
}

.cart-totals {
    margin-bottom: 25px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cart-total-row:last-child {
    border-bottom: none;
}

.cart-total-row.total-final {
    font-size: 1.1em;
    font-weight: 600;
    border-top: 2px solid var(--abaca-border-color);
    padding-top: 15px;
    margin-top: 10px;
}

.total-label {
    font-weight: 500;
}

.total-value {
    font-weight: 600;
    color: var(--abaca-primary-color);
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
} */

/* .checkout-button {
    background: var(--abaca-primary-color) !important;
    color: white !important;
    padding: 12px 20px !important;
    border: none !important;
    border-radius: var(--abaca-radius) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: background 0.3s !important;
}

.checkout-button:hover {
    background: var(--abaca-primary-hover) !important;
} */

.continue-shopping {
    background: #f5f5f5 !important;
    color: var(--abaca-text-color) !important;
    padding: 10px 20px !important;
    border: 1px solid var(--abaca-border-color) !important;
    border-radius: var(--abaca-radius) !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: background 0.3s !important;
}

.continue-shopping:hover {
    background: #e0e0e0 !important;
}

.clear-cart-button {
    background: #dc3545 !important;
    color: white !important;
    padding: 8px 20px !important;
    border: none !important;
    border-radius: var(--abaca-radius) !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
    transition: background 0.3s !important;
}

.clear-cart-button:hover {
    background: #c82333 !important;
}


/* Carrito vacío */
.abaca-b2b-cart-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
}

.abaca-b2b-cart-empty p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.abaca-b2b-cart-empty .button {
    background: var(--abaca-primary-color) !important;
    color: white !important;
    padding: 12px 25px !important;
    border: none !important;
    border-radius: var(--abaca-radius) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: background 0.3s !important;
}

.abaca-b2b-cart-empty .button:hover {
    background: var(--abaca-primary-hover) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .abaca-b2b-cart-matrix.is-cart-context {
        padding: 0;
    }
    
    .abaca-b2b-cart-desktop {
        display: none;
    }
    
    .abaca-b2b-cart-mobile {
        display: block;
    }
    
    .cart-content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .cart-collaterals-section {
        width: 100%;
        order: -1;
    }
    
    .cart-collaterals-sticky {
        position: static;
    }
}

@media (max-width: 480px) {
    .mobile-product-header {
        padding: 12px;
    }
    
    .mobile-product-image {
        width: 50px;
        height: 50px;
    }
    
    .mobile-color-header {
        padding: 10px 12px;
    }
    
    .mobile-color-thumbnail {
        width: 35px;
        height: 35px;
    }
    
    .mobile-variation-item {
        padding: 6px 0;
    }
    
    .quantity-minus-mobile,
    .quantity-plus-mobile {
        width: 28px;
        height: 28px;
        font-size: 0.8em;
    }
    
    .quantity-input-mobile {
        width: 40px;
        height: 28px;
        font-size: 0.8em;
    }
}

/* Collaterals a la izquierda */
.abaca-b2b-cart-matrix.is-cart-context.left-collaterals .cart-content-wrapper {
    flex-direction: row-reverse;
}

/* Animaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.cart-product-colors,
.mobile-product-content,
.mobile-color-content {
    animation: slideDown 0.3s ease-out;
}

/* Estados de carga */
.quantity-input.loading,
.quantity-input-mobile.loading {
    background: #f0f8ff;
    opacity: 0.7;
}

/* Compatibilidad con el sistema existente */
.abaca-b2b-cart-matrix.is-cart-context .quantity-input,
.abaca-b2b-cart-matrix.is-cart-context .quantity-input-mobile {
    /* Reutilizar estilos del sistema existente */
}

.abaca-b2b-cart-matrix.is-cart-context .quantity-minus,
.abaca-b2b-cart-matrix.is-cart-context .quantity-plus,
.abaca-b2b-cart-matrix.is-cart-context .quantity-minus-mobile,
.abaca-b2b-cart-matrix.is-cart-context .quantity-plus-mobile {
    /* Reutilizar estilos del sistema existente */
}

/* ===== PÁGINA DE CARRITO B2B ===== */

.abaca-b2b-cart-matrix.is-cart-context {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

.cart-layout-desktop {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

/* ===== PRODUCTOS DEL CARRITO ===== */

.cart-products-section {
    min-height: 400px;
}

.cart-section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: 600;
    color: inherit;
}

.abaca-cart-product-card {
    background: var(--theme-palette-color-8, #ffffff);
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.abaca-cart-product-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.abaca-cart-product-card.expanded {
    border-color: var(--theme-palette-color-1, #007cba);
}

/* Header del producto */
.cart-product-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cart-product-header:hover {
    background-color: var(--theme-palette-color-7, #f8f9fa);
}

.cart-product-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-product-info {
    flex: 1;
}

.cart-product-title {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: inherit;
}

.cart-product-sku {
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--theme-palette-color-4, #666);
}

.cart-product-summary {
    display: flex;
    gap: 15px;
    font-size: 0.95em;
}

.product-total-quantity {
    color: var(--theme-palette-color-4, #666);
}

.product-total-price {
    font-weight: 600;
    color: var(--theme-palette-color-1, #007cba);
}

.cart-product-toggle {
    margin-left: 15px;
}

.toggle-icon {
    font-size: 1.2em;
    color: var(--theme-palette-color-4, #666);
    transition: transform 0.3s ease;
}

/* Contenido de colores */
.cart-product-colors {
    border-top: 1px solid var(--theme-palette-color-3, #e1e5e9);
    padding: 0 20px 20px 20px;
}

.cart-color-group {
    margin-bottom: 20px;
}

.cart-color-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--theme-palette-color-3, #e1e5e9);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--theme-palette-color-3, #e1e5e9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.color-name {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: inherit;
}

.color-quantity {
    color: var(--theme-palette-color-4, #666);
    font-size: 0.9em;
    text-align: right;
}

.color-price {
    font-weight: 600;
    color: var(--theme-palette-color-1, #007cba);
    text-align: right;
}

/* Variaciones - Layout equidistante */
.cart-variations-list {
    display: grid;
    gap: 12px;
}

.cart-variation-item {
    display: grid;
    grid-template-columns: 1fr 1fr 140px 100px 40px;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--theme-palette-color-7, #f8f9fa);
    border-radius: 6px;
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
}

.variation-size {
    display: flex;
    flex-direction: column;
}

.size-label {
    font-size: 0.8em;
    color: var(--theme-palette-color-4, #666);
    margin-bottom: 2px;
}

.size-value {
    font-weight: 500;
    color: inherit;
}

.variation-price {
    font-weight: 500;
    color: inherit;
    text-align: right;
}

.variation-line-total {
    font-weight: 600;
    color: var(--theme-palette-color-1, #007cba);
    text-align: right;
}

.variation-actions {
    display: flex;
    justify-content: center;
}

.clear-variation-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
    background: var(--theme-palette-color-8, #ffffff);
    color: var(--theme-palette-color-4, #666);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-variation-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Controles de cantidad */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
    background: var(--theme-palette-color-8, #ffffff);
    color: var(--theme-palette-color-1, #007cba);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: var(--theme-palette-color-1, #007cba);
    color: var(--theme-palette-color-8, #ffffff);
}

.quantity-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
    border-radius: 4px;
    font-size: 14px;
    background: var(--theme-palette-color-8, #ffffff);
    color: inherit;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--theme-palette-color-1, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.quantity-input.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== CART COLLATERALS ===== */

.cart-collaterals-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Los cart collaterals heredan completamente los estilos del tema */
.cart-collaterals {
    /* Sin estilos adicionales - usar los del tema */
}

/* ===== VERSIÓN MÓVIL ===== */

@media (max-width: 768px) {
    .abaca-b2b-cart-matrix.is-cart-context {
        padding: 15px;
    }
    
    .cart-layout-desktop {
        display: none;
    }
    
    .cart-layout-mobile {
        display: block;
    }
    
    /* Resumen sticky superior móvil */
    .mobile-cart-summary-sticky {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--theme-palette-color-1, #007cba);
        color: var(--theme-palette-color-8, #ffffff);
        padding: 15px;
        margin: -15px -15px 20px -15px;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .mobile-summary-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
    }
    
    /* Productos móvil */
    .mobile-products-section {
        margin-bottom: 20px;
    }
    
    .mobile-product-card {
        background: var(--theme-palette-color-8, #ffffff);
        border: 1px solid var(--theme-palette-color-3, #e1e5e9);
        border-radius: 8px;
        margin-bottom: 15px;
        overflow: hidden;
    }
    
    .mobile-product-header {
        display: flex;
        align-items: center;
        padding: 15px;
        cursor: pointer;
        background: var(--theme-palette-color-7, #f8f9fa);
    }
    
    .mobile-product-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .mobile-product-info {
        flex: 1;
    }
    
    .mobile-product-title {
        margin: 0 0 5px 0;
        font-size: 1em;
        font-weight: 600;
        color: inherit;
    }
    
    .mobile-product-summary {
        display: flex;
        gap: 10px;
        font-size: 0.85em;
    }
    
    .mobile-quantity {
        color: var(--theme-palette-color-4, #666);
    }
    
    .mobile-price {
        font-weight: 600;
        color: var(--theme-palette-color-1, #007cba);
    }
    
    .mobile-expand-icon {
        font-size: 1.1em;
        color: var(--theme-palette-color-4, #666);
    }
    
    /* Contenido expandible móvil */
    .mobile-product-content {
        display: none;
        padding: 0 15px 15px 15px;
    }
    
    .mobile-color-section {
        margin-bottom: 15px;
        border: 1px solid var(--theme-palette-color-3, #e1e5e9);
        border-radius: 6px;
        overflow: hidden;
    }
    
    .mobile-color-header {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        background: var(--theme-palette-color-7, #f8f9fa);
        cursor: pointer;
    }
    
    .mobile-color-thumbnail {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        margin-right: 10px;
        border: 2px solid var(--theme-palette-color-3, #e1e5e9);
    }
    
    .mobile-color-info {
        flex: 1;
    }
    
    .mobile-color-name {
        font-weight: 600;
        margin-bottom: 2px;
        color: inherit;
    }
    
    .mobile-color-summary {
        display: flex;
        gap: 10px;
        font-size: 0.85em;
    }
    
    .mobile-color-quantity {
        color: var(--theme-palette-color-4, #666);
    }
    
    .mobile-color-price {
        font-weight: 600;
        color: var(--theme-palette-color-1, #007cba);
    }
    
    .mobile-color-expand {
        font-size: 1em;
        color: var(--theme-palette-color-4, #666);
    }
    
    .mobile-color-content {
        display: none;
        padding: 15px;
    }
    
    .mobile-variation-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid var(--theme-palette-color-3, #e1e5e9);
    }
    
    .mobile-variation-item:last-child {
        border-bottom: none;
    }
    
    .mobile-variation-info {
        flex: 1;
    }
    
    .mobile-variation-size {
        font-weight: 500;
        margin-bottom: 4px;
        color: inherit;
    }
    
    .mobile-variation-price {
        font-size: 0.9em;
        color: var(--theme-palette-color-4, #666);
        margin-bottom: 4px;
    }
    
    .mobile-variation-subtotal {
        font-weight: 600;
        color: var(--theme-palette-color-1, #007cba);
        font-size: 0.95em;
    }
    
    .mobile-quantity-controls {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .quantity-btn-mobile {
        width: 28px;
        height: 28px;
        border: 1px solid var(--theme-palette-color-3, #e1e5e9);
        background: var(--theme-palette-color-8, #ffffff);
        color: var(--theme-palette-color-1, #007cba);
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 0.9em;
    }
    
    .quantity-btn-mobile:hover {
        background: var(--theme-palette-color-1, #007cba);
        color: var(--theme-palette-color-8, #ffffff);
    }
    
    .quantity-input-mobile {
        width: 50px;
        height: 28px;
        text-align: center;
        border: 1px solid var(--theme-palette-color-3, #e1e5e9);
        border-radius: 4px;
        font-size: 13px;
        background: var(--theme-palette-color-8, #ffffff);
        color: inherit;
    }
    
    .quantity-input-mobile:focus {
        outline: none;
        border-color: var(--theme-palette-color-1, #007cba);
        box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    }
    
    .quantity-input-mobile.loading {
        opacity: 0.6;
        pointer-events: none;
    }
    
    /* Cart collaterals móvil */
    .mobile-cart-collaterals {
        margin-bottom: 20px;
    }
    
}

/* Ocultar versión móvil en desktop */
@media (min-width: 769px) {
    .cart-layout-mobile {
        display: none;
    }
}

/* ========== NUEVAS FUNCIONALIDADES B2B ========== */

/* Estilos para precios por color */
.color-info .color-price {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.color-info .color-name {
    margin-right: 8px;
}

.color-price-mobile {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* Separador de colores especiales */
.special-colors-separator {
    background: transparent !important;
}

.special-colors-separator .separator-cell {
    padding: 20px 0;
    text-align: center;
    border: none;
    background: transparent;
}

.separator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    border: none;
    margin: 0;
}

.separator-text {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    padding: 0 10px;
    background: white;
    cursor: help;
}

.separator-text[title] {
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* Clases para colores normales y especiales */
.color-row.normal-color {
    /* Estilos para colores normales */
}



.color-row.special-color .color-info {
    position: relative;
}



/* Carrito sticky collaterals */
.abaca-cart-collaterals-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 20vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.abaca-cart-collaterals-sticky.show {
    transform: translateY(0);
}

.abaca-cart-collaterals-sticky.hide {
    transform: translateY(100%);
}

.cart-collaterals-content {
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-collaterals-content .cart_totals {
    width: 100%;
}

.cart-collaterals-content .cart_totals table {
    margin-bottom: 10px;
}

.cart-collaterals-content .wc-proceed-to-checkout {
    text-align: center;
}

.cart-collaterals-content .checkout-button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* B2B King actions en carrito sticky */
.b2b-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.b2b-actions .button {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* Estilos para el carrito matriz */
.abaca-b2b-cart-matrix {
    margin-bottom: 100px; /* Espacio para carrito sticky */
}

.cart-product-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;

}

.cart-product-header .header-content {
    height: 70px; /* Header compacto */
    padding: 8px 12px;
}

.cart-product-gallery {
    flex: 0 0 75px;
}

.cart-product-image-wrapper {
    width: 75px;
    height: 75px;
    overflow: hidden;
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.cart-product-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
}

.cart-product-summary .summary-pieces {
    color: #666;
}

.cart-product-summary .summary-total {
    font-weight: 600;
    color: #333;
}

/* Clases especiales para inputs del carrito */
.cart-qty-input {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.cart-qty-input:focus {
    border-color: #ffb74d;
    box-shadow: 0 0 0 2px rgba(255, 183, 77, 0.2);
}

/* Animaciones para fade out */
.fade-out {
    opacity: 0;
    transform: scale(0.95);
    max-height: 1000px;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

.fade-out-complete {
    display: none !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Estilos para mobile */
@media (max-width: 768px) {
    .mobile-summary-content {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .mobile-summary-content .mobile-summary-pieces {
        font-size: 12px;
        color: #666;
    }
    
    .mobile-summary-content .mobile-summary-total {
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }
    
    .abaca-cart-collaterals-sticky {
        max-height: 30vh;
    }
    
    .cart-collaterals-content {
        padding: 10px 15px;
    }
    
    .separator-content {
        gap: 10px;
    }
    
    .separator-text {
        font-size: 10px;
        padding: 0 8px;
    }
    
    .color-price-mobile {
        font-size: 10px;
        margin-left: 6px;
    }
}

/* Ocultar elementos del single product cuando esté habilitado */
.hide-single-product-elements .single_add_to_cart_button,
.hide-single-product-elements .quantity {
    display: none !important;
}

/* Tooltips personalizados */
.separator-text[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1001;
    margin-bottom: 5px;
}

.separator-text[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1001;
}

/* ===============================================
   ESTILOS COMPACTOS PARA CARRITO MATRIZ
   =============================================== */

/* Headers compactos */
.compact-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.compact-header .header-content {
    height: 70px; /* Header más compacto */
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compact-header .product-info {
    flex: 1;
    min-width: 0;
}

.compact-header .product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.compact-header .product-sku {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.compact-header .product-sku .sku-label {
    font-weight: 500;
    margin-right: 4px;
}

/* Summary compacto */
.compact-summary {
    flex: 0 0 auto;
    text-align: right;
}

.compact-summary .summary-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.compact-summary .summary-separator {
    color: #ccc;
    font-weight: normal;
}

.compact-summary .summary-pieces {
    color: #666;
}

.compact-summary .summary-total {
    color: #333;
    font-weight: 600;
}

/* Estilos para swatches de 30px */
.swatch-30px {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swatch-30px img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



/* Color info compacta - horizontal layout */
.compact-color-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.compact-color-info .color-swatch-wrapper {
    flex-shrink: 0;
}

.compact-color-info .color-details {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.compact-color-info .color-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.compact-color-info .color-price {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin: 0;
    white-space: nowrap;
}

/* Celdas de talla compactas */
.compact-size-cell {
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
}


/* Mobile headers compactos */
.compact-mobile-header .mobile-header-content {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
}

.compact-mobile-header .mobile-product-info {
    flex: 1;
    min-width: 0;
}

.compact-mobile-header .mobile-product-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.compact-mobile-header .mobile-product-sku {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.compact-mobile-summary {
    flex: 0 0 auto;
}

.compact-mobile-summary .mobile-summary-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.compact-mobile-summary .mobile-summary-separator {
    color: #ccc;
    font-weight: normal;
}

/* Color headers móviles compactos */
.compact-color-header {
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
}

.compact-color-header .color-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.compact-mobile-color-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.compact-mobile-color-info .color-details {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.compact-mobile-color-info .color-name {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.compact-mobile-color-info .color-price-mobile {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.compact-color-header .color-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 12px;
}

.compact-color-header .color-pieces {
    color: #666;
}

.compact-color-header .color-subtotal {
    font-weight: 600;
    color: #333;
}


/* Separadores especiales móviles */
.mobile-special-separator {
    margin: 15px 0;
}

.mobile-separator-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
}

.mobile-separator-line {
    flex: 1;
    height: 1px;
    background: #ddd;
    border: none;
    margin: 0;
}

.mobile-separator-text {
    font-size: 11px;
    color: #666;
    background: white;
    padding: 0 8px;
    white-space: nowrap;
}

/* Totales finales del carrito */
.abaca-b2b-cart-totals {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.abaca-b2b-cart-totals .totals-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.abaca-b2b-cart-totals .total-items,
.abaca-b2b-cart-totals .total-price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.abaca-b2b-cart-totals .total-items-label,
.abaca-b2b-cart-totals .total-price-label {
    color: #666;
    font-weight: normal;
}

.abaca-b2b-cart-totals .total-items-count,
.abaca-b2b-cart-totals .total-price-amount {
    font-weight: 600;
    color: #333;
}

/* Proceed to checkout button */
.abaca-b2b-cart-totals .wc-proceed-to-checkout {
    margin-top: 20px;
    text-align: center;
}

.abaca-b2b-cart-totals .checkout-button {
    display: inline-block;
    background-color: var(--theme-palette-color-8, #ffffff);
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.abaca-b2b-cart-totals .checkout-button:hover {
    background-color: var(--theme-palette-color-8, #ffffff);
    color: #fff;
    text-decoration: none;
}

/* Responsive para totales */
@media (max-width: 768px) {
    .abaca-b2b-cart-totals .totals-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .abaca-b2b-cart-totals .total-items,
    .abaca-b2b-cart-totals .total-price {
        justify-content: center;
        font-size: 14px;
    }
}

/* ===============================================
   VARIABLES CSS DINÁMICAS PARA ESTILOS MASTER
   =============================================== */

:root {
    /* Tamaños configurables desde el admin */
    --abaca-swatch-size: 30px;
    --abaca-row-height: auto;
    --abaca-input-width: 40px;
    --abaca-color-column-width: 200px;
    --abaca-color-name-font-size: 14px;
    --abaca-color-price-font-size: 12px;
    --abaca-size-header-font-size: 12px;
}

/* Aplicar variables dinámicas */
.swatch-30px,
.color-thumbnail,
.mobile-swatch {
    width: var(--abaca-swatch-size);
    height: var(--abaca-swatch-size);
}

.matrix-table .color-row {
    height: var(--abaca-row-height);
}

.compact-input,
.quantity-input {
    width: var(--abaca-input-width);
}

.color-column,
.color-cell {
    width: var(--abaca-color-column-width);
    max-width: var(--abaca-color-column-width);
}

.color-name,
.compact-color-info .color-name {
    font-size: var(--abaca-color-name-font-size);
}

.color-price,
.compact-color-info .color-price,
.color-price-mobile {
    font-size: var(--abaca-color-price-font-size);
}

.size-column,
.matrix-header th {
    font-size: var(--abaca-size-header-font-size);
}

/* Clases de altura de fila */
.matrix-table.row-height-compact .color-row {
    height: 40px;
}

.matrix-table.row-height-comfortable .color-row {
    height: 50px;
}

.matrix-table.row-height-spacious .color-row {
    height: 60px;
}

/* Tamaños de input */
.input-size-small .compact-input,
.input-size-small .quantity-input {
    width: 30px;
    font-size: 11px;
}

.input-size-small .quantity-minus,
.input-size-small .quantity-plus {
    width: 20px;
    height: 28px;
    font-size: 12px;
}

.input-size-medium .compact-input,
.input-size-medium .quantity-input {
    width: 40px;
    font-size: 13px;
}

.input-size-medium .quantity-minus,
.input-size-medium .quantity-plus {
    width: 24px;
    height: 32px;
    font-size: 14px;
}

.input-size-large .compact-input,
.input-size-large .quantity-input {
    width: 50px;
    font-size: 14px;
}

.input-size-large .quantity-minus,
.input-size-large .quantity-plus {
    width: 28px;
    height: 36px;
    font-size: 16px;
}

/* ===============================================
   ESTILOS PARA CARRITO B2B MATRIZ
   =============================================== */

/* Títulos de categoría */
.category-header {
    margin: 30px 0 20px 0;
    padding: 15px 0;
    border-bottom: 2px solid var(--theme-palette-color-3, #e1e5e9);
}

.category-title {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--theme-palette-color-1, #333);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Header del producto en carrito - más compacto */
.cart-product-header .header-content {
    min-height: 80px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--abaca-bg-light, #f8f9fa);
}

/* Imagen CUADRADA simplificada */
.cart-product-image-square {
    width: 75px;
    height: 75px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--theme-palette-color-3, #e1e5e9);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-product-image-square .cart-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    max-height: none !important;
}

/* Info del producto en carrito */
.cart-product-header .product-info {
    flex: 1;
    min-width: 0;
}

.cart-product-header .product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: var(--theme-palette-color-1, #333);
}

.abaca-b2b-cart-matrix .cart-product-header .product-sku,
.cart-product-header .product-sku {
    font-size: 11px !important;
    color: #666 !important;
    display: block !important;
    visibility: visible !important;
    margin-top: 4px !important;
    line-height: 1.2 !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
    white-space: normal !important;
}

.abaca-b2b-cart-matrix .cart-product-header .product-sku .sku-label,
.cart-product-header .product-sku .sku-label {
    font-weight: 500 !important;
    margin-right: 4px !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.abaca-b2b-cart-matrix .cart-product-header .product-sku .sku-value,
.cart-product-header .product-sku .sku-value {
    font-weight: 400 !important;
    color: #888 !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Summary del producto - una línea alineada a la derecha */
.cart-product-summary {
    flex: 0 0 auto;
    text-align: right;
}

.cart-product-summary .summary-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    justify-content: flex-end;
}

.cart-product-summary .summary-separator {
    color: #ccc;
    font-weight: normal;
}

.cart-product-summary .summary-pieces {
    color: #666;
}

.cart-product-summary .summary-total {
    color: var(--theme-palette-color-1, #333);
    font-weight: 600;
}

/* ========== TABLA MATRIZ DEL CARRITO ========== */

/* Aplicar estilos master a las filas del carrito */
.abaca-b2b-cart-matrix.matrix-table-row-height-compact .matrix-table .color-row {
    height: 40px !important;
}

.abaca-b2b-cart-matrix.matrix-table-row-height-comfortable .matrix-table .color-row {
    height: 50px !important;
}

.abaca-b2b-cart-matrix.matrix-table-row-height-spacious .matrix-table .color-row {
    height: 60px !important;
}

.abaca-b2b-cart-matrix.matrix-table-row-height-auto .matrix-table .color-row {
    height: auto !important;
    min-height: 40px;
}

/* Layout de color-info IDÉNTICO al shortcode principal */
.abaca-b2b-cart-matrix .color-info {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    min-width: 0;
}

.abaca-b2b-cart-matrix .color-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 50px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.abaca-b2b-cart-matrix .color-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ESTRELLA ÚNICA para colores especiales - posicionada sobre el thumbnail del carrito */
.abaca-b2b-cart-matrix .color-row.special-color .color-thumbnail::before {
    content: "★";
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ffd700;
    color: #333;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 3;
}





.abaca-b2b-cart-matrix .color-name {
    font-size: var(--abaca-color-name-font-size, 14px);
    font-weight: 500;
    color: var(--theme-palette-color-1, #333);
    margin-right: 8px;
}

.abaca-b2b-cart-matrix .color-price {
    font-size: var(--abaca-color-price-font-size, 12px);
    color: #666;
    font-weight: 500;
}

/* Inputs de cantidad en carrito */
.abaca-b2b-cart-matrix.input-size-small .quantity-input {
    width: 30px !important;
    font-size: 11px;
}

.abaca-b2b-cart-matrix.input-size-medium .quantity-input {
    width: 40px !important;
    font-size: 12px;
}

.abaca-b2b-cart-matrix.input-size-large .quantity-input {
    width: 50px !important;
    font-size: 13px;
}


/* ========== CART COLLATERALS STICKY ========== */

.abaca-cart-collaterals-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--theme-palette-color-8, #ffffff);
    border-top: 2px solid var(--theme-palette-color-1, #007cba);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px 15px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 20vh;
    overflow-y: auto;
    display: block !important;
}

.abaca-cart-collaterals-sticky.show {
    transform: translateY(0);
}

/* Forzar que aparezca el carrito sticky */
body.woocommerce-cart .abaca-cart-collaterals-sticky {
    display: block !important;
}

.abaca-cart-collaterals-sticky .cart-collaterals-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.abaca-cart-collaterals-sticky .cart_totals {
    margin: 0;
    flex: 1;
}

.abaca-cart-collaterals-sticky .cart_totals table {
    width: 100%;
    margin: 0;
}

.abaca-cart-collaterals-sticky .cart_totals th,
.abaca-cart-collaterals-sticky .cart_totals td {
    padding: 5px 10px;
    font-size: 14px;
}

.abaca-cart-collaterals-sticky .checkout-button,
.abaca-cart-collaterals-sticky .wc-proceed-to-checkout .checkout-button,
.abaca-cart-collaterals-sticky .wc-proceed-to-checkout a {
    background: var(--theme-palette-color-1, #007cba) !important;
    color: white !important;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.abaca-cart-collaterals-sticky .checkout-button:hover,
.abaca-cart-collaterals-sticky .wc-proceed-to-checkout .checkout-button:hover,
.abaca-cart-collaterals-sticky .wc-proceed-to-checkout a:hover {
    background: var(--theme-palette-color-2, #005a87) !important;
    color: white !important;
}

/* B2B King actions en sticky */
.abaca-cart-collaterals-sticky .b2b-actions {
    flex-shrink: 0;
}

.abaca-cart-collaterals-sticky .b2b-actions .button {
    margin: 0 5px;
    padding: 8px 16px;
    font-size: 14px;
}

/* Responsive sticky */
@media (max-width: 768px) {
    .abaca-cart-collaterals-sticky {
        padding: 10px 15px;
        max-height: 30vh;
    }
    
    .abaca-cart-collaterals-sticky .cart-collaterals-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .abaca-cart-collaterals-sticky .cart_totals th,
    .abaca-cart-collaterals-sticky .cart_totals td {
        padding: 3px 8px;
        font-size: 13px;
    }
    
    .abaca-cart-collaterals-sticky .checkout-button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* ========== SEPARADORES DE COLORES ESPECIALES EN CARRITO ========== */

.abaca-b2b-cart-matrix .special-colors-separator {
    background: transparent !important;
}

.abaca-b2b-cart-matrix .special-colors-separator .separator-cell {
    padding: 20px 0;
    text-align: center;
    border: none;
    background: transparent;
}

.abaca-b2b-cart-matrix .separator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.abaca-b2b-cart-matrix .separator-line {
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    border: none;
    margin: 0;
}

.abaca-b2b-cart-matrix .separator-text {
    background: var(--theme-palette-color-8, #ffffff);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    white-space: nowrap;
    cursor: help;
}


/* ========== TOTALES DEL CARRITO ========== */

.abaca-b2b-cart-totals {
    /* background: var(--theme-palette-color-8, #ffffff); */
    border: 2px solid var(--theme-palette-color-1, #ffffff);
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    position: sticky;
    top: 20px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.abaca-b2b-cart-totals .totals-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    font-size: 16px;
    font-weight: 600;
}

.abaca-b2b-cart-totals .total-items,
.abaca-b2b-cart-totals .total-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.abaca-b2b-cart-totals .total-items-label,
.abaca-b2b-cart-totals .total-price-label {
    color: #666;
    font-weight: 500;
}

.abaca-b2b-cart-totals .total-items-count,
.abaca-b2b-cart-totals .total-price-amount {
    color: var(--theme-palette-color-1, #333);
    font-weight: 700;
}

@media (max-width: 768px) {
    .abaca-b2b-cart-totals .totals-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .abaca-b2b-cart-totals .total-items,
    .abaca-b2b-cart-totals .total-price {
        justify-content: center;
        font-size: 14px;
    }
}/* ========== SEPARADOR MÓVIL COLORES ESPECIALES ========== */

/* Separador de colores especiales MÓVIL */
.special-colors-separator-mobile {
    margin: 20px 0;
    padding: 10px 0;
}

.separator-content-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.separator-line-mobile {
    flex: 1;
    height: 1px;
    border: none;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
    opacity: 0.6;
}

.separator-text-mobile {
    background: var(--theme-palette-color-8, #ffffff);
    color: var(--theme-palette-color-1, #333333);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #d4af37;
    cursor: help;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(212, 175, 55, 0.2);
}

.separator-text-mobile:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ========== CARRITO COMPACTO - Nuevos estilos ========== */

/* Layout compacto para info de color - CARRITO */
.color-info-compact {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}

.color-info-compact .color-swatch {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.color-info-compact .color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

.color-info-compact .color-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.color-info-compact .color-name {
    font-family: var(--theme-font-family);
    font-size: 15px;
    font-weight: 700;
    font-style: var(--theme-font-style, inherit);
    line-height: 1.5;
    letter-spacing: var(--theme-letter-spacing);
    text-transform: var(--theme-text-transform);
    text-decoration: var(--theme-text-decoration);
    margin: 0;
}

.color-info-compact .color-price {
    font-size: 12px;
    font-weight: 300;
    color: var(--woocommerce-price-color, #333);
    margin: 0;
    line-height: 1.2;
    align-self: auto;
}

/* Reducir anchos de columnas */
.abaca-b2b-cart-matrix .color-column {
    width: 120px !important;
    min-width: 120px !important;
}

.abaca-b2b-cart-matrix .size-column {
    width: 60px !important;
    min-width: 60px !important;
}

.abaca-b2b-cart-matrix .subtotal-column {
    width: 80px !important;
    min-width: 80px !important;
}

.abaca-b2b-cart-matrix .actions-column-compact {
    width: 40px !important;
    min-width: 40px !important;
    padding: 4px !important;
}

/* SKU visible en header del carrito */
.cart-product-header .product-sku {
    display: block !important;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.cart-product-header .product-sku .sku-label {
    font-weight: normal;
}

.cart-product-header .product-sku .sku-value {
    font-weight: 500;
} /* ========== HEADER CENTRADO Y INPUTS COMPACTOS ========== */

/* Centrar el texto "Colour" en el header */
.color-column {
    text-align: center !important;
}

/* ===============================================
   ESTILOS COMPACTOS PARA DIFERENTES CONTEXTOS
   =============================================== */

/* Controles de cantidad compactos */
.compact-quantity {
    margin: 0;
}

.compact-quantity .quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    overflow: hidden;
    background: var(--abaca-bg);
    width: fit-content;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.compact-quantity .quantity-minus,
.compact-quantity .quantity-plus {
    width: 24px;
    height: 32px;
    border: none;
    background: var(--abaca-light-bg);
    color: var(--abaca-text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.compact-quantity .quantity-minus:hover,
.compact-quantity .quantity-plus:hover {
    background: var(--abaca-primary-color);
    color: white;
}

.compact-quantity .quantity-minus:disabled,
.compact-quantity .quantity-plus:disabled {
    background: var(--abaca-bg-hover);
    color: var(--abaca-text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Compact inputs - Enhanced with theme colors */
.compact-input {
    width: 40px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 13px;
    padding: 0;
    margin: 0;
    background: var(--abaca-bg);
    border-left: 1px solid var(--abaca-border-color);
    border-right: 1px solid var(--abaca-border-color);
    color: var(--abaca-text-color);
    transition: all 0.2s ease;
}

.compact-input:focus {
    outline: none;
    background: var(--abaca-bg-light);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

/* Prevent conflicts with tablet quantity input styles */
@media (min-width: 768px) and (max-width: 1130px) {
    .quantity-wrapper .quantity-input:not(.compact-input) {
        width: 100% !important;
        height: 100% !important;
        border-left: none !important;
        border-right: none !important;
        background: transparent !important;
    }
    
    /* Ensure compact inputs don't interfere with tablet quantity inputs */
    .quantity-wrapper:not(.compact-quantity) .quantity-input {
        border-left: none !important;
        border-right: none !important;
    }
}

/* Quantity controls móviles compactos */
.compact-mobile-quantity {
    margin: 0;
}

.compact-mobile-quantity .quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    width: fit-content;
}

.compact-mobile-quantity .quantity-minus,
.compact-mobile-quantity .quantity-plus {
    width: 28px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.compact-mobile-quantity .quantity-minus:hover,
.compact-mobile-quantity .quantity-plus:hover {
    background: #e9ecef;
}

.compact-mobile-quantity .compact-input {
    width: 45px;
    height: 36px;
    font-size: 14px;
}

.matrix-table .color-row {
    height: var(--abaca-row-height);
}

.compact-input,
.quantity-input {
    width: var(--abaca-input-width);
}

.color-column,
.color-cell {
    width: var(--abaca-color-column-width);
    max-width: var(--abaca-color-column-width);
}

.color-name,
.compact-color-info .color-name {
    font-size: var(--abaca-color-name-font-size);
}

.color-price,
.compact-color-info .color-price,
.color-price-mobile {
    font-size: var(--abaca-color-price-font-size);
}

.size-column,
.matrix-header th {
    font-size: var(--abaca-size-header-font-size);
}

/* Clases de altura de fila */
.matrix-table.row-height-compact .color-row {
    height: 40px;
}

.matrix-table.row-height-comfortable .color-row {
    height: 50px;
}

.matrix-table.row-height-spacious .color-row {
    height: 60px;
}

/* Tamaños de input */
.input-size-small .compact-input,
.input-size-small .quantity-input {
    width: 30px;
    font-size: 11px;
}

.input-size-small .quantity-minus,
.input-size-small .quantity-plus {
    width: 20px;
    height: 28px;
    font-size: 12px;
}

.input-size-medium .compact-input,
.input-size-medium .quantity-input {
    width: 40px;
    font-size: 13px;
}

.input-size-medium .quantity-minus,
.input-size-medium .quantity-plus {
    width: 24px;
    height: 32px;
    font-size: 14px;
}

.input-size-large .compact-input,
.input-size-large .quantity-input {
    width: 50px;
    font-size: 14px;
}

.input-size-large .quantity-minus,
.input-size-large .quantity-plus {
    width: 28px;
    height: 36px;
    font-size: 16px;
}



/* ==========================================================================
   CARGA PROGRESIVA - Estilos para lazy loading de productos
   ========================================================================== */

.progressive-load-container {
    background: var(--abaca-light-bg);
    border: 1px solid var(--abaca-border-color);
    border-radius: var(--abaca-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: var(--abaca-shadow);
}

.load-progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, var(--abaca-primary-color), #28a745);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255,255,255,0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%,
        transparent 75%
    );
    background-size: 20px 20px;
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    color: var(--abaca-text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.load-more-products {
    background: var(--abaca-primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--abaca-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.load-more-products:hover {
    background: var(--abaca-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.loading-products {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--abaca-text-light);
    font-style: italic;
    margin-top: 1rem;
}

.loading-products .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--abaca-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.color-swatch.loading {
    position: relative;
    background: #f0f0f0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.abaca-b2b-product-table {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
