/* =========================================================
   CUSTOM CART PAGE STYLES — v3.0 UNIFIED DESIGN
   File location: /wp-content/themes/YOUR-CHILD-THEME/assets/css/custom-cart.css

   ✅ SAME DESIGN EVERYWHERE:
   - Add to Cart popup
   - Direct /cart URL
   - New tab open
   - AJAX reload
   
   ✅ Desktop: Always 480px drawer from right + dark overlay
   ✅ Mobile: Always full screen
   ========================================================= */

/* =========================================================
   BASE SETUP — Body & Page Background
   ========================================================= */
body.woocommerce-cart,
body.woocommerce-checkout {
    background: #f0f2f5 !important;
    overflow: hidden !important;
    position: relative !important;
}

.woocommerce-cart .woocommerce-breadcrumb,
.woocommerce-checkout .woocommerce-breadcrumb { 
    display: none !important;
}

/* Hide WooCommerce default notices location */
.woocommerce-notices-wrapper {
    display: none !important;
}

/* =========================================================
   SCROLL LOCK — When drawer is active
   ✅ Prevents page from shifting or hiding
   ========================================================= */
html.cc-drawer-active {
    overflow: hidden !important;
    height: 100vh !important;
    position: relative !important;
}

body.cc-drawer-active {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
}

/* Product page content stays visible */
body.cc-drawer-active.single-product .product,
body.cc-drawer-active.single-product main,
body.cc-drawer-active.single-product #content {
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Prevent content from being pushed or hidden */
body.cc-drawer-active > *:not(.custom-cart-wrapper):not(.cc-drawer-overlay):not(.cc-confetti-container):not(.cc-success-toast) {
    position: relative !important;
}

/* =========================================================
   DRAWER OVERLAY — Dark background
   Always visible on cart/checkout pages (desktop)
   ========================================================= */
.cc-drawer-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 99998 !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.cc-drawer-overlay.cc-drawer-hidden {
    display: none !important;
}

/* ✅ Show overlay when on cart/checkout page */
body.woocommerce-cart .cc-drawer-overlay,
body.woocommerce-checkout .cc-drawer-overlay {
    display: block !important;
}

/* =========================================================
   CART WRAPPER — Base Mobile Style (< 992px default)
   ========================================================= */
.custom-cart-wrapper {
    max-width: 480px;
    width: 100%;
    margin: 20px auto;
    padding: 14px 14px 28px;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #111;
    box-sizing: border-box;
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}

.custom-cart-wrapper *,
.custom-cart-wrapper *::before,
.custom-cart-wrapper *::after { 
    box-sizing: border-box; 
}

/* =========================================================
   HEADER — Close/Back Button + Title
   ========================================================= */
.custom-cart-wrapper .cc-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    padding: 0 0 12px !important;
    width: 100% !important;
    margin: 0 !important;
}

.custom-cart-wrapper .cc-back-btn,
.custom-cart-wrapper .cc-close-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    flex: 0 0 42px !important;
    border-radius: 50% !important;
    border: 1.5px solid #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #111 !important;
    text-decoration: none !important;
    background: #fff !important;
    transition: all 0.2s;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.custom-cart-wrapper .cc-back-btn:hover,
.custom-cart-wrapper .cc-close-btn:hover {
    background: #f3f4f6 !important;
}

.custom-cart-wrapper .cc-title {
    flex: 1 1 auto !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111 !important;
    letter-spacing: -0.5px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* =========================================================
   PRODUCT CARDS
   ========================================================= */
.cc-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.cc-product-card {
    display: flex;
    gap: 14px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cc-product-image {
    width: 110px;
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.cc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cc-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    min-width: 0;
}

.cc-product-top { 
    padding-right: 24px; 
}

.cc-product-name {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
    line-height: 1.25;
}

.cc-product-name a { 
    color: inherit; 
    text-decoration: none; 
}

.cc-product-cat {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.cc-remove {
    position: absolute;
    top: 0;
    right: 0;
    color: #9ca3af;
    line-height: 1;
    cursor: pointer;
}

.cc-remove:hover { 
    color: #ef4444; 
}

.cc-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.cc-price {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}

.cc-price .woocommerce-Price-amount { 
    font-weight: 700; 
}

/* =========================================================
   QUANTITY BOX
   ========================================================= */
.cc-qty-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f7;
    border-radius: 999px;
    padding: 4px;
}

.cc-qty-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.cc-qty-minus,
.cc-qty-plus {
    background: #0c4740 !important;
    color: #ffffff !important;
}

.cc-qty-minus:hover,
.cc-qty-plus:hover {
    background: #0a3a34 !important;
}

.cc-qty-btn:disabled,
.cc-qty-btn.cc-loading {
    opacity: 0.5;
    cursor: wait;
}

.cc-qty-input {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111 !important;
    -moz-appearance: textfield !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.cc-qty-input::-webkit-outer-spin-button,
.cc-qty-input::-webkit-inner-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* =========================================================
   SIMILAR PRODUCTS SLIDER
   ========================================================= */
.cc-similar-section {
    margin: 6px 0 8px !important;
    padding: 0 !important;
}

.cc-section-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #111 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    letter-spacing: 0.3px !important;
    line-height: 1.2 !important;
}

.cc-similar-wrapper {
    position: relative !important;
    padding: 0 4px !important;
    margin: 0 !important;
}

.cc-similar-slider {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    padding: 0 0 4px !important;
    margin: 0 !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cc-similar-slider::-webkit-scrollbar { 
    display: none; 
}

.cc-similar-card {
    flex: 0 0 130px !important;
    background: #fff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cc-similar-img {
    display: block !important;
    width: 100% !important;
    height: 170px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.cc-similar-img img,
.cc-similar-img picture,
.cc-similar-img picture img,
.cc-similar-img > * {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 12px !important;
}

.cc-similar-info {
    padding: 4px 2px 0 !important;
    margin: 0 !important;
}

.cc-similar-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.cc-similar-action-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cc-add-btn {
    background: #0c4740 !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 999px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.cc-add-btn:hover {
    background: #0a3a34 !important;
    color: #ffffff !important;
}

/* =========================================================
   SLIDER NAVIGATION ARROWS
   ========================================================= */
.cc-slider-btn {
    position: absolute !important;
    top: 85px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    color: #0c4740 !important;
    transform: translateY(-50%);
    flex-shrink: 0 !important;
}

.cc-slider-btn svg {
    stroke: #0c4740 !important;
    width: 16px !important;
    height: 16px !important;
}

.cc-slider-btn:hover {
    background: #f5f5f5 !important;
    transform: translateY(-50%) scale(1.05);
}

.cc-slider-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.cc-slider-prev { left: -10px !important; }
.cc-slider-next { right: -10px !important; }

/* =========================================================
   SUMMARY CARD — Coupon + Totals
   ========================================================= */
.cc-summary-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 16px;
    margin: 0 0 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cc-coupon-row {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cc-coupon-input,
input.cc-coupon-input,
input[type="text"].cc-coupon-input,
.woocommerce input[type="text"].cc-coupon-input,
.woocommerce-page input[type="text"].cc-coupon-input,
.custom-cart-wrapper .cc-coupon-input,
.custom-cart-wrapper input[type="text"].cc-coupon-input,
.cc-drawer-popup .cc-coupon-input,
.cc-drawer-popup input[type="text"].cc-coupon-input,
form .cc-coupon-input,
form input[type="text"].cc-coupon-input {
    flex: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    color: #111 !important;
    outline: none !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

.cc-coupon-input:focus,
input.cc-coupon-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.cc-coupon-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.cc-coupon-btn {
    background: #0c4740 !important;
    color: #ffffff !important;
    border: none;
    padding: 9px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
    flex-shrink: 0;
}

.cc-coupon-btn:hover {
    background: #0a3a34 !important;
    color: #ffffff !important;
}

.cc-totals { 
    padding: 0 4px; 
}

.cc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 16px;
}

.cc-total-label { 
    color: #4b5563; 
    font-weight: 500; 
}

.cc-total-value { 
    color: #111; 
    font-weight: 700; 
}

.cc-total-value .woocommerce-Price-amount { 
    font-weight: 700; 
}

.cc-discount { 
    color: #111; 
}

.cc-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 5px 0;
}

.cc-grand-total .cc-total-label,
.cc-grand-total .cc-total-value {
    font-size: 17px;
    font-weight: 700;
}

/* =========================================================
   CHECKOUT BUTTON
   ========================================================= */
.cc-checkout-wrapper { 
    margin-top: 0; 
    padding: 0; 
}

.cc-checkout-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: #0c4740 !important;
    color: #ffffff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 17px;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(12, 71, 64, 0.35);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.cc-checkout-btn:hover {
    background: #0a3a34 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(12, 71, 64, 0.45);
}

/* =========================================================
   EMPTY CART — Cute Illustration
   ========================================================= */
.cc-empty-cart {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 30px 24px 40px !important;
    min-height: 60vh;
    gap: 0 !important;
}

.cc-empty-illustration {
    margin: 0 0 28px;
    line-height: 0;
    animation: ccBagFloat 3s ease-in-out infinite;
}

.cc-empty-illustration svg {
    width: 200px;
    max-width: 60vw;
    height: auto;
    display: block;
}

.cc-empty-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.3px;
}

.cc-empty-subtitle {
    font-size: 14px !important;
    color: #6b7280 !important;
    margin: 0 0 28px !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    max-width: 220px;
}

.cc-shop-link {
    display: inline-block !important;
    padding: 13px 38px !important;
    background: #0c4740 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    box-shadow: 0 4px 14px rgba(12, 71, 64, 0.25) !important;
    transition: all 0.2s !important;
    border: none !important;
    cursor: pointer !important;
}

.cc-shop-link:hover {
    background: #0a3a34 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(12, 71, 64, 0.35) !important;
}

@keyframes ccBagFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* =========================================================
   CONFETTI ANIMATION
   ========================================================= */
.cc-confetti-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    overflow: hidden !important;
}

.cc-confetti {
    position: absolute;
    top: -30px;
    will-change: transform, opacity;
    animation: ccConfettiFall linear forwards;
}

.cc-confetti-square { border-radius: 2px; }
.cc-confetti-circle { border-radius: 50%; }
.cc-confetti-strip  { border-radius: 1px; }

@keyframes ccConfettiFall {
    0%   { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 1; }
    50%  { opacity: 1; }
    100% {
        transform: translate3d(var(--cc-sway, 0), 105vh, 0) rotate(var(--cc-rotation, 720deg));
        opacity: 0.4;
    }
}

.cc-confetti-burst {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    z-index: 999999 !important;
}

.cc-confetti-burst .cc-confetti-piece {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: ccBurstOut 1s ease-out forwards;
}

@keyframes ccBurstOut {
    0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); opacity: 1; }
    100% {
        transform: translate3d(var(--cc-tx, 0), var(--cc-ty, 0), 0) scale(0.5) rotate(var(--cc-rot, 360deg));
        opacity: 0;
    }
}

.cc-success-toast {
    position: fixed !important;
    top: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-100px);
    background: #0c4740 !important;
    color: #ffffff !important;
    padding: 14px 28px !important;
    border-radius: 999px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 24px rgba(12, 71, 64, 0.4) !important;
    z-index: 999998 !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    animation: ccToastDrop 2.5s ease-in-out forwards;
}

.cc-success-toast svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 3;
}

@keyframes ccToastDrop {
    0%   { transform: translateX(-50%) translateY(-100px); opacity: 0; }
    15%  { transform: translateX(-50%) translateY(0); opacity: 1; }
    85%  { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}

/* =========================================================
   LOADING & UPDATING STATES
   ========================================================= */
.cc-drawer-hidden {
    display: none !important;
}

.cc-drawer-loading {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.cc-content-updating {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* =========================================================
   ✅ DESKTOP / LAPTOP (≥992px)
   UNIFIED DRAWER DESIGN — Same everywhere
   ========================================================= */
@media (min-width: 992px) {

    /* ✅ Cart/Checkout wrapper always as RIGHT DRAWER */
    .custom-cart-wrapper,
    .custom-cart-wrapper.cc-on-cart-page,
    .custom-cart-wrapper.cc-drawer-popup,
    body.woocommerce-cart .custom-cart-wrapper,
    body.woocommerce-checkout .custom-cart-wrapper {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 480px !important;
        max-width: 90vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 10px 16px 12px !important;
        border-radius: 20px 0 0 20px !important;
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.25) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        z-index: 99999 !important;
        background: #ffffff !important;
    }

    /* Scrollbar styling */
    .custom-cart-wrapper::-webkit-scrollbar { 
        width: 6px; 
    }
    .custom-cart-wrapper::-webkit-scrollbar-thumb { 
        background: #d1d5db; 
        border-radius: 999px; 
    }
    .custom-cart-wrapper::-webkit-scrollbar-track { 
        background: transparent; 
    }

    /* Tighter spacing on desktop */
    .custom-cart-wrapper .cc-header {
        padding: 0 0 4px !important;
    }
    .custom-cart-wrapper .cc-products-list { 
        gap: 6px !important; 
    }
    .custom-cart-wrapper .cc-product-card { 
        padding: 10px !important; 
    }
    .custom-cart-wrapper .cc-similar-section {
        margin: 8px 0 10px 0 !important;
    }
    .custom-cart-wrapper .cc-section-title { 
        font-size: 15px !important; 
    }
    .custom-cart-wrapper .cc-summary-card {
        margin: 0 0 6px 0 !important;
        padding: 14px !important;
    }
    .custom-cart-wrapper .cc-coupon-row {
        border: 1.5px solid #d1d5db !important;
        background: #f9fafb !important;
        padding: 5px !important;
    }
    .custom-cart-wrapper .cc-coupon-input { 
        padding: 9px 14px !important; 
    }
    .custom-cart-wrapper .cc-coupon-btn { 
        padding: 7px 18px !important; 
    }
    .custom-cart-wrapper .cc-total-row { 
        font-size: 15px !important; 
    }
    .custom-cart-wrapper .cc-checkout-btn {
        padding: 13px !important;
        font-size: 16px !important;
    }
    .custom-cart-wrapper .cc-empty-cart {
        min-height: calc(100vh - 80px);
    }
}

/* =========================================================
   ✅ MOBILE / TABLET (< 992px)
   FULL SCREEN DRAWER
   ========================================================= */
@media (max-width: 991px) {
    
    /* Mobile — full screen overlay */
    .cc-drawer-overlay,
    body.woocommerce-cart .cc-drawer-overlay,
    body.woocommerce-checkout .cc-drawer-overlay {
        display: block !important;
        position: fixed !important;
        z-index: 99998 !important;
    }

    .cc-drawer-overlay.cc-drawer-hidden { 
        display: none !important; 
    }

    /* ✅ Mobile wrapper — full screen */
    .cc-drawer-popup,
    .custom-cart-wrapper.cc-on-cart-page,
    body.woocommerce-cart .custom-cart-wrapper,
    body.woocommerce-checkout .custom-cart-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 14px 14px 28px !important;
        background: #ffffff !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    /* Mobile scrollbar */
    .custom-cart-wrapper::-webkit-scrollbar { 
        width: 4px; 
    }
    .custom-cart-wrapper::-webkit-scrollbar-thumb { 
        background: #d1d5db; 
        border-radius: 999px; 
    }

    .custom-cart-wrapper .cc-empty-cart {
        min-height: calc(100vh - 80px);
        min-height: calc(100dvh - 80px);
    }
}

/* Small mobile screens */
@media (max-width: 380px) {
    .custom-cart-wrapper { 
        padding: 12px 12px 24px !important; 
    }
    .custom-cart-wrapper .cc-title { 
        font-size: 20px !important; 
    }
    .cc-product-image { 
        width: 95px; 
        height: 115px; 
    }
    .cc-product-name { 
        font-size: 15px; 
    }
    .cc-price { 
        font-size: 15px; 
    }
    .cc-similar-img { 
        height: 150px !important; 
    }
    .cc-slider-btn { 
        top: 75px !important; 
    }
    .cc-empty-illustration svg { 
        width: 170px; 
    }
    .cc-empty-title { 
        font-size: 20px !important; 
    }
}

/* =========================================================
   ✅ FIX: Product page should NOT shift when drawer opens
   Background page stays fixed in position
   ========================================================= */

/* When drawer is active, lock main content position */
body.cc-drawer-active {
    position: fixed !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* Prevent content from shifting or moving */
body.cc-drawer-active .site-content,
body.cc-drawer-active main,
body.cc-drawer-active #content,
body.cc-drawer-active .content-area,
body.cc-drawer-active article {
    position: relative !important;
}

/* On cart/checkout pages, prevent any layout shift */
body.woocommerce-cart,
body.woocommerce-checkout {
    position: relative !important;
    overflow: hidden !important;
}

body.woocommerce-cart *:not(.custom-cart-wrapper):not(.custom-cart-wrapper *):not(.cc-drawer-overlay),
body.woocommerce-checkout *:not(.custom-checkout-wrapper):not(.custom-checkout-wrapper *):not(.cc-drawer-overlay) {
    /* Hide all WooCommerce default content except our custom wrapper */
    max-width: 100% !important;
}

/* Hide default WooCommerce cart/checkout form on page */
body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce-checkout {
    /* Only our custom wrapper should be visible */
}

/* Make sure site header/footer don't interfere */
body.woocommerce-cart .site-header,
body.woocommerce-cart .site-footer,
body.woocommerce-checkout .site-header,
body.woocommerce-checkout .site-footer {
    position: relative !important;
    z-index: 1 !important;
}

/* Overlay should cover everything except drawer */
.cc-drawer-overlay {
    z-index: 99998 !important;
}

.custom-cart-wrapper,
.custom-checkout-wrapper {
    z-index: 99999 !important;
}

/* =========================================================
   ✅ CRITICAL FIX: Ensure consistent drawer appearance
   Same styling whether opened from Add to Cart or direct URL
   ========================================================= */

/* Force consistent wrapper styling on ALL instances */
.custom-cart-wrapper,
.custom-cart-wrapper.cc-drawer-popup,
.custom-cart-wrapper.cc-on-cart-page,
#cc-cart-drawer.custom-cart-wrapper,
body.woocommerce-cart .custom-cart-wrapper,
body.woocommerce-checkout .custom-cart-wrapper,
body.single-product .custom-cart-wrapper {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Ensure header is always at top with proper spacing */
.custom-cart-wrapper .cc-header {
    position: sticky !important;
    top: 0 !important;
    background: #ffffff !important;
    z-index: 10 !important;
    margin-bottom: 0 !important;
}

/* Consistent product card spacing */
.custom-cart-wrapper .cc-products-list {
    padding-top: 8px !important;
}

/* Make sure overlay always covers full screen */
body.cc-drawer-active .cc-drawer-overlay,
.cc-drawer-overlay:not(.cc-drawer-hidden) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 99998 !important;
    display: block !important;
}

/* Desktop: drawer always from right, same width */
@media (min-width: 992px) {
    body.cc-drawer-active .custom-cart-wrapper,
    body.woocommerce-cart .custom-cart-wrapper,
    #cc-cart-drawer.custom-cart-wrapper {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 480px !important;
        max-width: 480px !important;
        height: 100vh !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* Mobile: full screen, same styling */
@media (max-width: 991px) {
    body.cc-drawer-active .custom-cart-wrapper,
    body.woocommerce-cart .custom-cart-wrapper,
    #cc-cart-drawer.custom-cart-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* =========================================================
   GST & ROUND OFF STYLING
   ========================================================= */

/* =========================================================
   MOBILE CART VIEW - DIRECT URL ACCESS
   Special handling for mobile when accessing /cart directly
   ========================================================= */
@media (max-width: 991px) {
    /* When mobile user accesses /cart URL directly */
    body.cc-mobile-cart-view {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100vh !important;
    }
    
    /* Hide default cart page content on mobile */
    body.cc-mobile-cart-view .woocommerce,
    body.cc-mobile-cart-view .woocommerce-cart,
    body.cc-mobile-cart-view .cart-empty,
    body.cc-mobile-cart-view .site-header,
    body.cc-mobile-cart-view .site-footer {
        display: none !important;
    }
    
    /* Mobile fullscreen drawer */
    body.cc-mobile-cart-view .custom-cart-wrapper,
    .custom-cart-wrapper.cc-mobile-fullscreen {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 99999 !important;
        margin: 0 !important;
        transform: none !important;
    }
    
    /* Overlay for mobile cart view */
    body.cc-mobile-cart-view .cc-drawer-overlay {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.7) !important;
        z-index: 99998 !important;
    }
}

/* Desktop: Ensure normal behavior */
@media (min-width: 992px) {
    body.cc-mobile-cart-view .woocommerce,
    body.cc-mobile-cart-view .site-header,
    body.cc-mobile-cart-view .site-footer {
        display: block !important;
    }
}
.cc-total-row.cc-gst-row {
    padding: 4px 0;
    font-size: 14px;
    color: #6b7280;
}

.cc-total-row.cc-gst-row .cc-total-label {
    color: #6b7280;
    font-weight: 500;
}

.cc-total-row.cc-gst-row .cc-total-value {
    color: #374151;
    font-weight: 600;
}

.cc-total-row.cc-roundoff-row {
    padding: 4px 0;
    font-size: 14px;
}

.cc-total-row.cc-roundoff-row .cc-total-label {
    color: #6b7280;
    font-weight: 500;
}

.cc-total-row.cc-roundoff-row .cc-total-value {
    font-weight: 600;
}

.cc-roundoff-positive {
    color: #16a34a !important;
}

.cc-roundoff-negative {
    color: #dc2626 !important;
}

/* Grand total row emphasis */
.cc-total-row.cc-grand-total {
    padding: 8px 0 0 !important;
    margin-top: 6px !important;
}

.cc-total-row.cc-grand-total .cc-total-label,
.cc-total-row.cc-grand-total .cc-total-value {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #111 !important;
}