/* ==================== ROOT VARIABLES ==================== */
:root {
    --primary: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --secondary: #ff9800;
    --secondary-light: #ffb74d;
    --accent-red: #e53935;
    --accent-blue: #1976d2;
    --white: #ffffff;
    --off-white: #f5f5f5;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-400: #9e9e9e;
    --gray-600: #616161;
    --gray-800: #424242;
    --black: #212121;
    --gradient-primary: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
    --gradient-secondary: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--off-white);
    color: var(--black);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8e6c9; border-radius: 3px; }

/* ==================== NAVBAR ==================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 25px;
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #43a047);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.nav-left .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon { font-size: 1.6rem; color: var(--white); }

.site-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.page-title {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.user-avatar:hover { transform: translateY(-1px); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: none; }
.user-avatar img[src]:not([src=""]) { display: block; }
.user-avatar img[src]:not([src=""]) + i { display: none; }

/* ==================== MAIN ==================== */
.main-content {
    flex: 1;
    padding: 20px 15px 40px;
    min-height: calc(100vh - 65px);
}

.container { max-width: 1200px; margin: 0 auto; width: 100%; }

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 1px solid var(--secondary);
    border-radius: 12px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-800);
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
}

.alert-content i { color: var(--secondary); font-size: 1rem; flex-shrink: 0; }

.alert-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.alert-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3); }
.alert-btn:active { transform: scale(0.97); }

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.header-left h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.header-left h2 i { font-size: 1rem; }

.items-count { color: var(--gray-400); font-size: 0.82rem; margin-left: 28px; }

.clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    background: transparent;
    border: 2px solid var(--accent-red);
    border-radius: 12px;
    color: var(--accent-red);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.clear-btn:hover { background: var(--accent-red); color: var(--white); transform: translateY(-1px); }
.clear-btn:active { transform: scale(0.97); }

/* Cart Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

/* Cart Items */
.cart-items-container {
    background: var(--white);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    min-height: 280px;
}

.cart-items { display: flex; flex-direction: column; gap: 12px; }

/* Cart Item */
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.cart-item:hover { border-color: rgba(46, 125, 50, 0.15); }

.item-img-wrap { position: relative; width: 72px; height: 72px; }

.item-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
}

.item-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    padding: 2px 6px;
    background: var(--accent-red);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 0.3px;
}

.item-details h4 {
    font-size: 0.9rem;
    color: var(--black);
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-weight { font-size: 0.72rem; color: var(--gray-400); margin-bottom: 5px; }
.item-weight i { margin-right: 3px; font-size: 0.65rem; }

.item-prices { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-price { font-size: 1rem; font-weight: 700; color: var(--primary); }
.item-old-price { font-size: 0.78rem; color: var(--gray-400); text-decoration: line-through; }

/* Item Actions */
.item-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    padding: 3px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.qty-btn.minus { background: var(--gray-200); color: var(--gray-600); }
.qty-btn.plus { background: var(--primary); color: var(--white); }
.qty-btn:hover:not(:disabled) { transform: scale(1.08); }
.qty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qty-val { min-width: 26px; text-align: center; font-weight: 700; font-size: 0.88rem; }

.remove-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    background: transparent;
    border: 1px solid var(--accent-red);
    border-radius: 6px;
    color: var(--accent-red);
    font-size: 0.68rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover { background: var(--accent-red); color: var(--white); }

/* Item Total */
.item-total { text-align: right; }
.item-total-label { font-size: 0.65rem; color: var(--gray-400); }
.item-total-val { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }

/* Empty Cart */
.empty-cart { padding: 50px 20px; text-align: center; }

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: #f8f9fa;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i { font-size: 2rem; color: var(--gray-200); }
.empty-cart h3 { color: var(--gray-600); margin-bottom: 6px; font-size: 1.1rem; }
.empty-cart p { color: var(--gray-400); margin-bottom: 18px; font-size: 0.85rem; }

.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 16px;
    min-width: 130px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.shop-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3); }
.shop-btn:active { transform: scale(0.97); }

/* ==================== SIDEBAR ==================== */
.cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 85px;
}

.summary-card, .coupon-card, .address-card, .payment-method-card {
    background: var(--white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.summary-card h3, .coupon-card h4, .address-card h4, .payment-method-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.summary-rows { display: flex; flex-direction: column; gap: 8px; }

.summary-row { display: flex; justify-content: space-between; color: var(--gray-600); font-size: 0.85rem; }
.summary-row.discount { color: var(--primary); }

.summary-divider { height: 2px; background: var(--gradient-primary); margin: 14px 0; border-radius: 2px; }

.summary-total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 700; }
.summary-total span:last-child { color: var(--primary-dark); font-size: 1.2rem; }

.delivery-note, .savings-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.78rem;
}

.delivery-note { background: rgba(46, 125, 50, 0.06); color: var(--primary); }
.savings-note { background: rgba(255, 152, 0, 0.08); color: var(--secondary); }

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 13px 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.checkout-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3); }
.checkout-btn:active:not(:disabled) { transform: scale(0.97); }
.checkout-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--gray-400);
}

.secure-note i { color: var(--primary); font-size: 0.7rem; }

.payment-icons {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.payment-icons > span { font-size: 0.72rem; color: var(--gray-400); }

.payment-icons .icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.payment-icons .icons i { font-size: 1.2rem; color: var(--gray-400); transition: all 0.2s ease; }
.payment-icons .icons i:hover { color: var(--primary); }

/* Payment Options */
.payment-options { display: flex; flex-direction: column; gap: 10px; }
.payment-option { position: relative; cursor: pointer; }
.payment-option input { display: none; }

.option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.payment-option input:checked + .option-content {
    background: rgba(46, 125, 50, 0.04);
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(46, 125, 50, 0.08);
}

.option-icon {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--white); flex-shrink: 0;
}

.option-icon.online { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.option-icon.cod { background: linear-gradient(135deg, #ff9800, #ffb74d); }

.option-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.option-title { font-weight: 600; color: var(--black); font-size: 0.88rem; }
.option-subtitle { font-size: 0.72rem; color: var(--gray-400); }
.option-check { font-size: 1.1rem; color: var(--gray-200); transition: all 0.3s ease; flex-shrink: 0; }
.payment-option input:checked + .option-content .option-check { color: var(--primary); }

/* Inline Payment */
.payment-method-inline {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.payment-option-inline { flex: 1; cursor: pointer; }
.payment-option-inline input { display: none; }

.option-content-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--white);
    border: 2px solid #eee;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.payment-option-inline input:checked + .option-content-inline {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.payment-option-inline input:not(:checked) + .option-content-inline { color: var(--gray-600); }
.payment-option-inline input:checked + .option-content-inline i { color: var(--white); }
.payment-option-inline input:not(:checked) + .option-content-inline i { color: var(--primary); }

/* Coupon */
.coupon-input { display: flex; gap: 8px; }

.coupon-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    min-width: 0;
}

.coupon-input input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1); }

.coupon-input button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.coupon-input button:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3); }

.coupon-msg { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; }
.coupon-msg.success { background: rgba(46, 125, 50, 0.08); color: var(--primary); }
.coupon-msg.error { background: rgba(229, 57, 53, 0.08); color: var(--accent-red); }

.coupon-hints { margin-top: 10px; font-size: 0.72rem; color: var(--gray-400); }

.coupon-hints .hint {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coupon-hints .hint:hover { background: var(--primary); color: var(--white); }

/* Address Card */
.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
    gap: 8px;
}

.address-header h4 { margin: 0; padding: 0; border: none; }

.login-tag {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(255, 152, 0, 0.08);
    color: var(--secondary);
    border-radius: 50px;
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.address-body {
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}

.no-address { color: var(--gray-400); font-style: italic; text-align: center; font-size: 0.82rem; }
.saved-address { color: var(--gray-600); font-size: 0.82rem; }
.saved-address .addr-name { font-weight: 600; color: var(--black); margin-bottom: 3px; font-size: 0.88rem; }
.saved-address .addr-phone { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 5px; }
.saved-address .addr-line { line-height: 1.5; }

.address-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px dashed var(--primary);
    border-radius: 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.address-btn:hover { background: var(--primary); color: var(--white); border-style: solid; transform: translateY(-1px); }

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: 14px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    width: 34px; height: 34px; min-width: 34px;
    background: var(--off-white);
    border: none;
    border-radius: var(--radius-full);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.close-btn:hover { background: var(--accent-red); color: var(--white); }

.modal-body { padding: 22px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group { margin-bottom: 14px; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group label i { color: var(--primary); font-size: 0.78rem; flex-shrink: 0; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.phone-input {
    display: flex;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.phone-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1); }
.phone-input .code { padding: 10px 12px; background: #f8f9fa; font-weight: 600; font-size: 0.88rem; color: var(--gray-600); border-right: 2px solid var(--gray-200); white-space: nowrap; }
.phone-input input { border: none; border-radius: 0; padding-left: 12px; }
.phone-input input:focus { box-shadow: none; }

.form-actions { display: flex; gap: 10px; margin-top: 16px; }

.btn-cancel, .btn-save {
    flex: 1;
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.btn-cancel { background: var(--white); color: var(--gray-600); border: 2px solid var(--gray-200); }
.btn-cancel:hover { background: var(--off-white); border-color: var(--gray-400); transform: translateY(-1px); }
.btn-cancel:active { transform: scale(0.97); }

.btn-save { background: linear-gradient(135deg, #2e7d32, #66bb6a); color: var(--white); box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2); }
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3); }
.btn-save:active { transform: scale(0.97); }

/* Success Modal */
.success-box {
    background: var(--white);
    border-radius: 14px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.success-icon {
    width: 65px; height: 65px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    animation: pop 0.5s ease 0.2s both;
}

@keyframes pop { from { transform: scale(0); } 50% { transform: scale(1.15); } to { transform: scale(1); } }
.success-icon i { font-size: 1.8rem; color: var(--white); }
.success-box h2 { color: var(--primary); margin-bottom: 6px; font-size: 1.2rem; }
.order-id { color: var(--gray-600); margin-bottom: 6px; font-size: 0.88rem; }
.success-msg { color: var(--gray-400); margin-bottom: 16px; font-size: 0.85rem; }

.order-info { background: #f8f9fa; padding: 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid #eee; }
.info-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.82rem; }
.info-row:last-child { margin-bottom: 0; }
.info-row span:first-child { color: var(--gray-400); }
.info-row span:last-child { font-weight: 600; color: var(--black); }

.success-btns { display: flex; flex-direction: column; gap: 8px; }

.success-btns .btn-primary,
.success-btns .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.success-btns .btn-primary { background: linear-gradient(135deg, #2e7d32, #66bb6a); color: var(--white); box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2); }
.success-btns .btn-secondary { background: var(--white); color: var(--gray-600); border: 2px solid var(--gray-200); }
.success-btns .btn-primary:hover, .success-btns .btn-secondary:hover { transform: translateY(-2px); }
.success-btns .btn-primary:active, .success-btns .btn-secondary:active { transform: scale(0.97); }

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--white);
    color: var(--gray-800);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    max-width: 420px;
    width: 90%;
    border-left: 4px solid var(--primary);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--secondary); }
.toast.info { border-left-color: var(--accent-blue); }

.toast-body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.toast-body i { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .toast-body i { color: var(--primary); }
.toast.error .toast-body i { color: var(--accent-red); }
.toast.warning .toast-body i { color: var(--secondary); }
.toast.info .toast-body i { color: var(--accent-blue); }
.toast-body span { font-size: 0.85rem; font-weight: 500; }

.toast-close {
    background: none; border: none; color: #bdbdbd; cursor: pointer; padding: 4px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full); width: 24px; height: 24px; transition: all 0.2s;
}

.toast-close:hover { background: var(--off-white); color: #757575; }

/* ==================== LOADING ==================== */
.loading {
    position: fixed; inset: 0;
    background: rgba(255, 255, 255, 0.96);
    display: flex; align-items: center; justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.loading-box { text-align: center; }

.spinner {
    width: 42px; height: 42px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading-box span { color: #757575; font-size: 0.9rem; font-weight: 500; }

/* ==================== FOOTER ==================== */
.footer {
    background: var(--black); color: var(--white);
    padding: 24px 20px; text-align: center; margin-top: auto;
}

.footer-logo { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.footer-logo i { color: var(--primary-light); }
.footer-content p { color: var(--gray-400); font-size: 0.82rem; }
.footer-bottom { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-800); font-size: 0.78rem; color: var(--gray-400); }

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }

/* ==================== RESPONSIVE ==================== */
/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-sidebar { position: static; }
}

@media (max-width: 768px) {
    /* ==================== NAVBAR FIXED LAYOUT ==================== */
    .navbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    /* Row 1: Logo visible on left */
    .nav-left {
        display: flex;
        align-items: center;
    }

    .logo {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .site-name {
        font-size: 1.05rem;
    }

    .logo-icon {
        font-size: 1.3rem;
    }

    /* Nav Right - stays on same row, pushed to right */
    .nav-right {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }

    /* Nav buttons - icon + compact text */
    .nav-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 4px;
        border-radius: 8px;
    }

    .nav-btn span {
        font-size: 0.7rem;
    }

    .nav-btn i {
        font-size: 0.85rem;
    }

    /* User Avatar */
    .user-avatar {
        width: 34px;
        height: 34px;
    }

    /* Row 2: Page title - full width, centered */
    .nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-basis: 100%;
    }

    .page-title {
        font-size: 0.9rem;
    }

    .page-title i {
        font-size: 0.85rem;
    }

    /* ==================== MAIN CONTENT ==================== */
    .main-content {
        padding: 12px 10px 30px;
    }

    /* ==================== CART ITEMS ==================== */
    .cart-item {
        grid-template-columns: 65px 1fr;
        gap: 10px;
        padding: 12px;
    }

    .item-img-wrap,
    .item-img {
        width: 60px;
        height: 60px;
    }

    .item-details h4 {
        font-size: 0.85rem;
    }

    .item-weight {
        font-size: 0.7rem;
    }

    .item-price {
        font-size: 0.95rem;
    }

    .item-old-price {
        font-size: 0.72rem;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .item-total {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        border-top: 1px dashed var(--gray-200);
    }

    .item-total-label {
        font-size: 0.7rem;
    }

    .item-total-val {
        font-size: 1rem;
    }

    /* ==================== CART HEADER ==================== */
    .cart-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .header-left h2 {
        font-size: 1rem;
    }

    .header-left h2 i {
        font-size: 0.9rem;
    }

    .items-count {
        font-size: 0.75rem;
        margin-left: 24px;
    }

    .clear-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    /* ==================== FORMS ==================== */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-cancel,
    .btn-save {
        width: 100%;
    }

    /* ==================== ALERT ==================== */
    .alert-banner {
        flex-direction: column;
        text-align: center;
    }

    .alert-btn {
        width: 100%;
    }

    /* ==================== MODAL ==================== */
    .modal-overlay {
        padding: 10px;
    }

    .modal-box {
        max-width: 100%;
        max-height: 88vh;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 16px;
    }

    /* ==================== PAYMENT INLINE ==================== */
    .payment-method-inline {
        flex-direction: column;
        gap: 6px;
    }

    /* ==================== TOAST ==================== */
    .toast {
        width: 94%;
        bottom: 16px;
    }

    /* ==================== FOOTER ==================== */
    .footer {
        padding: 20px 15px;
    }

    .footer-logo {
        font-size: 1rem;
    }
}

/* ==================== SMALL MOBILE ==================== */
@media (max-width: 480px) {
    /* ==================== NAVBAR ==================== */
    .navbar {
        padding: 8px 10px;
        gap: 6px;
    }

    .site-name {
        font-size: 0.88rem;
    }

    .logo-icon {
        font-size: 1.1rem;
    }

    .nav-right {
        gap: 5px;
    }

    /* Nav buttons more compact */
    .nav-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        gap: 3px;
        border-radius: 6px;
    }

    .nav-btn span {
        font-size: 0.65rem;
    }

    .nav-btn i {
        font-size: 0.78rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .page-title {
        font-size: 0.82rem;
    }

    /* ==================== CART HEADER - STACKED ==================== */
    .cart-header {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-left h2 {
        font-size: 0.95rem;
    }

    .items-count {
        font-size: 0.72rem;
        margin-left: 22px;
    }

    .clear-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* ==================== CART ITEMS ==================== */
    .cart-items-container {
        padding: 12px;
    }

    .cart-item {
        padding: 10px;
    }

    .item-img-wrap,
    .item-img {
        width: 55px;
        height: 55px;
    }

    .item-badge {
        font-size: 0.55rem;
        padding: 1px 5px;
        top: -4px;
        left: -4px;
    }

    .item-details h4 {
        font-size: 0.8rem;
    }

    .item-weight {
        font-size: 0.68rem;
    }

    .item-price {
        font-size: 0.88rem;
    }

    .item-old-price {
        font-size: 0.68rem;
    }

    .item-total-val {
        font-size: 0.95rem;
    }

    /* Quantity controls */
    .qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .qty-val {
        font-size: 0.82rem;
        min-width: 22px;
    }

    .remove-btn {
        padding: 4px 7px;
        font-size: 0.65rem;
    }

    /* ==================== SIDEBAR CARDS ==================== */
    .summary-card,
    .coupon-card,
    .address-card,
    .payment-method-card {
        padding: 14px;
    }

    .summary-card h3,
    .coupon-card h4,
    .address-card h4,
    .payment-method-card h4 {
        font-size: 0.92rem;
    }

    .summary-row {
        font-size: 0.8rem;
    }

    .summary-total {
        font-size: 0.95rem;
    }

    .summary-total span:last-child {
        font-size: 1.1rem;
    }

    .delivery-note,
    .savings-note {
        font-size: 0.72rem;
        padding: 7px 10px;
    }

    /* ==================== COUPON INPUT - STACKED ==================== */
    .coupon-input {
        flex-direction: column;
    }

    .coupon-input input {
        font-size: 0.82rem;
        padding: 9px 12px;
    }

    .coupon-input button {
        width: 100%;
        padding: 10px;
        font-size: 0.8rem;
    }

    .coupon-msg {
        font-size: 0.72rem;
    }

    .coupon-hints {
        font-size: 0.68rem;
    }

    /* ==================== ADDRESS HEADER - STACKED ==================== */
    .address-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .login-tag {
        font-size: 0.58rem;
    }

    .address-body {
        padding: 8px 10px;
    }

    .no-address,
    .saved-address {
        font-size: 0.78rem;
    }

    .saved-address .addr-name {
        font-size: 0.82rem;
    }

    .saved-address .addr-phone {
        font-size: 0.72rem;
    }

    .address-btn {
        padding: 9px;
        font-size: 0.78rem;
    }

    /* ==================== PAYMENT OPTIONS ==================== */
    .option-content {
        padding: 10px;
        gap: 8px;
    }

    .option-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.9rem;
    }

    .option-title {
        font-size: 0.82rem;
    }

    .option-subtitle {
        font-size: 0.68rem;
    }

    .option-check {
        font-size: 1rem;
    }

    /* ==================== BUTTONS ==================== */
    .checkout-btn,
    .shop-btn {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .btn-cancel,
    .btn-save {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .alert-btn {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    /* ==================== EMPTY CART ==================== */
    .empty-cart {
        padding: 40px 15px;
    }

    .empty-icon {
        width: 70px;
        height: 70px;
    }

    .empty-icon i {
        font-size: 1.8rem;
    }

    .empty-cart h3 {
        font-size: 1rem;
    }

    .empty-cart p {
        font-size: 0.8rem;
    }

    /* ==================== SUCCESS MODAL ==================== */
    .success-box {
        padding: 24px 16px;
    }

    .success-icon {
        width: 55px;
        height: 55px;
    }

    .success-icon i {
        font-size: 1.5rem;
    }

    .success-box h2 {
        font-size: 1.05rem;
    }

    .order-id {
        font-size: 0.82rem;
    }

    .success-msg {
        font-size: 0.8rem;
    }

    .info-row {
        font-size: 0.78rem;
    }

    .success-btns .btn-primary,
    .success-btns .btn-secondary {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    /* ==================== FOOTER ==================== */
    .footer {
        padding: 18px 12px;
    }

    .footer-logo {
        font-size: 0.95rem;
    }

    .footer-content p {
        font-size: 0.78rem;
    }

    .footer-bottom {
        font-size: 0.72rem;
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* ==================== VERY SMALL MOBILE ==================== */
@media (max-width: 340px) {
    /* ==================== NAVBAR ==================== */
    .navbar {
        padding: 6px 8px;
        gap: 5px;
    }

    .site-name {
        font-size: 0.78rem;
    }

    .logo-icon {
        font-size: 1rem;
    }

    .nav-right {
        gap: 4px;
    }

    /* Only hide nav button text at extreme small screens */
    .nav-btn span {
        display: none;
    }

    .nav-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        justify-content: center;
        border-radius: var(--radius-full);
        font-size: 0.75rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .page-title {
        font-size: 0.75rem;
    }

    .page-title i {
        font-size: 0.7rem;
    }

    /* ==================== CART HEADER ==================== */
    .cart-header {
        padding: 10px 12px;
    }

    .header-left h2 {
        font-size: 0.88rem;
    }

    .items-count {
        font-size: 0.68rem;
        margin-left: 20px;
    }

    /* ==================== CART ITEMS ==================== */
    .cart-items-container {
        padding: 10px;
    }

    .cart-item {
        padding: 8px;
        gap: 8px;
    }

    .item-img-wrap,
    .item-img {
        width: 50px;
        height: 50px;
    }

    .item-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    .item-details h4 {
        font-size: 0.75rem;
    }

    .item-weight {
        font-size: 0.62rem;
    }

    .item-price {
        font-size: 0.82rem;
    }

    .item-old-price {
        font-size: 0.62rem;
    }

    .item-total-val {
        font-size: 0.88rem;
    }

    .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .qty-val {
        font-size: 0.75rem;
        min-width: 20px;
    }

    .quantity-controls {
        padding: 2px;
        border-radius: 8px;
    }

    .remove-btn {
        padding: 3px 6px;
        font-size: 0.6rem;
    }

    /* ==================== SIDEBAR CARDS ==================== */
    .summary-card,
    .coupon-card,
    .address-card,
    .payment-method-card {
        padding: 12px;
        border-radius: 12px;
    }

    .summary-card h3,
    .coupon-card h4,
    .address-card h4,
    .payment-method-card h4 {
        font-size: 0.85rem;
        gap: 6px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .summary-row {
        font-size: 0.75rem;
    }

    .summary-total {
        font-size: 0.88rem;
    }

    .summary-total span:last-child {
        font-size: 1rem;
    }

    .summary-divider {
        margin: 10px 0;
    }

    .delivery-note,
    .savings-note {
        font-size: 0.68rem;
        padding: 6px 8px;
        border-radius: 8px;
    }

    /* ==================== COUPON ==================== */
    .coupon-input input {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .coupon-input button {
        padding: 8px;
        font-size: 0.75rem;
    }

    /* ==================== ADDRESS ==================== */
    .address-body {
        padding: 7px 9px;
        border-radius: 8px;
    }

    .no-address,
    .saved-address {
        font-size: 0.72rem;
    }

    .saved-address .addr-name {
        font-size: 0.78rem;
    }

    .address-btn {
        padding: 8px;
        font-size: 0.72rem;
        border-radius: 10px;
    }

    /* ==================== PAYMENT OPTIONS ==================== */
    .option-content {
        padding: 8px;
        gap: 6px;
        border-radius: 10px;
    }

    .option-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 8px;
        font-size: 0.82rem;
    }

    .option-title {
        font-size: 0.75rem;
    }

    .option-subtitle {
        font-size: 0.62rem;
    }

    /* ==================== BUTTONS ==================== */
    .checkout-btn,
    .shop-btn,
    .btn-cancel,
    .btn-save,
    .alert-btn,
    .clear-btn {
        padding: 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    .secure-note {
        font-size: 0.65rem;
        margin-top: 8px;
    }

    .payment-icons .icons i {
        font-size: 1rem;
    }

    /* ==================== EMPTY CART ==================== */
    .empty-cart {
        padding: 30px 12px;
    }

    .empty-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 14px;
    }

    .empty-icon i {
        font-size: 1.5rem;
    }

    .empty-cart h3 {
        font-size: 0.92rem;
    }

    .empty-cart p {
        font-size: 0.75rem;
        margin-bottom: 14px;
    }

    /* ==================== MODAL ==================== */
    .modal-header {
        padding: 12px 14px;
    }

    .modal-header h2 {
        font-size: 0.92rem;
    }

    .close-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .modal-body {
        padding: 14px;
    }

    .form-group label {
        font-size: 0.75rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .phone-input .code {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    /* ==================== SUCCESS MODAL ==================== */
    .success-box {
        padding: 20px 14px;
        border-radius: 12px;
    }

    .success-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 14px;
    }

    .success-icon i {
        font-size: 1.3rem;
    }

    .success-box h2 {
        font-size: 0.95rem;
    }

    .order-id {
        font-size: 0.78rem;
    }

    .success-msg {
        font-size: 0.75rem;
        margin-bottom: 14px;
    }

    .order-info {
        padding: 10px;
        border-radius: 10px;
    }

    .info-row {
        font-size: 0.72rem;
    }

    .success-btns {
        gap: 6px;
    }

    .success-btns .btn-primary,
    .success-btns .btn-secondary {
        padding: 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    /* ==================== TOAST ==================== */
    .toast {
        width: 92%;
        bottom: 12px;
        padding: 10px 14px;
        border-radius: 10px;
    }

    .toast-body span {
        font-size: 0.78rem;
    }

    .toast-body i {
        font-size: 0.95rem;
    }

    /* ==================== FOOTER ==================== */
    .footer {
        padding: 14px 10px;
    }

    .footer-logo {
        font-size: 0.85rem;
        gap: 6px;
    }

    .footer-logo i {
        font-size: 1rem;
    }

    .footer-content p {
        font-size: 0.72rem;
    }

    .footer-bottom {
        font-size: 0.65rem;
        margin-top: 10px;
        padding-top: 10px;
    }
}

/* ==================== PRINT ==================== */
@media print {
    .navbar,
    .footer,
    .toast,
    .loading,
    .modal-overlay,
    .cart-sidebar,
    .clear-btn,
    .item-actions,
    .alert-banner {
        display: none !important;
    }

    body {
        background: var(--white);
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-items-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .cart-item {
        break-inside: avoid;
    }
}


/* ==================== STORE CLOSED MESSAGE IN CART ==================== */
.store-closed-cart-message {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    animation: fadeInMsg 0.3s ease;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.closed-msg-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.closed-msg-icon {
    font-size: 1.8rem;
    animation: moonPulse 2s infinite;
}

@keyframes moonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.closed-msg-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.closed-msg-text strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.closed-msg-text span {
    font-size: 0.85rem;
    color: #ffd700;
}

/* Disabled checkout button when store closed */
.checkout-btn.store-closed-btn,
.checkout-btn:disabled {
    background: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}