﻿/* Cart & Checkout Styles - Mobile First Approach */

/* Page layout */
.cart-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0.75rem;
}

/* LEFT SIDE: Cart Items */
.cart-items {
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    order: 2; /* Move below summary on mobile */
}

    .cart-items h2 {
        margin-bottom: 1.25rem;
        font-size: 1.375rem;
        color: #1b2438;
    }

/* Each cart card */
.cart-item-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

    .cart-item-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

/* Left side: image + info */
.item-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

    .item-left img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
    }

.item-details {
    flex: 1;
}

    .item-details h4 {
        margin: 0 0 0.5rem 0;
        font-size: 1.1rem;
        font-weight: 600;
        line-height: 1.3;
        color: #1b2438;
    }

    .item-details .price {
        margin: 0.5rem 0 0;
        font-weight: 700;
        color: #ff5d00;
        font-size: 1.2rem;
    }

/* Right side: controls */
.item-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1b2438;
}

    .quantity-btn:hover {
        background: #e9ecef;
    }

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Delete button */
.deleteButton {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .deleteButton svg {
        width: 20px;
        height: 20px;
    }

    .deleteButton:hover {
        background-color: #dc3545;
        border-color: #dc3545;
    }

        .deleteButton:hover .bin path {
            fill: #fff;
        }

    .deleteButton:active {
        transform: scale(0.95);
    }

.tooltip {
    display: none; /* Hide tooltip on mobile */
}

.empty-cart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    background-color: #f9fafb;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 2rem 1.5rem;
    text-align: center;
}

    .empty-cart-card svg {
        opacity: 0.7;
        margin-bottom: 1rem;
    }

    .empty-cart-card h3 {
        margin: 1rem 0 0.5rem;
        color: #1b2438;
        font-size: 1.5rem;
    }

    .empty-cart-card p {
        color: #6c757d;
        font-size: 1rem;
        line-height: 1.5;
    }

/* Order Summary */
.cart-summary {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    order: 1; /* Show first on mobile */
    position: sticky;
    top: 90px; /* Below navbar */
    z-index: 10;
}

    .cart-summary h3 {
        margin-bottom: 1.25rem;
        font-size: 1.3rem;
        color: #1b2438;
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .summary-row.total {
        font-size: 1.3rem;
        font-weight: 700;
        margin-top: 1rem;
        border-top: 2px solid #e9ecef;
        border-bottom: none;
        padding-top: 1rem;
        color: #1b2438;
    }

/* Coupon */
.coupon-box {
    display: flex;
    margin: 1.5rem 0;
    gap: 0.5rem;
}

    .coupon-box input {
        flex: 1;
        padding: 0.875rem;
        border: 2px solid #ff5d00;
        border-radius: 8px 0 0 8px;
        outline: none;
        font-size: 1rem;
        min-height: 52px;
    }

    .coupon-box .apply-btn {
        padding: 0.875rem 1.5rem;
        border: none;
        background: #ff5d00;
        color: #fff;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 600;
        min-height: 52px;
        white-space: nowrap;
    }

        .coupon-box .apply-btn:hover {
            background: #e65100;
            transform: translateY(-1px);
        }

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: #ff5d00;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .checkout-btn:hover {
        background: #e65100;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 93, 0, 0.3);
    }

/* Cart & Checkout Styles - Mobile First Approach */

/* ... (keep all your existing cart styles the same) ... */

/* CHECKOUT PAGE - CLEAN FIX */
.checkout-page {
    width: 100%;
}

.checkout-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    width: 100%;
}

.checkout-left,
.checkout-right {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
    box-sizing: border-box;
}



/* CHECKOUT PAGE - CLEAN FIX */
.checkout-page {
    width: 100%;
}

.checkout-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    width: 100%;
}

.checkout-left,
.checkout-right {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
    box-sizing: border-box;
}


.checkout-left form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.checkout-left .summary-items {
    flex: 1;
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
}

    .payment-option:hover {
        border-color: #007bff;
        transform: translateY(-1px);
    }

    .payment-option input[type="radio"] {
        width: 18px;
        height: 18px;
    }

    .payment-option img {
        width: 80px;
        height: auto;
    }

    .payment-option.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

        .payment-option.disabled:hover {
            border-color: #e9ecef;
            transform: none;
        }

/* Order Summary Items */
.summary-items {
    margin-bottom: 1.5rem;
}

.summary-item-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .summary-item-card:last-child {
        border-bottom: none;
    }

    .summary-item-card img {
        width: 60px;
        height: 60px;
        border-radius: 8px;
        object-fit: cover;
        flex-shrink: 0;
    }

.item-details {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
}

    .item-details p {
        margin: 0;
        word-wrap: break-word;
    }

.summary-totals {
    margin-top: 1.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

    .summary-line.total {
        font-size: 1.3rem;
        font-weight: 700;
        border-top: 2px solid #e9ecef;
        padding-top: 1rem;
        margin-top: 1rem;
    }

/* Success Page */
.success-page-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 80px 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #efefef;
}

.success-container {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.success-icon i {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.success-message {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1b2438;
    line-height: 1.3;
}

.success-text {
    color: #6c757d;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

    .button-group .btn {
        min-width: 100%;
        padding: 1rem 2rem;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1.1rem;
        min-height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* ===== TABLET & DESKTOP STYLES ===== */
@media (min-width: 768px) {
    /* Checkout Page Layout - CLEAN FIX */
    .checkout-container {
        flex-direction: row;
        align-items: flex-start;
        margin: 2rem auto;
        gap: 2rem;
    }

    .checkout-left {
        flex: 2; /* 66.66% */
        min-width: 0; /* Crucial for flexbox sizing */
        padding: 2rem;
    }

    .checkout-right {
        flex: 1; /* 33.33% */
        min-width: 0; /* Crucial for flexbox sizing */
        padding: 2rem;
        position: sticky;
        top: 100px;
        align-self: flex-start;
    }

    .checkout-left form {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .button-group {
        flex-direction: row;
    }

        .button-group .btn {
            min-width: 160px;
        }

    /* Cart Page Layout */
    .cart-page {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
        margin: 2rem auto;
        padding: 1rem;
    }

    .cart-items {
        order: 1;
        padding: 2rem;
    }

    .cart-summary {
        order: 2;
        position: sticky;
        top: 100px;
    }

    .cart-item-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem;
    }

    .item-right {
        flex-direction: row;
        width: auto;
        gap: 1.5rem;
    }

    .tooltip {
        display: flex;
        position: absolute;
        top: -45px;
        background-color: #1b2438;
        color: white;
        border-radius: 6px;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        font-weight: 500;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        opacity: 0;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

        .tooltip::before {
            position: absolute;
            width: 8px;
            height: 8px;
            transform: rotate(45deg);
            content: "";
            background-color: #1b2438;
            bottom: -4px;
            left: 50%;
            transform: translateX(-50%) rotate(45deg);
        }

    .deleteButton:hover .tooltip {
        opacity: 1;
    }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
    .cart-page {
        margin: 3rem auto;
    }

    .cart-items {
        padding: 2.5rem;
    }

    .cart-summary {
        padding: 2rem;
    }

    .checkout-container {
        margin: 3rem auto;
        max-width: 1200px;
    }
}

/* Small Mobile Optimizations */
@media (max-width: 360px) {
    .cart-page {
        padding: 0.5rem;
        margin: 0.5rem auto;
    }

    .cart-items,
    .cart-summary {
        padding: 1rem;
    }

    .item-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

        .item-left img {
            width: 70px;
            height: 70px;
        }

    .item-right {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .quantity-controls {
        justify-content: space-between;
    }
}

/* Safe Area Support */
@supports(padding: max(0px)) {
    .cart-page,
    .checkout-container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* Focus States for Accessibility */
.deleteButton:focus,
.quantity-btn:focus,
.checkout-btn:focus,
.coupon-box input:focus,
.payment-option input:focus {
    outline: 2px solid #ff5d00;
    outline-offset: 2px;
}

/* Loading States */
.checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Animation Improvements */
.cart-item-card,
.payment-option,
.checkout-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
