/* When the matrix is active (body class added by matrix JS), hide the default
   combination selector, single quantity and default add button. !important beats the
   theme's inline display set by PrestaShop core after our JS runs. Scoped to the body
   class so single-combination products (no matrix) keep the default UI. */
/* Hide the native single-combination selector + qty + default add button, but NOT the
   .product-actions container itself (the matrix/customization live inside it in this theme).
   Strip its border/spacing so no stray separator line remains. */
body.has-ecomatrix .product-variants,
body.has-ecomatrix .js-product-variants,
body.has-ecomatrix .product-actions .product-quantity,
body.has-ecomatrix .product-actions .product-add-to-cart { display: none !important; }
body.has-ecomatrix .product-actions { border: 0 !important; padding-top: 0 !important; margin-top: 0 !important; box-shadow: none !important; }

.ecomatrix { margin: 1rem 0; }
.ecomatrix-title { font-weight: 600; }
.ecomatrix-table th { white-space: nowrap; }
/* Rounded border on the TABLE element itself (border-collapse:separate so radius applies),
   single internal lines, and corner cells rounded to match — no wrapper/overflow. */
.ecomatrix-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.ecomatrix-table th, .ecomatrix-table td {
    box-shadow: none !important; filter: none !important;
    border: 0;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}
.ecomatrix-table th:last-child, .ecomatrix-table td:last-child { border-right: 0; }
.ecomatrix-table tbody tr:last-child td { border-bottom: 0; }
.ecomatrix-table thead tr:first-child th:first-child { border-top-left-radius: 4px; }
.ecomatrix-table thead tr:first-child th:last-child { border-top-right-radius: 4px; }
.ecomatrix-table tbody tr:last-child td:first-child { border-bottom-left-radius: 4px; }
.ecomatrix-table tbody tr:last-child td:last-child { border-bottom-right-radius: 4px; }
.ecomatrix-qty { width: 70px; display: inline-block; border-radius: 4px !important; }
.ecomatrix-ok { color: #2e7d32; font-weight: 600; }   /* Disponible / unidades = verde */
.ecomatrix-oos { color: #c00; }
.ecomatrix-actions { margin-top: .75rem; }
/* Orange full-width add-to-cart button, like the original web. */
.ecomatrix-add {
    width: 100%;
    --bs-btn-bg: #ff7d23; --bs-btn-border-color: #ff7d23; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #e86a10; --bs-btn-hover-border-color: #e86a10; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #e86a10; --bs-btn-active-border-color: #e86a10; --bs-btn-active-color: #fff;
    background-color: #ff7d23 !important; border-color: #ff7d23 !important; color: #fff !important;
    font-size: 1.05rem; padding: .8rem 1.2rem; border-radius: .35rem;
}
.ecomatrix-add:hover, .ecomatrix-add:focus {
    background-color: #e86a10 !important; border-color: #e86a10 !important; color: #fff !important;
}
.ecomatrix-add .fa { margin-right: .4rem; }
.ecomatrix-msg { margin-top: .75rem; }

/* Native add-to-cart button (single-combination products, where the matrix is NOT shown):
   match the orange colour + cart icon of the matrix button. */
.product-add-to-cart .add-to-cart {
    --bs-btn-bg: #ff7d23; --bs-btn-border-color: #ff7d23; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #e86a10; --bs-btn-hover-border-color: #e86a10; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #e86a10; --bs-btn-active-border-color: #e86a10;
    background-color: #ff7d23 !important; border-color: #ff7d23 !important; color: #fff !important;
}
.product-add-to-cart .add-to-cart .bag-icon:before { content: "\f07a" !important; } /* fa-shopping-cart */
/* Keep the qty input on the left; stretch the button to fill the rest of the row to the right. */
.product-add-to-cart .col-add-btn { flex: 1 1 auto !important; max-width: 100% !important; }
.product-add-to-cart .col-add-btn .add,
.product-add-to-cart .add-to-cart { width: 100% !important; }

/* MPN repurposed as a personalised message: red badge above the product description. */
.eco-mpn-badge {
    display: block;
    width: fit-content;
    max-width: 100%;
    background: #d9333f;
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    line-height: 1.25;
    padding: .35rem .7rem;
    border-radius: 4px;
    margin: .25rem 0;
}
.eco-mpn-badge:last-of-type { margin-bottom: .65rem; }

/* Collapsible radio_vertical (Cinta / Apliques): start collapsed, show only the selection. */
.an-pf-field-type-radio_vertical .ecocol-trigger { display:flex; align-items:center; gap:10px; cursor:pointer; border:1px solid #ccc; border-radius:5px; padding:8px 12px; background:#fff; margin-top:6px; max-width:420px; }
.an-pf-field-type-radio_vertical .ecocol-trigger:hover { border-color:#999; }
.ecocol-trigger .ecocol-img { width:38px; height:auto; flex:0 0 auto; }
.ecocol-trigger .ecocol-sel { font-weight:600; }
.ecocol-trigger .ecocol-ph { color:#777; }
.ecocol-trigger .ecocol-caret { margin-left:auto; width:8px; height:8px; border:solid #666; border-width:0 2px 2px 0; transform:rotate(45deg); }
.an-pf-field-type-radio_vertical:not(.ecocol-collapsed) .ecocol-trigger .ecocol-caret { transform:rotate(-135deg); }
.an-pf-field-type-radio_vertical.ecocol-collapsed .anfield-radio-vertical-list { display:none; }

.eco-perunit { color:#777; }
