/* =================================================================
   Cart Page Styles (Mobile First Approach)
   ================================================================= */

/* --- 1. Base Layout (Mobile Default) --- */
.cart-page-container {
    padding-bottom: 140px; /* મોબાઈલ ફૂટર માટે જગ્યા */
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden; /* આડી સ્ક્રોલ રોકવા */
}

/* Header */
.cart-header { 
    background: #fff; border-bottom: 1px solid #e5e7eb; 
    position: sticky; top: 0; z-index: 40;
}
.page-title { 
    font-size: 1.15rem; font-weight: 700; color: #1f2937; margin: 0; 
}

/* --- 2. Grid Layout (FORCE VERTICAL STACK) --- */
.cart-layout {
    display: flex;           /* Flexbox વાપરો જેથી સરળ રહે */
    flex-direction: column;  /* મોબાઈલમાં ફરજિયાત ઊભું (Vertical) */
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

/* Sections */
.cart-items-section {
    width: 100%;
    order: 1; /* આઈટમ્સ પહેલા */
}

.bill-section {
    width: 100%;
    order: 2; /* બિલ પછી */
    margin-bottom: 20px;
}

/* --- 3. Cart Items --- */
.delivery-strip {
    display: flex; align-items: center; gap: 12px;
    background: #fff; padding: 12px;
    border-radius: 12px; margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}
.delivery-strip .icon {
    width: 36px; height: 36px; background: #eff6ff; color: #2563eb;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.delivery-strip .text strong { display: block; font-size: 0.85rem; color: #374151; }
.delivery-strip .text p { font-size: 0.75rem; color: #6b7280; margin: 0; }

.cart-item {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; padding: 12px;
    border-radius: 12px; border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.item-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.item-img {
    width: 56px; height: 56px; object-fit: contain;
    background: #f9fafb; border-radius: 8px; padding: 2px;
    flex-shrink: 0; border: 1px solid #f3f4f6;
}
.item-info { flex: 1; min-width: 0; padding-right: 8px; }
.item-info h4 { 
    margin: 0 0 4px 0; font-size: 0.9rem; font-weight: 600; color: #1f2937;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-info .unit-price { font-size: 0.8rem; color: #6b7280; }

.item-stepper {
    display: flex; align-items: center; justify-content: space-between;
    background: #f0fdf4; border: 1px solid #16a34a;
    border-radius: 6px; height: 30px; width: 80px;
    overflow: hidden; flex-shrink: 0;
}
.stepper-btn {
    background: none; border: none; color: #16a34a;
    font-size: 1.1rem; cursor: pointer; width: 28px;
    display: flex; align-items: center; justify-content: center; height: 100%;
}
.stepper-val { 
    font-size: 0.85rem; font-weight: 700; color: #166534; 
    flex: 1; text-align: center; 
}

/* --- 4. Bill Details Card (White Box) --- */
.bill-card {
    background: #fff; 
    padding: 16px;
    border-radius: 12px; 
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Slight shadow to separate */
}

.bill-title { 
    font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: #111; 
    border-bottom: 1px solid #f3f4f6; padding-bottom: 8px;
}

.bill-row { 
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; font-size: 0.9rem; color: #4b5563; 
}

.bill-divider { border-top: 1px dashed #d1d5db; margin: 12px 0; }

.bill-row.grand-total { font-weight: 800; color: #111; font-size: 1.1rem; }

/* Desktop Button (Hidden on Mobile) */
.desktop-only-btn { display: none !important; }

.checkout-btn {
    background: #ea580c; color: #fff;
    padding: 14px; border-radius: 10px;
    border: none; font-weight: 600; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer; width: 100%; margin-top: 16px;
    box-shadow: 0 4px 6px rgba(234, 88, 12, 0.2);
}

.policy-note {
    margin-top: 16px; background: #f9fafb; padding: 12px;
    border-radius: 8px; display: flex; align-items: center; gap: 10px;
    color: #6b7280; font-size: 0.75rem; border: 1px solid #e5e7eb;
}

/* --- 5. Mobile Sticky Footer --- */
.cart-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    display: flex; align-items: center; justify-content: space-between;
    z-index: 100; border-top: 1px solid #f3f4f6;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.total-info { display: flex; flex-direction: column; }
.total-info #mobile-total-label { font-size: 0.7rem; color: #6b7280; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.total-info .amount { font-size: 1.25rem; font-weight: 800; color: #111; line-height: 1.1; }
.cart-bottom-bar .checkout-btn { width: auto; padding: 10px 24px; font-size: 0.95rem; margin: 0; box-shadow: none; }

/* Upsell Section */
.upsell-section { 
    margin-top: 20px; padding: 16px; 
    background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; 
}
.upsell-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.upsell-item { min-width: 100px; border: 1px solid #f3f4f6; border-radius: 8px; padding: 8px; text-align: center; }
.upsell-img { width: 40px; height: 40px; margin: 0 auto 5px; display: block; object-fit: contain; }
.upsell-name { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upsell-add { font-size: 0.75rem; color: #2563eb; font-weight: 700; display: block; margin-top: 4px; }


/* =================================================================
   6. DESKTOP OVERRIDES (Only for Big Screens)
   ================================================================= */

@media (min-width: 900px) {
    .cart-page-container { 
        padding-bottom: 40px; 
        max-width: 1150px; 
        margin: 0 auto;
    }

    /* Change to Grid Layout (Horizontal) */
    .cart-layout {
        display: grid;
        grid-template-columns: 1.8fr 1fr; /* Left Big, Right Small */
        align-items: start;
        flex-direction: row; /* Reset flex direction */
    }

    .cart-items-section { order: unset; }
    .bill-section { order: unset; margin-bottom: 0; }

    /* Sticky Sidebar */
    .bill-section {
        position: sticky; top: 100px; z-index: 10;
    }

    /* Hide Mobile Footer */
    .cart-bottom-bar, .desktop-only-hide { display: none !important; }

    /* Show Desktop Button */
    .desktop-only-btn { display: flex !important; }
}
/* Receipt Style Bill Card */
.bill-card {
    background: #fff;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px; /* Subtle pattern */
    border: 1px solid #e5e7eb;
}

/* Dotted Divider */
.bill-divider {
    border-top: 2px dashed #d1d5db;
}

/* High Conversion Checkout Button */
.checkout-btn {
    background: var(--brand-primary); /* Orange */
    /* Add a subtle shine animation */
    position: relative;
    overflow: hidden;
}
.checkout-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}