/* ==========================================================================
   1. GLOBAL CART & CHECKOUT LAYOUT WRAPPER
   ========================================================================== */
body, html {
    background-color: white !important; /* આખા પેજ નો કલર પરાણે સેટ કરશે */
}
.cart-wrapper-bg,
.checkout-bg {

    min-height: 70vh;
    padding: 40px 20px 40px 20px; /* અહી 80px ની જગ્યાએ 40px કર્યું છે */
    margin-bottom: 0;
}

.cart-header-title {
    padding: 0 0 20px 0;
    border-bottom: 1px solid #eaeaec;
    margin-bottom: 30px;
}

.cart-header-title h2,
.checkout-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #4a0404;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 5px 0;
}

.cart-header-title span {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #777;
}

/* Increased max-width for modern Desktops/Laptops */
.cart-container {
    max-width: 1200px; 
    margin: 0 auto;
    font-family: 'Lato', sans-serif;
    display: block; /* FIX: આનાથી Title આખા પેજ પર ઉપર આવી જશે */
}

.checkout-container {
    max-width: 1200px; 
    margin: 0 auto;
    font-family: 'Lato', sans-serif;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.cart-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

/* ==========================================================================
   2. LEFT SECTION: ITEMS & CARDS (Unified for Cart & Checkout)
   ========================================================================== */
.cart-items-section,
.checkout-left {
    flex: 1 1 65%; /* Takes 65% width on large screens */
    min-width: 0;
}

.cart-card,
.item-tile {
background-color: #f9f5f0;
    border: 1px solid #eaeaec;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease-in-out, border-color 0.2s;
}

.cart-card:hover,
.item-tile:hover {
    box-shadow: 0 4px 15px rgba(74, 4, 4, 0.06);
    border-color: #d4d5d9;
}

.cart-card-main,
.item-tile {
    display: flex;
    gap: 25px;
    padding: 20px;
    align-items: flex-start; /* Changed to flex-start for better layout with larger images */
}

/* Desktop Image Size (Like Screenshot) */
.cart-img {
    width: 120px; 
    height: 160px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden; 
    background: #f4f4f4;
    border: 1px solid #eaeaec;
}

.cart-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.cart-img a:hover img,
.cart-img:hover img {
    transform: scale(1.05);
}

.item-tile img {
    width: 100px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
}

.cart-details,
.item-info {
    background-color: #f9f5f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 13px;
    color: #888;
    margin: 0 0 6px 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name,
.item-info h4 {
    font-size: 16px;
    color: #282c3f;
    text-decoration: none;
    margin: 0 0 8px 0;
    font-weight: 700;
    line-height: 1.4;
}

.product-name:hover {
    color: #4a0404;
}

.item-variant-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-price-box,
.item-info .item-price {
    background-color: #f9f5f0;
    font-size: 16px;
    font-weight: 700;
    color: #4a0404;
    margin-top: 4px;
}

/* ==========================================================================
   3. QUANTITY CONTROL STYLES
   ========================================================================== */
.qty-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f9f5f0;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #eaeaec;
    margin-top: 10px;
    width: fit-content;
}

.qty-box label {
    font-size: 13px;
    font-weight: bold;
    color: #282c3f;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    background-color: #f8f8f8;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.qty-btn:hover {
    background-color: #e0e0e0;
}

.qty-input {
    width: 45px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #282c3f;
    padding: 6px 0;
    background: transparent;
    outline: none;
    pointer-events: none;
}

.cart-card-actions {
    border-top: 1px solid #eaeaec;
    display: flex;
}

.action-btn {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 13px;
    font-weight: 700;
    color: #535766;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.action-btn i {
    margin-right: 6px;
    font-size: 14px;
}

.action-btn:hover {
    color: #4a0404;
    background: #f9f5f0;
}

.cart-update-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    padding: 18px;
    background: #fff;
    border: 1px solid #eaeaec;
    border-radius: 6px;
}

.continue-shopping {
    color: #535766;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    transition: 0.2s;
}

.continue-shopping:hover {
    color: #4a0404;
}

/* ==========================================================================
   4. CHECKOUT DELIVERY ADDRESS CARD STYLES
   ========================================================================== */
.selected-address-card {
    background: #fff;
    border: 1px solid #d4af37;
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    margin-bottom: 30px;
}

.sac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sac-name-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sac-name {
    font-size: 16px;
    font-weight: 700;
    color: #282c3f;
}

.sac-badge-default {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.sac-badge-type {
    background: #f4f4f5;
    color: #4a0404;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.btn-change-addr {
    background: transparent;
    border: 1px solid #4a0404;
    color: #4a0404;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-change-addr:hover {
    background: #4a0404;
    color: #fff;
}

.sac-phone {
    font-size: 14px;
    color: #535766;
    margin-bottom: 10px;
}

.sac-address {
    font-size: 14px;
    color: #535766;
    line-height: 1.6;
}

.no-address-box {
    background: #fff;
    border: 1px dashed #d4d5d9;
    padding: 30px;
    text-align: center;
    border-radius: 6px;
}

.btn-go-profile {
    display: inline-block;
    background: #4a0404;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 15px;
}

/* ==========================================================================
   5. RIGHT SECTION: SUMMARY & PRICE DETAILS CARD
   ========================================================================== */
.cart-summary-section,
.checkout-right {
    flex: 1 1 35%; /* Takes 35% width on large screens */
    position: sticky;
    top: 30px;
    min-width: 320px;
}

.summary-card,
.checkout-right {
    border: 1px solid #eaeaec;
    border-radius: 6px;
    padding: 24px;
background-color: #f9f5f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.summary-card h3,
.checkout-right h3 {
    font-size: 15px;
    color: #535766;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eaeaec;
    padding-bottom: 15px;
    letter-spacing: 0.5px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14.5px;
    color: #555;
    margin-bottom: 18px;
}

.summary-row span:last-child {
    color: #282c3f;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: #eaeaec;
    margin: 20px 0;
}

.total-row {
    font-size: 18px;
    font-weight: 900;
    color: #4a0404;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.btn-checkout,
.btn-confirm {
    display: block;
    width: 100%;
    background: #4a0404;
    color: #fff;
    text-align: center;
    padding: 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
}

.btn-checkout:hover,
.btn-confirm:hover {
    background: #2a0202;
    box-shadow: 0 4px 12px rgba(74, 4, 4, 0.2);
}

.secure-checkout {
    margin-top: 25px;
    font-size: 13px;
    color: #7e818c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.secure-checkout i {
    color: #4a0404;
    font-size: 18px;
}

/* ==========================================================================
   6. CUSTOM POPUPS & MODALS 
   ========================================================================== */
.addr-modal-overlay,
.login-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.addr-modal-content,
.login-popup-card {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    padding: 25px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.addr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eaeaec;
    padding-bottom: 15px;
}

.addr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #282c3f;
}

.close-modal,
.popup-close-corner {
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 15px;
}

.popup-addr-card {
    border: 1px solid #eaeaec;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.popup-addr-card:hover {
    border-color: #4a0404;
    background: #fffaf9;
}

.popup-addr-name {
    font-weight: 700;
    color: #282c3f;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-addr-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* ==========================================================================
   7. EMPTY CART STYLES
   ========================================================================== */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border: 1px solid #eaeaec;
    border-radius: 6px;
}

.empty-cart-icon i {
    font-size: 70px;
    color: #d4d5d9;
    margin-bottom: 20px;
}

.empty-cart h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #4a0404;
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-cart p {
    color: #7e818c;
    font-size: 14px;
    margin-bottom: 30px;
}

.empty-cart .btn-primary {
    background: #4a0404;
    color: #fff;
    padding: 14px 40px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    display: inline-block;
    transition: background 0.3s;
}

.empty-cart .btn-primary:hover {
    background: #2a0202;
}

/* ==========================================================================
   8. RESPONSIVE MEDIA QUERIES (Tablets & Mobiles)
   ========================================================================== */

/* Tablet & Smaller Laptops */
@media (max-width: 992px) {
    .cart-container,
    .checkout-container,
    .cart-layout {
        flex-direction: column;
    }

    .cart-summary-section,
    .checkout-right {
        width: 100%;
        position: static; /* Removes sticky behavior for scrolling on smaller devices */
        min-width: 0;
    }
}

/* Mobile Phones */
@media (max-width: 576px) {
    .cart-wrapper-bg, .checkout-bg {
        padding: 20px 10px 60px 10px;
    }

    .cart-header-title h2,
    .checkout-title {
        font-size: 1.4rem;
    }

    .cart-card-main,
    .item-tile {
        padding: 12px;
        gap: 15px;
    }

    .cart-img {
        width: 80px;
        height: 110px;
    }

    .item-tile img {
        width: 70px;
        height: 95px;
    }

    .product-name,
    .item-info h4 {
        font-size: 14px;
        white-space: normal; /* Let the text wrap on very small screens */
    }

    .cart-price-box,
    .item-info .item-price {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .qty-box {
        padding: 4px 8px;
    }

    .cart-update-row {
        justify-content: center;
        padding: 12px;
    }

    .summary-card,
    .checkout-right,
    .selected-address-card {
        padding: 18px;
    }
}