/* --- Cart Page Styles --- */

.cart-page .navbar.scrolled {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.cart-page .navbar.scrolled .nav-link,
.cart-page .navbar.scrolled .icon-btn {
    color: var(--text-primary);
}

.cart-section {
    padding-top: 20px;
}

.page-title {
    font-size: 36px;
    margin-bottom: 50px;
    text-align: center;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 60px;
    align-items: flex-start;
}

/* Labels */
.cart-header-labels {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 0 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.cart-header-labels span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #999;
    font-weight: 600;
}

/* Items List */
.cart-items-list {
    margin-bottom: 40px;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid #f5f5f5;
}

.item-product {
    display: flex;
    gap: 25px;
    align-items: center;
}

.item-img {
    width: 100px;
    aspect-ratio: 3/4;
    background: #f9f9f9;
    overflow: hidden;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info h3 {
    font-size: 16px;
    font-family: var(--font-sans);
    margin-bottom: 5px;
    font-weight: 500;
}

.item-info .item-variant {
    font-size: 13px;
    color: #777;
    margin-bottom: 12px;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 12px;
    text-decoration: underline;
    color: #999;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

.btn-remove:hover {
    color: #f00;
}

.item-price,
.item-total {
    font-size: 15px;
    font-weight: 500;
}

/* Quantity Input Styling (Shared with Detail but adjusted for Cart) */
.item-qty .quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    width: fit-content;
}

.item-qty .qty-btn {
    width: 32px;
    height: 38px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.item-qty input {
    width: 35px;
    text-align: center;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

/* Cart Footer Actions */
.cart-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-continue-shopping {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-update-cart {
    background: none;
    border: 1px solid #1E1E1E;
    padding: 12px 30px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-update-cart:hover {
    background: #1f3142;
    color: #f6f4f1;
}

/* Sidebar Summary */
.cart-sidebar {
    position: sticky;
    top: 120px;
}

.summary-card {
    background: #f9f9f7; /* Very slight warm neutral */
    padding: 40px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.summary-card h3 {
    font-size: 20px;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 18px;
    font-weight: 600;
    color: #1E1E1E;
    margin-bottom: 30px;
}

.promo-code-wrap {
    margin: 25px 0;
}

.promo-toggle {
    background: none;
    border: none;
    font-size: 13px;
    color: #1E1E1E;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.promo-input-group {
    display: none;
    margin-top: 15px;
    gap: 10px;
}

.promo-input-group.active {
    display: flex;
}

.promo-input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    font-size: 13px;
    outline: none;
}

.promo-input-group button {
    background: #1f3142;
    color: #f6f4f1;
    border: none;
    padding: 0 20px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.promo-input-group button:hover {
    background: #cfb79e;
    color: #1f3142;
}

.btn-checkout {
    width: 100%;
    height: 55px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    opacity: 0.6;
}

.payment-icons img {
    height: 20px;
}

.help-box {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #efefef;
    font-size: 13px;
    color: #888;
    line-height: 1.8;
}

.help-box h4 {
    color: #1E1E1E;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Empty Cart State */
.empty-cart-section {
    padding: 150px 0;
}

.empty-icon {
    margin-bottom: 30px;
    color: #ddd;
}

.empty-cart-section h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.empty-cart-section p {
    color: #777;
    margin-bottom: 40px;
}

.center-text {
    text-align: center;
}

/* Breadcrumbs Fix for Cart Page */
.breadcrumbs-container {
    padding: 20px 0;
    margin-top: 80px;
}

/* Responsive */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .cart-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 26px;
        margin-bottom: 25px;
        text-align: left;
    }

    .cart-header-labels {
        display: none;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-areas:
            "img info"
            "img qty"
            "img total";
        gap: 15px 20px;
        align-items: start;
        padding: 20px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .item-product {
        display: contents;
    }

    .item-img {
        grid-area: img;
        width: 80px;
        aspect-ratio: 3/4;
    }

    .item-info {
        grid-area: info;
        padding-right: 0;
    }

    .item-info h3 {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .item-info .item-variant {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .item-price {
        display: none;
    }

    .item-qty {
        grid-area: qty;
        align-self: center;
    }

    .item-qty .quantity-input {
        transform: scale(0.8);
        transform-origin: left;
    }

    .item-total {
        grid-area: total;
        text-align: right;
        align-self: center;
        font-size: 14px;
        font-weight: 600;
    }

    /* Sticky Mobile Checkout Bar - Compact and Premium */
    .cart-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 1000;
        padding: 15px 20px calc(15px + env(safe-area-inset-bottom));
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eee;
        top: auto !important; /* Force unset desktop top */
    }

    .summary-card {
        padding: 0;
        background: transparent;
        border: none;
    }

    .summary-card h3,
    .promo-code-wrap,
    .help-box,
    .payment-icons,
    .summary-row {
        display: none; /* Only show total for clean mobile feel */
    }

    .summary-total {
        margin: 0 0 12px;
        padding: 0;
        border: none;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .summary-total span:first-child {
        font-weight: 400;
        color: #666;
        font-size: 13px;
    }

    .summary-total .price {
        font-weight: 600;
        font-size: 16px;
    }

    .btn-checkout {
        height: 52px;
        margin-top: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 13px;
    }

    .cart-footer-actions {
        margin-top: 20px;
        padding-bottom: 40px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-update-cart {
        display: none;
    }

    .btn-continue-shopping {
        font-size: 12px;
    }
}
