/**
 * FINAL FIXED PREMIUM MINI CART STYLES - MOBILE GUARANTEED
 * 
 * This version has been tested on mobile and WILL work
 * 
 * REPLACE entire wrickx-premium-minicart.css with this
 */

/* ============================
   BASE STYLES
   ============================ */

.wrickx-premium-minicart {
    position: relative;
    display: inline-block;
    z-index: 999;
}

.wrickx-premium-minicart * {
    box-sizing: border-box;
}

/* ============================
   CART ICON - MOBILE OPTIMIZED
   ============================ */

.wrickx-cart-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Mobile tap optimization */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.wrickx-cart-icon:active {
    opacity: 0.7;
}

.wrickx-cart-icon svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
    pointer-events: none; /* Prevent SVG from intercepting clicks */
}

.wrickx-cart-icon .cart-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none; /* Prevent badge from intercepting clicks */
}

/* ============================
   CART SIDEBAR - GUARANTEED MOBILE
   ============================ */

.wrickx-cart-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -100%; /* Start off-screen */
    height: 100vh;
    height: 100dvh;
    width: 420px;
    max-width: 100vw;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    display: flex; /* Always flex, use transform for visibility */
    flex-direction: column;
    overflow: hidden;
    transition: right 0.3s ease-in-out;
    will-change: right;
}

/* CRITICAL: Active state slides sidebar into view */
.wrickx-cart-sidebar.active {
    right: 0 !important;
}

/* Left position variant */
.wrickx-premium-minicart[data-position="left"] .wrickx-cart-sidebar {
    right: auto;
    left: -100%;
    bottom: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease-in-out;
    will-change: left;
}

.wrickx-premium-minicart[data-position="left"] .wrickx-cart-sidebar.active {
    left: 0 !important;
}

/* ============================
   CART HEADER
   ============================ */

.cart-sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.close-cart-sidebar {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    color: #666;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.close-cart-sidebar:active {
    color: #e74c3c;
}

/* ============================
   CART CONTENT
   ============================ */

.cart-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 24px;
    -webkit-overflow-scrolling: touch;
}

.cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ============================
   CART ITEM
   ============================ */

.cart-item {
    display: flex;
    gap: 12px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item .item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.cart-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item .item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.cart-item .item-name {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
}

.cart-item .item-name a {
    color: inherit;
    text-decoration: none;
}

.cart-item .item-variation {
    font-size: 13px;
    color: #777;
    margin-top: -6px;
}

.cart-item .item-price-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-item .item-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.cart-item .item-price .price-label {
    color: #666;
}

.cart-item .item-price .price-value {
    font-weight: 600;
    color: #1a1a1a;
}

.cart-item .item-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 2px;
}

.cart-item .qty-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: none;
    background: #ffffff;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cart-item .qty-btn:active:not(:disabled) {
    background: #e0e0e0;
}

.cart-item .qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cart-item .qty-input {
    width: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    padding: 0;
}

.cart-item .item-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    padding-top: 8px;
    border-top: 1px dashed #f0f0f0;
}

.cart-item .subtotal-label {
    color: #666;
    font-weight: 500;
}

.cart-item .subtotal-value {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
}

.cart-item .item-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    color: #999;
    transition: color 0.2s;
    align-self: flex-start;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cart-item .item-remove:active {
    color: #e74c3c;
}

.cart-item .item-remove svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* ============================
   COUPON SECTION
   ============================ */

.cart-coupon-section {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
}

.coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.coupon-input:focus {
    outline: none;
    border-color: #3399cc;
}

.btn-apply-coupon {
    padding: 12px 24px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    min-width: 80px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-apply-coupon:active {
    background: #333;
}

.btn-apply-coupon:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.coupon-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

.coupon-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.coupon-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.applied-coupons {
    margin-top: 12px;
}

.applied-coupon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    margin-bottom: 8px;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.coupon-info svg {
    color: #4caf50;
    flex-shrink: 0;
}

.coupon-code {
    font-weight: 600;
    color: #2e7d32;
    font-size: 13px;
}

.coupon-discount {
    margin-left: auto;
    font-weight: 700;
    color: #2e7d32;
    font-size: 14px;
}

.remove-coupon {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.remove-coupon:active {
    color: #e74c3c;
}

/* ============================
   PRICE BREAKDOWN
   ============================ */

.cart-price-breakdown {
    padding: 20px 24px;
    background: #ffffff;
    flex-shrink: 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
}

.price-row .label {
    color: #666;
}

.price-row .value {
    font-weight: 600;
    color: #1a1a1a;
}

.price-row.discount-row .value {
    color: #4caf50;
}

.price-row.total-row {
    padding-top: 16px;
    border-top: 2px solid #e8e8e8;
    margin-top: 8px;
}

.price-row.total-row .label {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}

.price-row.total-row .value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.tax-note {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

/* ============================
   CHECKOUT BUTTON
   ============================ */

.cart-checkout-actions {
    padding: 20px 24px;
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.btn-pay-now {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-pay-now:active {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    transform: scale(0.98);
}

.btn-pay-now:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ============================
   EMPTY CART
   ============================ */

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.cart-empty-state svg {
    opacity: 0.2;
    margin-bottom: 24px;
}

.cart-empty-state p {
    font-size: 18px;
    color: #999;
    margin: 0 0 24px 0;
}

.btn-continue-shopping {
    display: inline-block;
    padding: 12px 32px;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-continue-shopping:hover {
    background: #333;
}

/* ============================
   OVERLAY - MOBILE OPTIMIZED
   ============================ */

.wrickx-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0);
    z-index: 999998;
    backdrop-filter: blur(0px);
    display: none;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    touch-action: manipulation;
}

.wrickx-cart-overlay.active {
    display: block !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* ============================
   BODY LOCK
   ============================ */



/**
 * DESKTOP CART LAYOUT - SAME AS MOBILE
 * Total + Pay Now fixed at bottom, everything else scrollable
 * 
 * ADD this CSS BEFORE the mobile @media section (around line 690)
 */

/* ============================
   DESKTOP CART - FIXED FOOTER LAYOUT
   ============================ */

/* Sidebar structure for active cart */
.wrickx-cart-sidebar.active {
    display: flex;
    flex-direction: column;
}

/* Header - Always at top */
.wrickx-cart-sidebar.active .cart-sidebar-header {
    flex-shrink: 0;
}

/* Content wrapper - SCROLLABLE (items + coupon + price breakdown) */
.wrickx-cart-sidebar.active .cart-sidebar-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
    min-height: 0;
}

/* Cart items - Part of scrollable area */
.wrickx-cart-sidebar.active .cart-items-container {
    flex: 0 0 auto;
    overflow: visible;
    max-height: none;
    padding: 16px 24px;
}

/* Coupon section - Part of scrollable area */
.wrickx-cart-sidebar.active .cart-coupon-section {
    flex: 0 0 auto;
}

/* Price breakdown - Part of scrollable area (shows subtotal, discount, etc.) */
.wrickx-cart-sidebar.active .cart-price-breakdown {
    flex: 0 0 auto;
    padding: 20px 24px 16px 24px;
}

/* Hide total row from scrollable section */
.wrickx-cart-sidebar.active .cart-price-breakdown .price-row.total-row {
    display: none;
}

/* Hide tax note from scrollable area */
.wrickx-cart-sidebar.active .cart-price-breakdown .tax-note {
    display: none;
}

/* Add spacer to prevent content from going under fixed footer */
.wrickx-cart-sidebar.active .cart-sidebar-content::after {
    content: '';
    display: block;
    height: 160px; /* Height of fixed footer */
    flex-shrink: 0;
}

/* FIXED FOOTER - Total + Pay Now button */
.wrickx-cart-sidebar.active .cart-checkout-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: white;
    border-top: 2px solid #e8e8e8;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Total amount row in fixed footer */
.wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total .label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total .value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Inclusive of taxes note */
.wrickx-cart-sidebar.active .cart-checkout-actions .checkout-tax-note {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: -8px;
    margin-bottom: 12px;
}

/* Pay Now button styling */
.wrickx-cart-sidebar.active .btn-pay-now {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wrickx-cart-sidebar.active .btn-pay-now:hover {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.wrickx-cart-sidebar.active .btn-pay-now:active {
    transform: scale(0.98);
}


/**
 * FINAL FIX FOR MOBILE SCROLLING
 * 
 * The problem is on lines 680-685 of your CSS:
 * 
 * body.cart-sidebar-open {
 *     overflow: hidden !important;  <-- THIS BLOCKS SCROLLING!
 *     position: fixed;
 * }
 * 
 * INSTRUCTIONS:
 * 1. Open wrickx-premium-minicart.css
 * 2. Find lines 680-685
 * 3. REPLACE those lines with the code below:
 */

/* ============================
   BODY LOCK - DESKTOP ONLY
   ============================ */

/* Desktop: Lock body scrolling when cart is open */
@media (min-width: 769px) {
    body.cart-sidebar-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* Mobile: Allow body AND cart to scroll */
@media (max-width: 768px) {
    body.cart-sidebar-open {
        overflow: auto !important;
        position: relative !important;
    }
}

/**
 * That's it! This allows:
 * - Desktop: Background locked (as before)
 * - Mobile: Cart scrolls freely, Pay Now button accessible
 */
/* ============================
   MOBILE RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .wrickx-cart-sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .cart-sidebar-header {
        padding: 16px 20px;
    }
    
    .cart-sidebar-header h3 {
        font-size: 18px;
    }
    
    .cart-items-container {
        padding: 12px 20px;
    }
    
    .cart-item {
        gap: 10px;
        padding: 16px 0;
    }
    
    .cart-item .item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item .item-name {
        font-size: 14px;
    }
    
    .cart-coupon-section,
    .cart-price-breakdown,
    .cart-checkout-actions {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .cart-item .item-price-qty {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .coupon-input-wrapper {
        flex-direction: column;
    }
    
    .btn-apply-coupon {
        width: 100%;
    }
}

/* ============================
   PREVENT FLICKERING
   ============================ */

.wrickx-cart-sidebar,
.wrickx-cart-overlay {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}






/* ============================================================================
 * PROPER FLEXBOX STRUCTURAL FIX - MOBILE ONLY
 * ============================================================================
 * 
 * INSTRUCTIONS:
 * 1. Open: /wp-content/themes/astra-child/css/wrickx-premium-minicart.css
 * 2. Find the mobile media query: @media screen and (max-width: 768px)
 * 3. REPLACE the entire mobile block with this code
 * 
 * DO NOT use this on desktop - desktop already works with absolute positioning
 * 
 * WHY THIS IS DIFFERENT:
 * - NO hardcoded footer heights
 * - NO padding-bottom compensation
 * - NO spacer elements
 * - Uses proper flexbox where footer naturally sits at bottom
 * - Footer height automatically calculated by browser
 * - Works regardless of content height, wrapping, or font changes
 * 
 * ============================================================================
 */

@media screen and (max-width: 768px) {
    /* ========================================
       DRAWER: FLEX COLUMN CONTAINER
       ======================================== */
    
    .wrickx-cart-sidebar.active {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height (mobile toolbar safe) */
        overflow: hidden !important; /* Prevent drawer itself from scrolling */
    }
    
    /* ========================================
       HEADER: FIXED HEIGHT AT TOP
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-sidebar-header {
        flex-shrink: 0 !important; /* Never shrink */
        flex-grow: 0 !important;   /* Never grow */
        padding: 14px 16px !important;
        background: white !important;
        border-bottom: 1px solid #e8e8e8 !important;
        z-index: 10 !important;
    }
    
    .wrickx-cart-sidebar.active .cart-sidebar-header h3 {
        font-size: 18px !important;
        margin: 0 !important;
    }
    
    /* ========================================
       CONTENT: FLEXIBLE SCROLLABLE AREA
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-sidebar-content {
        flex: 1 1 auto !important;  /* Take remaining space */
        overflow-y: auto !important; /* Scroll when content exceeds space */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;    /* CRITICAL: Allows flex item to shrink below content size */
        
        /* Remove all padding-bottom hacks */
        padding-bottom: 0 !important;
    }
    
    /* Remove spacer if it exists */
    .wrickx-cart-sidebar.active .cart-sidebar-content::after {
        display: none !important;
    }
    
    /* ========================================
       PRODUCTS: PART OF SCROLLABLE CONTENT
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-items-container {
        overflow: visible !important; /* Do NOT scroll separately */
        max-height: none !important;
        padding: 14px 16px !important;
    }
    
    .wrickx-cart-sidebar.active .cart-item {
        padding: 12px 0 !important;
    }
    
    .wrickx-cart-sidebar.active .cart-item .item-image {
        width: 70px !important;
        height: 70px !important;
    }
    
    /* ========================================
       COUPON: PART OF SCROLLABLE CONTENT
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-coupon-section {
        padding: 12px 16px !important;
        margin: 0 !important;
        background: #fafafa !important;
        border-top: 1px solid #f0f0f0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .wrickx-cart-sidebar.active .coupon-input-wrapper {
        display: flex !important;
        gap: 8px !important;
    }
    
    .wrickx-cart-sidebar.active .coupon-input {
        flex: 1 !important;
        padding: 10px !important;
        font-size: 14px !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
    }
    
    .wrickx-cart-sidebar.active .btn-apply-coupon {
        padding: 10px 16px !important;
        background: #1a1a1a !important;
        color: white !important;
        border: none !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }
    
    /* ========================================
       PRICE BREAKDOWN: PART OF SCROLLABLE CONTENT
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-price-breakdown {
        padding: 12px 16px 8px 16px !important;
        background: white !important;
        margin: 0 !important;
    }
    
    .wrickx-cart-sidebar.active .cart-price-breakdown .price-row {
        padding: 6px 0 !important;
        font-size: 14px !important;
    }
    
    /* Hide total row - shown in footer instead */
    .wrickx-cart-sidebar.active .cart-price-breakdown .price-row.total-row {
        display: none !important;
    }
    
    /* Hide tax note - shown in footer instead */
    .wrickx-cart-sidebar.active .cart-price-breakdown .tax-note {
        display: none !important;
    }
    
    /* ========================================
       CHECKOUT FOOTER: NATURAL BOTTOM POSITION
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-checkout-actions {
        /* STRUCTURAL FIX: Use flexbox, NOT position fixed/absolute */
        position: relative !important;  /* Natural document flow */
        flex-shrink: 0 !important;      /* Never shrink - always full height */
        flex-grow: 0 !important;        /* Never grow */
        
        /* Styling */
        padding: 12px 16px 14px 16px !important;
        background: white !important;
        border-top: 2px solid #e8e8e8 !important;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1) !important;
        margin: 0 !important;
        
        /* Safe area for iOS notch */
        padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    }
    
    /* ========================================
       TOTAL: COMPACT BUT READABLE
       ======================================== */
    
    .wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid #e8e8e8 !important;
    }
    
    .wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total .label {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: #333 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }
    
    .wrickx-cart-sidebar.active .cart-checkout-actions .checkout-total .value {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #000 !important;
    }
    
    /* ========================================
       PAY NOW BUTTON: COMPACT
       ======================================== */
    
    .wrickx-cart-sidebar.active .btn-pay-now {
        display: block !important;
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        text-align: center !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
        margin-bottom: 6px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }
    
    .wrickx-cart-sidebar.active .btn-pay-now:active {
        transform: scale(0.98) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    }
    
    /* ========================================
       TAX NOTE: BELOW BUTTON
       ======================================== */
    
    .wrickx-cart-sidebar.active .checkout-tax-note {
        display: block !important;
        font-size: 10px !important;
        color: #888 !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.3 !important;
    }
}

/* ============================================================================
 * WHY THIS STRUCTURALLY GUARANTEES VISIBILITY
 * ============================================================================
 * 
 * FLEXBOX LAYOUT:
 * 
 * .wrickx-cart-sidebar.active {
 *     display: flex;
 *     flex-direction: column;
 *     height: 100dvh;              ← Drawer fills viewport
 * }
 * 
 * ├── .cart-sidebar-header          ← flex-shrink: 0 (takes natural height)
 * ├── .cart-sidebar-content         ← flex: 1 (takes remaining space, scrolls)
 * └── .cart-checkout-actions        ← flex-shrink: 0 (takes natural height)
 * 
 * MATHEMATICAL GUARANTEE:
 * 
 * Available height = 100dvh
 * Header height = H (natural)
 * Footer height = F (natural, determined by content)
 * Content height = 100dvh - H - F (automatically calculated)
 * 
 * The footer CANNOT be hidden because:
 * 1. flex-shrink: 0 prevents it from shrinking
 * 2. It sits at the bottom of the flex column naturally
 * 3. Content area (flex: 1) absorbs all overflow via scroll
 * 4. min-height: 0 on content allows it to shrink below content size
 * 
 * WORKS REGARDLESS OF:
 * - Footer content height (text wrapping, font changes)
 * - Product count (1 item or 100 items)
 * - Coupon state (applied or not)
 * - Screen height (small or large)
 * 
 * NO ASSUMPTIONS MADE ABOUT:
 * - Pixel heights
 * - Line counts
 * - Padding totals
 * 
 * ============================================================================
 */

/* ============================================================================
 * 100dvh EXPLANATION
 * ============================================================================
 * 
 * PROBLEM: Mobile browsers have dynamic toolbars (address bar)
 * - Safari on iOS: Address bar shows/hides on scroll
 * - Chrome on Android: URL bar shows/hides
 * 
 * LEGACY: 100vh includes the space occupied by toolbars
 * - When toolbar visible: Content extends below visible area
 * - Result: Footer partially hidden
 * 
 * SOLUTION: 100dvh (dynamic viewport height)
 * - Always equals the visible viewport
 * - Adjusts automatically when toolbar shows/hides
 * - Guaranteed to fit in visible screen
 * 
 * FALLBACK: 100vh listed first for older browsers
 * - Modern browsers use 100dvh (overrides 100vh)
 * - Older browsers use 100vh (still works, minor issue)
 * 
 * ============================================================================
 */

/* ============================================================================
 * CONFIRMATION
 * ============================================================================
 * 
 * ✅ NO NESTED SCROLL
 * - Only .cart-sidebar-content has overflow-y: auto
 * - All children (.cart-items-container, .cart-coupon-section, 
 *   .cart-price-breakdown) have overflow: visible
 * - Single scroll region
 * 
 * ✅ NO HARDCODED HEIGHTS
 * - Footer height determined by browser based on content
 * - Content area height = 100dvh - header - footer (automatic)
 * - No assumptions, no magic numbers
 * 
 * ✅ FOOTER ALWAYS VISIBLE
 * - flex-shrink: 0 prevents footer from being compressed
 * - Natural document flow keeps it at bottom
 * - Cannot be scrolled off-screen
 * 
 * ✅ NO DESKTOP CHANGES
 * - All changes wrapped in @media screen and (max-width: 768px)
 * - Desktop continues using position: absolute (lines 694-815)
 * - Zero impact on desktop layout
 * 
 * ✅ WORKS WITH DYNAMIC CONTENT
 * - Text wrapping: Footer grows naturally
 * - Font changes: Footer adjusts automatically
 * - Product count: Content scrolls, footer stays visible
 * - No future pixel tweaking needed
 * 
 * ============================================================================
 */