/* ==========================================================================
   Apex Pure Pep - Clinical Cart & Checkout Stylesheet (SwissChems Monograph)
   Version: 1.2.0 | Zero-Bloat Performance Architecture
   ========================================================================== */

body.woocommerce-cart,
body.woocommerce-checkout {
    background: #f8fafc !important;
}

/* 1. TOP TRUST & LABORATORY SECURITY STRIP */
.ax-co-trust-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin: 0 0 28px !important;
}

.ax-co-trust-pill {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

.ax-co-pill-icon {
    width: 36px !important;
    height: 36px !important;
    background: #f1f5f9 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0f172a !important;
    flex-shrink: 0 !important;
}

.ax-co-pill-txt strong {
    display: block !important;
    font-size: 13px !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.ax-co-pill-txt span {
    font-size: 11px !important;
    color: #64748b !important;
    display: block !important;
    line-height: 1.3 !important;
    margin-top: 2px !important;
}

/* 2. CART PAGE SHIPPING BANNER & TRUST PILLARS */
.ax-cart-shipping-banner {
    background: #EAF3EE !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 8px !important;
    padding: 14px 18px !important;
    margin-bottom: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.ax-cart-banner-left {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    color: #166534 !important;
}

.ax-cart-banner-left svg {
    color: #166534 !important;
    flex-shrink: 0 !important;
}

.ax-cart-banner-left strong {
    display: block !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #166534 !important;
}

.ax-cart-banner-left span {
    font-size: 12px !important;
    color: #15803d !important;
}

.ax-cart-banner-badge span {
    background: #166534 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 12px !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
}

.ax-cart-trust-pillars {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-top: 36px !important;
    padding-top: 24px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.ax-cart-pillar {
    text-align: center !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 18px 14px !important;
}

.ax-pillar-icon {
    display: inline-flex !important;
    width: 28px !important;
    height: 28px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    border-radius: 9999px !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 8px !important;
}

.ax-cart-pillar strong {
    display: block !important;
    font-size: 13px !important;
    color: #0f172a !important;
    margin-bottom: 4px !important;
}

.ax-cart-pillar p {
    font-size: 11.5px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}

/* 3. WOOCOMMERCE BLOCKS CHECKOUT SURFACES */
body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-order-summary,
body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-cart .wc-block-components-order-summary {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02) !important;
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: -0.015em !important;
    text-transform: none !important;
    color: #0f172a !important;
}

/* Primary Action Buttons (Authoritative Dark Ink) */
body.woocommerce-checkout .wc-block-components-button:not(.is-link),
body.woocommerce-cart .wc-block-components-button:not(.is-link),
body.woocommerce-checkout #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-cart .button.checkout,
body.woocommerce-cart button[name="update_cart"] {
    background: #D62A28 !important;
    color: #ffffff !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
    min-height: 52px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.woocommerce-checkout .wc-block-components-button:not(.is-link):hover,
body.woocommerce-cart .wc-block-components-button:not(.is-link):hover,
body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
    background: #B01F20 !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2) !important;
}

/* Totals Typography */
body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__value {
    font-size: 13.5px !important;
    color: #475569 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

/* Inputs & Form Fields */
body.woocommerce-checkout input[type="text"],
body.woocommerce-checkout input[type="email"],
body.woocommerce-checkout input[type="tel"],
body.woocommerce-checkout select,
body.woocommerce-checkout textarea {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    font-size: 13.5px !important;
    color: #0f172a !important;
    min-height: 46px !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

body.woocommerce-checkout input:focus,
body.woocommerce-checkout select:focus,
body.woocommerce-checkout textarea:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1) !important;
    outline: none !important;
}

/* 4. CLINICAL RUO CHECKBOX BOX */
body.woocommerce-checkout .wc-block-components-checkbox,
body.woocommerce-checkout .ax-ruo-box-enhanced {
    padding: 16px 18px !important;
    border: 1.5px solid #0f172a !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    margin: 18px 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

.ax-ruo-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #0f172a !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 8px !important;
    text-transform: uppercase !important;
}

.ax-ruo-header svg {
    color: #0f172a !important;
    flex-shrink: 0 !important;
}

body.woocommerce-checkout .wc-block-components-checkbox label {
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    line-height: 1.55 !important;
}

/* 5. SIDEBAR REASSURANCE CARD */
.ax-order-reassurance-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 16px 18px !important;
    margin-top: 20px !important;
}

.ax-reassure-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.ax-reassure-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
}

.ax-reassure-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 11.5px !important;
    color: #475569 !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
}

.ax-reassure-list li svg {
    color: #059669 !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
}

.ax-reassure-list li strong {
    color: #0f172a !important;
}

.ax-reassure-footer {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-align: center !important;
    border-top: 1px solid #e2e8f0 !important;
    padding-top: 8px !important;
}

/* 6. RESPONSIVE OPTIMIZATIONS (Tablet & Mobile 390px) */
@media (max-width: 1024px) {
    .ax-co-trust-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 768px) {
    .ax-co-trust-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 20px !important;
    }

    .ax-co-trust-pill {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .ax-co-pill-icon {
        width: 28px !important;
        height: 28px !important;
    }

    .ax-co-pill-icon svg {
        width: 15px !important;
        height: 15px !important;
    }

    .ax-co-pill-txt strong {
        font-size: 11.5px !important;
    }

    .ax-co-pill-txt span {
        font-size: 10px !important;
    }

    .ax-cart-shipping-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }

    .ax-cart-trust-pillars {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-top: 24px !important;
    }

    .ax-cart-pillar {
        padding: 12px 10px !important;
    }

    body.woocommerce-checkout .wc-block-components-checkbox,
    body.woocommerce-checkout .ax-ruo-box-enhanced {
        padding: 12px 14px !important;
    }

    body.woocommerce-checkout .wc-block-components-button:not(.is-link),
    body.woocommerce-cart .wc-block-components-button:not(.is-link),
    body.woocommerce-checkout #place_order,
    body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
        min-height: 48px !important;
        font-size: 13.5px !important;
    }
}

/* ==========================================================================
   7. P2 polish — cart & checkout line items printed the price twice
   --------------------------------------------------------------------------
   WooCommerce Blocks renders the unit price stacked under the product name
   (.wc-block-cart-item__prices) AND the line total in the TOTAL column. Both
   were visible at every width, so a single-item order showed "$88.00" twice
   in the same block.

   Rule shape matters here. An earlier version hid the block unconditionally
   and section 8 tried to re-show it for multi-quantity rows; the two then
   fought over !important and the (0,3,1) hide won. Instead the hide rule is
   scoped with :not([data-apex-qty]) — the block is only suppressed while it
   still carries no quantity stamp, so multi-quantity rows never match the
   hide rule at all and no specificity contest exists.
   ========================================================================== */

/* Checkout order summary: the line total is right there, always drop it. */
.wc-block-components-order-summary-item .wc-block-cart-item__prices {
    display: none !important;
}

/* Cart table: hide only while the row holds a single unit. */
.wc-block-cart-items .wc-block-cart-item__prices:not([data-apex-qty]) {
    display: none !important;
}

/* ==========================================================================
   8. Unit price returns for multi-quantity rows only
   --------------------------------------------------------------------------
   apex-cart-qty.php stamps [data-apex-qty="N"] on the price block whenever the
   row holds more than one unit, so a 3-unit row reads "3 x $71.25" instead of
   showing only "$213.75". The label is painted by ::before from that
   attribute, so a React re-render cannot leave stale text behind.
   ========================================================================== */

.wc-block-cart-items .wc-block-cart-items__row[data-apex-qty-multi="1"] .wc-block-cart-item__prices {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    color: #7A828E !important;
}

.wc-block-cart-items .wc-block-cart-items__row[data-apex-qty-multi="1"] .wc-block-cart-item__prices[data-apex-qty]::before {
    content: attr(data-apex-qty) " \00d7 ";
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #7A828E !important;
    white-space: nowrap !important;
}

/* The struck-through list price is noise next to "3 x"; the row already prints
   the saving on its own line. */
.wc-block-cart-items .wc-block-cart-items__row[data-apex-qty-multi="1"] .wc-block-cart-item__prices del {
    display: none !important;
}

.wc-block-cart-items .wc-block-cart-items__row[data-apex-qty-multi="1"] .wc-block-cart-item__prices ins {
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #4A5260 !important;
}
