/* ==========================================================================
   1. CART DRAWER - CORE PANEL & OVERLAY
   ========================================================================== */
 
 
   
   
   
   
   .dg-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: dg-spin 0.8s linear infinite;
}

@keyframes dg-spin {
    to { transform: rotate(360deg); }
}

/* Ensure buttons don't jump in height when spinner appears */
.dg-apply-coupon-btn, #dg-remove-coupon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 45px;
}
   
/* Container padding to center content vertically */
.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.dg-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.dg-empty-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Matching your Manage/Skip button style */
.dg-continue-shopping-btn {
   display: flex;
    align-items: center;
    justify-content: center;
    background-color: #62a0b4 !important;
    color: #ffffff !important;
    padding: 18px 30px;
    border-radius: 12px; /* Smooth rounded corners from image */
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    border: none;
    cursor: pointer;
}

.dg-continue-shopping-btn:hover {
    background-color: #5d8a9a;
    color: #ffffff;
}

.dg-continue-shopping-btn:active {
    transform: scale(0.98);
}   
   
   
 /* Container state when updating */
.dg-item-updating {
    position: relative;
    pointer-events: none; /* Prevent extra clicks */
}

.dg-item-updating::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #1B4332; /* Match your brand color */
    border-radius: 50%;
    animation: dg-spin 0.8s linear infinite;
    z-index: 10;
}

/* Blur the content slightly while loading */
.dg-item-updating .cart-drawer__item-details,
.dg-item-updating .cart-drawer__item-thumb {
    opacity: 0.3;
    filter: blur(1px);
}

@keyframes dg-spin {
    to { transform: rotate(360deg); }
}  
   
   
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh !important;
    z-index: 999999;
    display: block; /* Changed from none to block to allow animation */
    visibility: hidden; /* Use visibility instead of display:none */
    overflow: hidden !important;
    transition: visibility 0.6s;
}

.cart-drawer.is-active {
    visibility: visible;
}

.cart-drawer__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    /* Match timing with panel for seamless feel */
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(0px); /* Prepare for blur */
    -webkit-backdrop-filter: blur(0px);
}

.cart-drawer.is-active .cart-drawer__overlay {
    opacity: 1;
    backdrop-filter: blur(4px); /* Adds a high-end glass look to the background */
    -webkit-backdrop-filter: blur(4px);
}

.cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    
    /* THE SMOOTHNESS FIX: */
    transform: translateX(100%); /* Start completely off-screen */
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1) !important;
    will-change: transform; /* Signals GPU to keep animation at 60fps */
    
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}
.cart-drawer.is-active .cart-drawer__panel {
    transform: translateX(0); /* Smoothly slides to position */
}



@keyframes dg-cart-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    50% { transform: scale(0.85); }
    75% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cart-icon-bounce {
    display: inline-block !important;
    animation: dg-cart-bounce 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   2. FIXED SECTIONS (HEADER & SHIPPING)
   ========================================================================== */
#dg-cart-drawer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.dg-fixed-header-wrapper {
    flex-shrink: 0;
    background: #fff;
    z-index: 10;
}

.cart-drawer__header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f2f2f2;
}

.cart-drawer__header-label {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.cart-drawer__close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.cart-drawer__shipping-bar {
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #f2f2f2;
}

.cart-drawer__shipping-msg {
    font-size: 14px;
    margin-bottom: 8px;
    color: #1b4332;
    font-weight: 500;
}

.cart-drawer__shipping-track {
    width: 100%;
    height: 6px;
    background: #eef2f6;
    border-radius: 10px;
    overflow: hidden;
}

.cart-drawer__shipping-fill {
    height: 100%;
    background: #62a0b4;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   3. SCROLLABLE BODY & ITEMS
   ========================================================================== */
.cart-drawer__body {
    flex: 1;
    padding: 0 24px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #62a0b4 #f1f5f9;
}

.cart-drawer__body::-webkit-scrollbar {
    width: 5px;
}
.cart-drawer__body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.cart-drawer__body::-webkit-scrollbar-thumb {
    background: #62a0b4;
    border-radius: 10px;
}

.cart-drawer__item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    align-items: flex-start;
    position: relative;
}

.cart-drawer__item-thumb {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
}

.cart-drawer__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-drawer__item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-drawer__item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-drawer__item-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    color: #000;
    line-height: 1.3;
    padding-right: 10px;
}

.dg-remove-item {
    background: #f1f5f9;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    padding: 0;
}

.dg-remove-item:hover {
    background: #fee2e2;
    color: #ef4444;
}

.cart-drawer__item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.cart-drawer__item-qty {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px;
}

.cart-drawer__qty-btn {
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer__qty-value {
    width: 45px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

.dg-item-price-display {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

/* ==========================================================================
   4. SUBSCRIPTION TOGGLE
   ========================================================================== */
.dg-subscription-toggle-wrapper {
    padding-top: 5px;
    border-top: 1px solid #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dg-sub-label {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: rgb(107, 114, 128);
}

/* Container: Reduced from 42x22 to 32x18 */
.dg-pill-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    vertical-align: middle;
}

.dg-pill-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The Track */
.dg-pill-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 20px;
}

/* The Circle: Reduced from 16px to 12px */
.dg-pill-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Active State Background */
input:checked + .dg-pill-slider {
    background-color: #2E5738; /* Matches your brand button color */
}

/* Move distance: Adjusted for smaller track */
input:checked + .dg-pill-slider:before {
    transform: translateX(14px);
}
/* ==========================================================================
   5. PROMO / COUPON SECTION (Inside Scroll)
   ========================================================================== */
.dg-drawer-promo-section {
    padding: 20px 0;
    border-top: 1px solid #f2f2f2;
    margin-top: 10px;
}

.dg-coupon-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: #4a5568;
    padding: 10px 0;
}

.dg-coupon-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.dg-coupon-input-group input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 12px;
}

.dg-apply-coupon-btn {
    background: #1b4332;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.dg-applied-coupon-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    border: 1px dashed #cbd5e0;
    margin-bottom: 10px;
}

.dg-coupon-info p {
    margin: 4px 0 0 0;
    font-size: 11px;
    color: #718096;
}

.dg-remove-coupon {
    color: #e53e3e;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dg-remove-coupon:hover {
    color: #000000 !important;
    text-decoration: underline;
}

/* ==========================================================================
   6. FIXED FOOTER & CHECKOUT
   ========================================================================== */
.cart-drawer__footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
    /* Extra padding to ensure button isn't flushed to the very bottom */
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important; 
}

/* Subtotal and Shipping Rows */
.cart-drawer__summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    
    /* Your requested style for Subtotal/Shipping */
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: rgb(26, 26, 26);
}

/* Total Row */
.cart-drawer__summary-row.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;

    /* Your requested style for Total */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 29.7px;
    color: rgb(0, 0, 0);
}

/* Ensure the checkout button stays consistent */
.cart-drawer__checkout {
    margin-top: 20px;
    background-color: #62a0b4 !important;
    border-radius: 12px;
    padding: 10px ;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    display: block;
    
    /* Using Total font style for the button text */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.dg-cart-total-display{color:#fff !important;}

/* Specific color for 'FREE' shipping text */
.dg-shipping-free {
    color: #166534;
    font-weight: 600;
}
.cart-drawer__checkout:hover {
    background: #538b9d !important;
}

/* UI STATES */
.dg-item-updating {
    opacity: 0.5;
    pointer-events: none;
}

.cart-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.is-hidden { display: none !important; }











@media screen and (max-width: 420px){
    
    .cart-drawer__panel{max-width:370px !important;}
    
} 