/* =========================================
   CART & CHECKOUT STYLES
   ========================================= */

/* Empty Cart State */
.empty-cart-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.empty-cart-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 15px;
    display: inline-block;
}

.empty-cart-state h2 {
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.empty-cart-state p {
    color: var(--text-muted);
}

/* Cart Items */
.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.cart-item {
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    gap: 12px;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--bg-light);
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 4px;
    line-height: 1.3;
}

.cart-item-vendor {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-price {
    font-weight: 800;
    color: var(--primary-color);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 50px;
}

.qty-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--dark-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: var(--border-color);
}

.qty-display {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 15px;
    text-align: center;
}

.cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cart-item-remove:hover {
    opacity: 1;
}

/* Order Summary */
.order-summary-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.order-summary-card h3 {
    margin-bottom: 15px;
    color: var(--dark-blue);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-row.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--dark-blue);
}

/* Checkout Form */
.checkout-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.checkout-card h3 {
    margin-bottom: 20px;
    color: var(--dark-blue);
    font-size: 1.1rem;
}

/* Checkout Form Fields */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper.align-top {
    align-items: flex-start;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-wrapper.align-top i {
    top: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 14px 14px 42px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--dark-blue);
    background: var(--bg-light);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(242, 16, 16, 0.1);
}

.form-control::placeholder {
    color: #a0aec0;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.payment-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.payment-option input {
    position: absolute;
    opacity: 0;
}

.pay-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    text-align: center;
}

.pay-btn i {
    font-size: 1.6rem;
}

.payment-option input:checked + .pay-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(242, 16, 16, 0.05);
}

.checkout-btn {
    margin-top: 25px;
    font-size: 1.05rem;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), #ff4d4d);
}

/* Success Modal */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.success-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 360px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.show .success-card {
    transform: scale(1);
    opacity: 1;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #10B981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.success-card h2 {
    color: var(--dark-blue);
    margin-bottom: 10px;
}

.success-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* ===== HIGH-FIDELITY PREMIUM REDESIGN FOR CART & CHECKOUT ===== */
body {
    background: linear-gradient(135deg, #f8fafc, #eef2f6);
}

.cart-items-container {
    gap: 16px;
    margin-top: 15px;
}

.cart-item {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.04);
    display: flex;
    gap: 16px;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.cart-item-img {
    width: 85px;
    height: 85px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 2px solid #ffffff;
}

.cart-item-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.cart-item-vendor {
    color: #6366f1;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-bottom {
    margin-top: 8px;
}

.cart-item-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ff4d4d;
    background: #fff5f5;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #ffe3e3;
    display: inline-block;
}

.qty-controls {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-radius: 50%;
    color: #475569;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #6366f1;
    color: #ffffff;
    transform: scale(1.1);
}

.cart-item-remove {
    background: #fff5f5;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffe3e3;
    top: -10px;
    right: -10px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
    opacity: 1;
    transition: all 0.3s ease;
}

.cart-item-remove:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
}

/* --- ORDER SUMMARY OVERHAUL --- */
.order-summary-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.05);
}

.order-summary-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-summary-card h3::before {
    content: "\e240"; /* Phosphor receipt icon placeholder */
    font-family: "Phosphor";
    color: #6366f1;
}

.summary-row {
    font-size: 0.98rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 14px;
    align-items: center;
}

#cartSubtotal {
    color: #1e293b;
    font-weight: 700;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#cartDelivery {
    color: #3b82f6; /* Colorful blue for delivery fee */
    font-weight: 800;
    background: #eff6ff;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.summary-row.total {
    border-top: 2px dashed #cbd5e1;
    margin-top: 20px;
    padding-top: 20px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

#cartTotal {
    color: #ec4899; /* Ultra colorful pink for grand total */
    background: linear-gradient(135deg, #fdf2f8, #fbcfe8);
    padding: 8px 18px;
    border-radius: 12px;
    border: 2px solid #f472b6;
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.2);
    letter-spacing: 0.5px;
    animation: pulseTotal 2s infinite ease-in-out;
}

@keyframes pulseTotal {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* --- CHECKOUT CARD --- */
.checkout-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.05);
}

.checkout-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.input-wrapper i {
    color: #8b5cf6;
    font-size: 1.3rem;
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 14px 14px 14px 44px;
    font-size: 0.98rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.payment-methods {
    gap: 12px;
}

.pay-btn {
    border: 2.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    background: #ffffff;
}

.payment-option input:checked + .pay-btn {
    border-color: #6366f1;
    color: #6366f1;
    background: #eff6ff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.12);
}

.checkout-btn {
    border-radius: 12px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
    border: none;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
}

/* ===== HIGH-FIDELITY MOBILE-APP LAYOUT & RESPONSIVE COMPACT OVERRIDES ===== */

/* Page layout bounds */
.app-main {
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 12px;
    padding-right: 12px;
}

/* Base Desktop Grid layout */
@media (min-width: 769px) {
    #cartContent {
        display: grid !important;
        grid-template-columns: 1.1fr 1fr;
        gap: 24px;
        align-items: start;
    }
    
    .sticky-bottom-bar {
        position: relative !important;
        box-shadow: 0 10px 30px rgba(99, 102, 241, 0.05) !important;
        background: #ffffff !important;
        border: 1px solid rgba(99, 102, 241, 0.08) !important;
        border-radius: 16px !important;
        margin-top: 16px !important;
        padding: 16px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        bottom: auto !important;
        z-index: 1 !important;
    }
    
    .sticky-bottom-bar .bottom-bar-info {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .bottom-price-item {
        display: flex;
        justify-content: space-between;
        width: 100%;
        border-bottom: 1px dashed #cbd5e1;
        padding-bottom: 6px;
    }
    
    .bottom-price-item:last-child {
        border-bottom: none;
    }
    
    .checkout-btn-bottom {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Floating Sticky Bottom Bar for Mobile Viewports */
@media (max-width: 768px) {
    .app-main {
        padding-bottom: 120px !important; /* Spacing for the sticky bar */
    }
    
    .sticky-bottom-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(12px) !important;
        border-top: 1px solid rgba(99, 102, 241, 0.1) !important;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08) !important;
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        z-index: 999 !important;
    }
    
    .bottom-bar-info {
        display: flex !important;
        gap: 16px !important;
    }
}

.bottom-price-item {
    display: flex;
    flex-direction: column;
}

.bottom-price-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bottom-price-value {
    font-size: 1.05rem;
    font-weight: 800;
}

.bottom-price-value.colorful-blue {
    color: #3b82f6;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 6px;
}

.bottom-price-value.colorful-pink {
    color: #ec4899;
    background: #fdf2f8;
    padding: 1px 6px;
    border-radius: 6px;
}

.checkout-btn-bottom {
    flex: 1;
    max-width: 180px;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-btn-bottom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.35);
}

/* === EXTREMELY COMPACT DESIGN FOR ALL SCREEN SIZES === */
.checkout-card {
    padding: 16px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(99, 102, 241, 0.06) !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.03) !important;
}

.checkout-card h3 {
    margin-bottom: 12px !important;
    font-size: 1.05rem !important;
    padding-bottom: 8px !important;
    font-weight: 800 !important;
}

.form-group {
    margin-bottom: 10px !important;
}

.form-group label {
    font-size: 0.78rem !important;
    margin-bottom: 4px !important;
    font-weight: 700 !important;
}

.form-control {
    padding: 10px 10px 10px 36px !important;
    font-size: 0.88rem !important;
    border-radius: 8px !important;
    border-width: 1.5px !important;
}

.input-wrapper i {
    font-size: 1.05rem !important;
    left: 12px !important;
}

.payment-option .pay-btn {
    padding: 10px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    border-width: 2px !important;
}

.payment-option .pay-btn i {
    font-size: 1.25rem !important;
}

/* Compact Cart Items */
.cart-item {
    padding: 10px !important;
    border-radius: 14px !important;
    gap: 12px !important;
    border: 1px solid rgba(99, 102, 241, 0.05) !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.02) !important;
}

.cart-item-img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
}

.cart-item-title {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
}

.cart-item-vendor {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
}

.cart-item-price {
    font-size: 0.9rem !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
}

.qty-controls {
    padding: 2px 6px !important;
    border-radius: 20px !important;
}

.qty-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.8rem !important;
}

.qty-display {
    font-size: 0.78rem !important;
    min-width: 12px !important;
}

/* Compact Order Summary */
.order-summary-card {
    padding: 14px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
    border: 1px solid rgba(99, 102, 241, 0.05) !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.02) !important;
}

.order-summary-card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
}

.summary-row {
    font-size: 0.85rem !important;
    margin-bottom: 8px !important;
}

.summary-row.total {
    margin-top: 10px !important;
    padding-top: 10px !important;
    font-size: 1.1rem !important;
}

#cartTotal {
    font-size: 1.1rem !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
}

/* Orange Warning Styles for Unselected Locations */
.bottom-price-value.colorful-orange {
    color: #d97706 !important;
    background: #fffbeb !important;
    padding: 1px 6px !important;
    border-radius: 6px !important;
    border: 1px solid #fef3c7 !important;
    font-weight: 800 !important;
}

.checkout-btn-bottom.needs-location {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.25) !important;
}

.checkout-btn-bottom.needs-location:hover {
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.35) !important;
}



