:root {
    --primary-green: #10B981;
    --primary-orange: #F97316;
    --dark: #1F2937;
    --gray: #6B7280;
    --light-gray: #F3F4F6;
    --white: #FFFFFF;
    --success: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #FAFAFA;
    color: var(--dark);
    overflow: hidden;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body.theme-transitioning,
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, fill 0.25s ease !important;
}

#pageWrapper {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

* {
    -webkit-tap-highlight-color: transparent;
}

/* Loading Spinner */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--gray);
    font-weight: 600;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container.hidden {
    display: none;
}

/* Header */
.header {
    background: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 500;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    cursor: pointer;
}

.logo-icon {
    display: none;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: -2px;
}

.cart-btn {
    position: relative;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cart-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.profile-btn {
    background: var(--primary-green);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    letter-spacing: 0;
}
.profile-btn.logged-out {
    background: var(--light-gray);
    font-size: 1.3rem;
}

.profile-btn:hover {
    opacity: 0.85;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mini Cart Toast - bottom of screen */
.mini-cart-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 999;
    transition: bottom 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mini-cart-toast.show {
    bottom: 30px;
}

/* Success Toast */
.success-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: top 0.4s ease;
}

.success-toast.show {
    top: 30px;
}

.success-toast-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.success-toast-text {
    display: flex;
    flex-direction: column;
}

.success-toast-text strong {
    font-size: 1.1rem;
    color: var(--dark);
}

.success-toast-text span {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Map container */
.map-container {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
    border: 2px solid var(--primary-green);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Google Sign In Button */
.google-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.google-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.google-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Email/Phone toggle button — light and dark mode */
#emailAuthBtn {
    background: #F3F4F6 !important;
    border: 1px solid #D1D5DB !important;
    color: #374151 !important;
}
#emailAuthBtn:hover {
    background: #E5E7EB !important;
}
body.dark-mode #emailAuthBtn {
    background: #374151 !important;
    border-color: #4B5563 !important;
    color: #F3F4F6 !important;
}
body.dark-mode #emailAuthBtn:hover {
    background: #4B5563 !important;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

.login-divider span {
    padding: 0 1rem;
}

/* New Login Card Styles */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: modalSlideUp 0.3s ease;
    margin: auto 0;
    flex-shrink: 0;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-lang-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-lang-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: #F3F4F6;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: all 0.2s;
}

.login-lang-btn:hover {
    border-color: var(--primary-green);
    transform: scale(1.1);
}

.login-lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

.login-tabs {
    display: flex;
    background: #F3F4F6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.5rem;
}

.login-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
}

.login-tab.active {
    background: white;
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.login-input-group {
    margin-bottom: 1rem;
}

.login-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.login-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.login-label-row a {
    font-size: 0.8rem;
    color: var(--primary-green);
    text-decoration: none;
}

.login-label-row a:hover {
    text-decoration: underline;
}

.login-input-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    background: #FFFFFF;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input-group input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.login-input-group input::placeholder {
    color: #9CA3AF;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.pw-req {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #9CA3AF;
    transition: color 0.2s;
}

.pw-req.met {
    color: #374151;
}

.pw-req-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    flex-shrink: 0;
    transition: all 0.2s;
    background: white;
}

.pw-req.met .pw-req-icon {
    background: var(--primary-green);
    border-color: var(--primary-green);
    font-size: 0.65rem;
    color: white;
}

.login-submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.login-submit-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    color: var(--gray);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.login-close-btn:hover {
    background: #E5E7EB;
    color: var(--dark);
}

/* Auth Toast Notification */
.auth-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    transition: transform 0.3s ease;
    max-width: 90%;
}

.auth-toast.show {
    transform: translateX(-50%) translateY(0);
}

.auth-toast.success .toast-icon {
    background: #10B981;
    color: white;
}

.auth-toast.error .toast-icon {
    background: #EF4444;
    color: white;
}

.auth-toast.info .toast-icon {
    background: #3B82F6;
    color: white;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-msg {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 500;
}

.location-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--primary-green);
    background: var(--primary-green);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.location-btn:hover {
    background: #059669;
}

.location-btn.secondary {
    background: white;
    color: var(--dark);
    border-color: #E5E7EB;
}

.location-btn.secondary:hover {
    background: #F3F4F6;
}

.location-display {
    background: #ECFDF5;
    border: 1px solid var(--primary-green);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #065F46;
    font-size: 0.9rem;
}

/* ===== Saved Locations ===== */
.saved-locations-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; max-height: 260px; overflow-y: auto; }
/* Checkout radio cards */
.saved-loc-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border: 2px solid #E5E7EB; border-radius: 12px; cursor: pointer; transition: all 0.2s; background: var(--white); }
.saved-loc-card:hover { border-color: var(--primary-green); background: #F0FDF4; }
.saved-loc-card.selected { border-color: var(--primary-green); background: #ECFDF5; }
.saved-loc-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #D1D5DB; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.saved-loc-card.selected .saved-loc-radio { border-color: var(--primary-green); background: var(--primary-green); }
.saved-loc-card.selected .saved-loc-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: white; }
.saved-loc-info { flex: 1; min-width: 0; }
.saved-loc-label { font-weight: 600; font-size: 0.95rem; color: var(--dark); }
.saved-loc-default { font-size: 0.7rem; background: var(--primary-green); color: white; padding: 1px 6px; border-radius: 4px; margin-left: 0.3rem; vertical-align: middle; }
.saved-loc-coords { font-size: 0.78rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-location-btn { width: 100%; padding: 0.75rem; border: 2px dashed #D1D5DB; background: none; border-radius: 12px; font-size: 0.9rem; font-weight: 500; color: var(--gray); cursor: pointer; transition: all 0.2s; }
.add-location-btn:hover { border-color: var(--primary-green); color: var(--primary-green); }
.loc-save-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
.loc-save-row input[type="text"] { flex: 1; padding: 0.6rem 0.75rem; border: 1px solid #E5E7EB; border-radius: 8px; font-size: 0.9rem; }
.loc-save-row label { font-size: 0.8rem; color: var(--gray); display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.loc-save-btn { padding: 0.6rem 1rem; background: var(--primary-green); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.85rem; }
/* ===== Locations Modal (separate from profile) ===== */
.locations-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10001; display: none; background: var(--light-gray); }
.locations-modal.show { display: flex; flex-direction: column; }
.locations-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--white); border-bottom: 1px solid #E5E7EB; }
.locations-modal-header h2 { font-size: 1.15rem; margin: 0; }
.locations-modal-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.loc-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; background: var(--white); border-radius: 14px; margin-bottom: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.loc-card-map { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #E5E7EB; }
.loc-card-map img { width: 100%; height: 100%; object-fit: cover; }

/* Location pin SVG icon */
.pin-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }
.pin-icon svg { width: 100%; height: 100%; }
.loc-card-info { flex: 1; min-width: 0; }
.loc-card-name { font-weight: 600; font-size: 0.95rem; color: var(--dark); }
.loc-card-name .saved-loc-default { vertical-align: middle; }
.loc-card-sub { font-size: 0.78rem; color: var(--gray); margin-top: 2px; }
.loc-card-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.loc-card-action { width: 38px; height: 38px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: all 0.15s; }
.loc-card-edit { background: #F0FDF4; color: var(--primary-green); }
.loc-card-edit:hover { background: #DCFCE7; }
.loc-card-delete { background: #FEF2F2; color: #EF4444; }
.loc-card-delete:hover { background: #FEE2E2; }
.loc-add-link { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--primary-green); font-weight: 600; font-size: 0.95rem; text-decoration: underline; cursor: pointer; padding: 0.5rem 0; background: none; border: none; }
.loc-add-link:hover { color: #059669; }
/* Edit Location Modal */
.edit-loc-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10002; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; padding: 1rem; }
.edit-loc-overlay.show { display: flex; }
.edit-loc-card { background: var(--white); border-radius: 16px; padding: 1.5rem; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; }
.edit-loc-card h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.edit-loc-map { width: 100%; height: 220px; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.edit-loc-map iframe { width: 100%; height: 100%; border: none; }
.edit-loc-input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid #E5E7EB; border-radius: 10px; font-size: 0.95rem; margin-bottom: 1rem; box-sizing: border-box; }
.edit-loc-input:focus { border-color: var(--primary-green); outline: none; }
.edit-loc-save { width: 100%; padding: 0.85rem; background: var(--primary-green); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.edit-loc-save:hover { background: #059669; }
/* Checkout delivery address section */
.checkout-delivery-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; cursor: pointer; border-radius: 12px; background: var(--white); border: 1px solid #E5E7EB; margin-bottom: 0.75rem; }
.checkout-delivery-icon { font-size: 1.3rem; }
.checkout-delivery-info { flex: 1; }
.checkout-delivery-title { font-weight: 600; font-size: 0.95rem; color: var(--dark); }
.checkout-delivery-selected { font-size: 0.85rem; color: var(--primary-green); font-weight: 500; }
.checkout-delivery-arrow { font-size: 1rem; color: var(--gray); transition: transform 0.2s; }
.checkout-delivery-arrow.open { transform: rotate(180deg); }
.checkout-delivery-list { display: none; margin-bottom: 0.75rem; }
.checkout-delivery-list.open { display: block; }
/* Dark mode */
body.dark-mode .saved-loc-card { background: #1F2937; border-color: #374151; }
body.dark-mode .saved-loc-card:hover { border-color: var(--primary-green); background: #1a3a2a; }
body.dark-mode .saved-loc-card.selected { background: #1a3a2a; border-color: var(--primary-green); }
body.dark-mode .saved-loc-label, body.dark-mode .loc-card-name { color: #F3F4F6; }
body.dark-mode .saved-loc-coords, body.dark-mode .loc-card-sub { color: #9CA3AF; }
body.dark-mode .add-location-btn { border-color: #4B5563; color: #9CA3AF; }
body.dark-mode .add-location-btn:hover { border-color: var(--primary-green); color: var(--primary-green); }
body.dark-mode .loc-save-row input[type="text"] { background: #374151; border-color: #4B5563; color: #F3F4F6; }
body.dark-mode .loc-card { background: #1F2937; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
body.dark-mode .locations-modal { background: #111827; }
body.dark-mode .locations-modal-header { background: #1F2937; border-color: #374151; }
body.dark-mode .edit-loc-card { background: #1F2937; }
body.dark-mode .edit-loc-input { background: #374151; border-color: #4B5563; color: #F3F4F6; }
body.dark-mode .checkout-delivery-header { background: #1F2937; border-color: #374151; }
body.dark-mode .checkout-delivery-title { color: #F3F4F6; }
body.dark-mode .loc-add-link { color: var(--primary-green); }

/* Leaflet Map Picker */
.map-picker-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10003; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; padding: 1rem; }
.map-picker-overlay.show { display: flex; }
.map-picker-card { background: var(--white); border-radius: 16px; width: 100%; max-width: 450px; overflow: hidden; }
.map-picker-card h3 { padding: 1rem 1.25rem 0.5rem; margin: 0; font-size: 1.05rem; }
.map-picker-map { width: 100%; height: 300px; }
.map-picker-hint { text-align: center; padding: 0.5rem; font-size: 0.8rem; color: var(--gray); }
.map-picker-actions { padding: 0.75rem 1.25rem 1rem; display: flex; gap: 0.75rem; }
.map-picker-actions button { flex: 1; padding: 0.75rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none; }
.map-picker-cancel { background: #F3F4F6; color: var(--dark); }
.map-picker-confirm { background: var(--primary-green); color: white; }
body.dark-mode .map-picker-card { background: #1F2937; }
body.dark-mode .map-picker-card h3 { color: #F3F4F6; }
body.dark-mode .map-picker-cancel { background: #374151; color: #F3F4F6; }
body.dark-mode .map-picker-hint { color: #9CA3AF; }

.cart-count {
    background: var(--primary-orange);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.language-switcher {
    position: relative;
    z-index: 1000;
    direction: ltr;
}

.lang-current-btn {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.lang-current-btn:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.lang-menu {
    position: absolute;
    top: 55px;
    left: 0;
    right: auto;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 150px;
    z-index: 1001;
}

.lang-menu.show {
    display: block;
}

.lang-option {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1rem;
    border-radius: 8px;
    text-align: left;
}

.lang-option:hover {
    background: #ECFDF5;
}

.lang-option .flag-img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #E5E7EB;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    padding: 2rem 2rem;
    text-align: center;
    position: relative;
    z-index: 0;
}

.hero h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-illustration {
    max-width: 720px;
    width: 90%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    animation: none;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Search Bar */
.search-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 73px;
    z-index: 499;
    background: #FAFAFA;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 50px;
    padding: 0 1.25rem;
    height: 48px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.search-bar:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: #9CA3AF;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .search-icon {
    margin-right: 0;
    margin-left: 0.75rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    color: #1F2937;
    background: transparent;
    height: 100%;
    padding: 0 0.5rem;
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-clear {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #374151;
}

.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
    grid-column: 1 / -1;
}

.search-no-results-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.search-no-results-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Category Tabs */
.categories {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    gap: 1.2rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 138px;
    left: 0;
    right: 0;
    background: #FAFAFA;
    z-index: 498;
    border-bottom: 1px solid #E5E7EB;
}

.categories::-webkit-scrollbar { display: none; }

.category-btn {
    background: var(--white);
    border: 2px solid #E5E7EB;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Products Grid */
.products-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding-bottom: 6rem;
    position: relative;
    z-index: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton Loading */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.skeleton-img {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, var(--light-gray) 25%, #e5e7eb 50%, var(--light-gray) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-text {
    height: 14px;
    border-radius: 7px;
    margin: 0.75rem 1rem;
    background: linear-gradient(90deg, var(--light-gray) 25%, #e5e7eb 50%, var(--light-gray) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-text.short { width: 50%; }
.skeleton-text.medium { width: 70%; }
.skeleton-btn {
    height: 40px;
    border-radius: 12px;
    margin: 0.75rem 1rem 1rem;
    background: linear-gradient(90deg, var(--light-gray) 25%, #e5e7eb 50%, var(--light-gray) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
}
body.dark-mode .skeleton-card { background: #1F2937; }
body.dark-mode .skeleton-img,
body.dark-mode .skeleton-text,
body.dark-mode .skeleton-btn {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
}

.product-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    contain: layout style;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    padding: 0.5rem;
    content-visibility: auto;
}

.product-card:hover .product-image img {
    transform: none;
}

.fresh-badge {
    display: none;
}

.out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #EF4444;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
}

.product-card.out-of-stock .product-image {
    opacity: 0.5;
}

.product-card.out-of-stock .add-to-cart {
    background: #9CA3AF;
    cursor: not-allowed;
}

.product-card.out-of-stock .add-to-cart:hover {
    transform: none;
    background: #9CA3AF;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.product-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
}

.add-to-cart {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.add-to-cart:active {
    transform: translateY(0);
}

.product-quantity-selector {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border-radius: 12px;
    padding: 0.9rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.product-qty-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-qty-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.product-qty-display {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.product-trash-btn {
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-trash-btn:hover {
    background: #DC2626;
}

.product-trash-btn {
    background: #DC2626;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-trash-btn:hover {
    background: #B91C1C;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.4s ease;
    z-index: 2500;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 2rem;
    border-bottom: 2px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
}

.cart-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-cart {
    background: var(--light-gray);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: #E5E7EB;
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 12px;
    margin-bottom: 1rem;
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    color: var(--primary-green);
    font-weight: 700;
    font-size: 1.1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.qty-btn {
    background: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
}

.qty-btn:hover {
    background: var(--primary-green);
    color: white;
}

.qty-value {
    font-weight: 600;
    font-size: 1rem;
    min-width: 40px;
    text-align: center;
}

.remove-item {
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #FCA5A5;
    transform: scale(1.1);
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.cart-footer {
    padding: 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    border-top: 2px solid var(--light-gray);
    background: #FAFAFA;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.checkout-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.checkout-btn:active {
    transform: translateY(0);
}

.checkout-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.9;
}

.checkout-btn:disabled:hover {
    background: #9CA3AF;
    transform: none;
    box-shadow: none;
}


/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 2499;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Phone Login Modal */
.phone-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.phone-modal.show {
    display: flex;
}

.phone-modal-card {
    background: white;
    padding: 1.75rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: modalSlideIn 0.4s ease;
    box-sizing: border-box;
    margin: auto 0;
    flex-shrink: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phone-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.phone-modal h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.phone-modal p {
    color: var(--gray);
    margin-bottom: 1rem;
}

.phone-modal .subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.phone-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    direction: ltr;
}

.country-code {
    background: var(--light-gray);
    border: 2px solid #E5E7EB;
    padding: 0.85rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--dark);
    min-width: 65px;
    text-align: center;
    font-size: 16px;
}

.phone-input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.phone-input:focus {
    border-color: var(--primary-green);
}

.otp-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
    margin-bottom: 1rem;
    outline: none;
}

.otp-input:focus {
    border-color: var(--primary-green);
}

.modal-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #059669;
}

.modal-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.back-btn {
    background: transparent;
    color: var(--gray);
    margin-top: 0.5rem;
}

.back-btn:hover {
    background: var(--light-gray);
    color: var(--dark);
}

/* ==================== MY ORDERS MODAL ==================== */
.orders-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
}

.orders-modal.show {
    display: flex;
}

.orders-modal-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s ease;
}

.orders-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.orders-modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    margin: 0;
}

.orders-close-btn {
    background: #F3F4F6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.order-card {
    background: #F9FAFB;
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #E5E7EB;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    direction: ltr;
}

.order-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
    direction: ltr;
    unicode-bidi: plaintext;
}

.order-date {
    font-size: 0.7rem;
    color: var(--gray);
    direction: ltr;
    unicode-bidi: plaintext;
}

.order-total {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-green);
    text-align: end;
}

/* Progress Tracker */
.order-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 0.75rem 0;
    padding: 0 12px;
}

.order-progress-track {
    position: absolute;
    top: 12px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: #E5E7EB;
    z-index: 1;
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-green);
    transition: width 0.5s ease;
}

/* RTL Support */
[dir="rtl"] .progress-line {
    left: auto;
    right: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.progress-step:first-child {
    align-items: flex-start;
}

.progress-step:last-child {
    align-items: flex-end;
}

.progress-step.canceled-single {
    align-items: center;
    flex: 1;
}

.step-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.55rem;
    color: var(--gray);
    text-align: center;
    max-width: 55px;
}

/* Active & Completed States */
.progress-step.completed .step-icon {
    background: var(--primary-green);
    color: white;
    animation: stepPop 0.4s ease;
}

.progress-step.active .step-icon {
    background: var(--primary-green);
    color: white;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: stepPulse 1.5s ease infinite;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--primary-green);
    font-weight: 600;
}

/* Canceled State */
.progress-step.canceled .step-icon {
    background: #EF4444;
    color: white;
}

.progress-step.canceled .step-label {
    color: #EF4444;
    font-weight: 600;
}

@keyframes stepPop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1); }
}

/* Order Items List - Collapsible */
.order-details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
    background: #F9FAFB;
    border: 1px dashed #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--gray);
    transition: all 0.2s ease;
    flex: 1;
}

.order-actions-row {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.order-details-toggle:hover {
    background: #F3F4F6;
    color: var(--dark);
}

.order-details-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.order-details-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.order-items-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.order-items-list.open {
    max-height: 500px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #E5E7EB;
}

.order-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F3F4F6;
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-item-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

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

.order-item-details {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-qty {
    font-size: 0.75rem;
    color: var(--gray);
}

.order-item-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-green);
    white-space: nowrap;
}

/* Re-order Button */
.reorder-btn {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-green), #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.reorder-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.reorder-btn:active {
    transform: translateY(0);
}

.no-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.no-orders-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-orders-illustration {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    opacity: 0.6;
}

.no-orders p {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.no-orders small {
    font-size: 0.85rem;
    color: var(--gray);
}

body.dark-mode .no-orders p { color: #E5E7EB; }

.empty-loc {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray);
}

.empty-loc-illustration {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    opacity: 0.5;
}

.empty-loc p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.checkout-modal.show {
    display: flex;
}

.checkout-modal-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    animation: modalSlideIn 0.4s ease;
    margin: auto 0;
    flex-shrink: 0;
}

.checkout-modal h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.form-input:focus {
    border-color: var(--primary-green);
}

.form-input:disabled {
    opacity: 1;
    -webkit-text-fill-color: #1F2937;
    color: #1F2937;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

/* Error Message */
.error-message {
    background: #FEE2E2;
    color: #DC2626;
    padding: 1rem 2rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

/* RTL Support for Arabic and Kurdish */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

[dir="rtl"] .cart-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .categories {
    direction: rtl;
}

[dir="rtl"] .product-info {
    text-align: right;
}

[dir="rtl"] .product-quantity-selector {
    flex-direction: row-reverse;
}

[dir="rtl"] .cart-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .cart-item-details {
    text-align: right;
}

[dir="rtl"] .cart-item-controls {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        position: relative;
    }

    .logo {
        gap: 0;
    }

    [dir="rtl"] .logo {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .logo-text h1 {
        font-size: 1.15rem;
        text-align: center;
    }

    .logo-text p {
        display: none;
    }

    .lang-current-btn {
        width: 38px;
        height: 38px;
    }

    .current-flag-img {
        width: 100%;
        height: 100%;
    }

    .lang-option {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .lang-option .flag-img {
        width: 24px;
        height: 18px;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .dark-mode-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .hero {
        padding: 1rem 1rem;
    }

    .hero h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .hero-illustration {
        max-width: 80%;
        max-height: 120px;
        margin-top: 0;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-image {
        height: 140px;
    }

    .out-of-stock-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .product-name {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .product-card:hover .product-image img {
        transform: none;
    }

    .search-bar-container {
        padding: 0.5rem 1rem;
        top: 58px;
    }

    .search-bar {
        height: 42px;
        padding: 0 1rem;
    }

    .search-input {
        font-size: 16px;
    }

    .categories {
        padding: 0.75rem 1rem;
        top: 110px;
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: center;
    }

    .category-btn {
        padding: 0.6rem 1rem;
        font-size: 0.82rem;
        min-width: 0;
        flex-shrink: 1;
    }

    .products-container {
        padding: 1rem;
        padding-bottom: 7rem;
    }

    .profile-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        margin-right: 0;
    }

    .floating-cart-bar {
        width: calc(100% - 1.5rem);
    }
}

@media (max-width: 380px) {
    .category-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-image {
        height: 120px;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .product-price {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .add-to-cart {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .product-quantity-selector {
        padding: 0.6rem 0.5rem;
        gap: 0.5rem;
    }

    .product-qty-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .product-qty-display {
        font-size: 1rem;
    }
}

/* Animation delays for staggered entrance */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }
.product-card:nth-child(7) { animation-delay: 0.4s; }
.product-card:nth-child(8) { animation-delay: 0.45s; }

/* ==================== FLOATING CART BAR (Lezzoo-style) ==================== */
.floating-cart-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 500px;
    background: var(--primary-green);
    color: white;
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 500;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4), 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

.floating-cart-bar.visible {
    bottom: calc(1rem + env(safe-area-inset-bottom));
}
.floating-cart-bar.above-modal {
    z-index: 2001;
}

.floating-cart-bar:active {
    transform: translateX(-50%) scale(0.98);
}

.floating-cart-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-cart-badge {
    background: white;
    color: var(--primary-green);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.floating-cart-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.floating-cart-items-text {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 500;
}

.floating-cart-total {
    font-size: 1.05rem;
    font-weight: 700;
}

.floating-cart-btn {
    background: white;
    color: var(--primary-green);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

/* ==================== PROFILE SLIDE PANEL ==================== */
.profile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
}

.profile-panel-overlay.show {
    opacity: 1;
    visibility: visible;
    touch-action: none;
    overscroll-behavior: none;
}

.profile-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: white;
    z-index: 1200;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    overscroll-behavior: contain;
}

[dir="rtl"] .profile-panel {
    left: auto;
    right: -320px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.profile-panel.open {
    left: 0;
}

[dir="rtl"] .profile-panel.open {
    left: auto;
    right: 0;
}

.profile-panel-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-panel-user {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-panel-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-panel-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark);
}

.profile-panel-email {
    font-size: 0.8rem;
    color: var(--gray);
    word-break: break-all;
    text-decoration: none;
}

.profile-panel-phone {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.15rem;
    text-decoration: none;
}

.profile-panel-email a,
.profile-panel-phone a {
    color: inherit;
    text-decoration: none !important;
    pointer-events: none;
}

.profile-panel-close {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    flex-shrink: 0;
}

.profile-panel-menu {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.profile-panel-item {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

[dir="rtl"] .profile-panel-item {
    text-align: right;
    flex-direction: row;
    direction: rtl;
}

[dir="rtl"] .profile-panel-header {
    direction: rtl;
}

[dir="rtl"] .profile-panel-user {
    align-items: flex-end;
    text-align: right;
}

[dir="rtl"] .profile-panel-logout {
    flex-direction: row-reverse;
}

.profile-panel-item:hover {
    background: #F3F4F6;
}

.profile-panel-item:active {
    background: #E5E7EB;
}

.profile-panel-item-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.orders-badge {
    background: #10B981;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-inline-start: 6px;
}

.profile-panel-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0.5rem 1.5rem;
}

.profile-panel-footer {
    padding: 1rem 1.5rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid #E5E7EB;
}

.profile-panel-logout {
    width: 100%;
    background: none;
    border: 1px solid #EF4444;
    padding: 0.75rem;
    border-radius: 10px;
    color: #EF4444;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.profile-panel-logout:hover {
    background: #FEF2F2;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(37, 211, 102, 0.4);
    z-index: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: whatsappPulse 2s ease-out infinite;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(37, 211, 102, 0.15);
}
.whatsapp-float svg {
    width: 30px;
    height: 30px;
    fill: white;
}
[dir="rtl"] .whatsapp-float {
    left: auto;
    right: 20px;
}
@keyframes whatsappPulse {
    0% { box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 0 rgba(37,211,102,0.4); }
    70% { box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 12px rgba(37,211,102,0); }
    100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 0 rgba(37,211,102,0); }
}

/* WhatsApp brighter glow in dark mode */
body.dark-mode .whatsapp-float {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(37,211,102,0.6);
}
body.dark-mode .whatsapp-float:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 8px rgba(37,211,102,0.25);
}
@keyframes whatsappPulseDark {
    0%  { box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(37,211,102,0.6); }
    70% { box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 14px rgba(37,211,102,0); }
    100%{ box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(37,211,102,0); }
}
body.dark-mode .whatsapp-float {
    animation: whatsappPulseDark 2s ease-out infinite;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: #F3F4F6;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* ==================== DARK MODE ==================== */
body.dark-mode {
    --dark: #F3F4F6;
    --gray: #9CA3AF;
    --light-gray: #374151;
    --white: #1F2937;
    --success: #10B981;
    background: #111827;
    color: #F3F4F6;
}
body.dark-mode #pageWrapper { background: #111827; }

/* Header */
body.dark-mode .header {
    background: #1F2937;
    border-bottom: 1px solid #374151;
}
body.dark-mode .logo-text h1 { color: #F3F4F6; }
body.dark-mode .logo-text p { color: #9CA3AF; }

/* Dark mode toggle */
body.dark-mode .dark-mode-toggle {
    background: #374151;
    border-color: #4B5563;
}

/* Language menu */
body.dark-mode .lang-current-btn {
    background: #374151;
    border-color: #4B5563;
}
body.dark-mode .lang-menu {
    background: #1F2937;
    border-color: #374151;
}
body.dark-mode .lang-option { color: #F3F4F6; }
body.dark-mode .lang-option:hover { background: #374151; }

/* Profile button */
body.dark-mode .profile-btn { background: var(--primary-green); color: white; }
body.dark-mode .profile-btn.logged-out { background: #374151; border-color: #4B5563; }

/* Search */
body.dark-mode .search-bar-container { background: #111827; }
body.dark-mode .search-bar { background: #374151; border-color: #4B5563; }
body.dark-mode .search-input { color: #F3F4F6; }
body.dark-mode .search-input::placeholder { color: #9CA3AF; }
body.dark-mode .search-icon { color: #9CA3AF; }
body.dark-mode .search-clear { color: #9CA3AF; }

/* Categories */
body.dark-mode .categories { background: #111827; border-bottom-color: #374151; }
body.dark-mode .category-btn { background: #374151; color: #D1D5DB; border-color: #4B5563; }
body.dark-mode .category-btn.active { background: var(--primary-green); color: white; border-color: var(--primary-green); }

/* Product Cards */
body.dark-mode .product-card { background: #1a2332; border-color: #374151; }
body.dark-mode .product-name { color: #F3F4F6; }
body.dark-mode .product-price { color: var(--primary-green); }
body.dark-mode .product-unit { color: #9CA3AF; }
body.dark-mode .product-img { background: #243040; }

/* Add to Cart & quantity controls */
body.dark-mode .qty-display { color: #F3F4F6; }

/* Cart Sidebar */
body.dark-mode .cart-sidebar { background: #1F2937; }
body.dark-mode .cart-sidebar h2 { color: #F3F4F6; }
body.dark-mode .cart-item { background: #283141; border-color: #374151; }
body.dark-mode .cart-item-name { color: #F3F4F6; }
body.dark-mode .cart-item-price { color: var(--primary-green); }
body.dark-mode .cart-item-unit { color: #9CA3AF; }
body.dark-mode .cart-total { color: #F3F4F6; border-top-color: #374151; }

/* Cart footer */
body.dark-mode .cart-footer { background: #1a2332; border-top-color: #374151; }
body.dark-mode .checkout-btn:disabled { background: #4B5563; }

/* Mini cart toast */
body.dark-mode .mini-cart-toast span { color: #F3F4F6; }

/* Overlay */
body.dark-mode .overlay { background: rgba(0,0,0,0.7); }

/* Modals (Login, Phone, Orders, Checkout, Profile, Email Verify) */
body.dark-mode .phone-modal-card,
body.dark-mode .checkout-modal-card,
body.dark-mode .orders-modal-card,
body.dark-mode .profile-panel {
    background: #1F2937;
    color: #F3F4F6;
}
body.dark-mode .phone-modal-card h2,
body.dark-mode .checkout-modal-card h2,
body.dark-mode .orders-modal-card h2,
body.dark-mode .profile-panel h3 {
    color: #F3F4F6;
}
body.dark-mode .phone-modal-card p,
body.dark-mode .checkout-modal-card p {
    color: #9CA3AF;
}

/* Input fields in modals */
body.dark-mode .phone-input,
body.dark-mode .otp-input,
body.dark-mode .country-code,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="tel"] {
    background: #374151;
    border-color: #4B5563;
    color: #F3F4F6;
}
body.dark-mode .phone-input::placeholder,
body.dark-mode input::placeholder {
    color: #6B7280;
}

/* Close buttons in modals */
body.dark-mode .orders-close-btn,
body.dark-mode .close-btn {
    background: #374151;
    color: #F3F4F6;
}

/* Order Cards */
body.dark-mode .order-card { background: #283141; border-color: #374151; }
body.dark-mode .order-number { color: #F3F4F6; }
body.dark-mode .order-date { color: #9CA3AF; }
body.dark-mode .order-details-toggle { background: #374151; border-color: #4B5563; color: #9CA3AF; }
body.dark-mode .order-details-toggle:hover { background: #4B5563; color: #F3F4F6; }
body.dark-mode .order-items-list.open { border-top-color: #4B5563; }
body.dark-mode .order-item-row { border-bottom-color: #374151; }
body.dark-mode .order-item-name { color: #F3F4F6; }
body.dark-mode .order-item-img { background: #374151; }

/* Progress steps */
body.dark-mode .step-icon { background: #374151; }
body.dark-mode .order-progress-track { background: #374151; }

/* Profile Panel */
body.dark-mode .profile-panel { background: #1F2937; }
body.dark-mode .profile-panel-header { background: linear-gradient(135deg, #14392b 0%, #1a4a35 100%); }
body.dark-mode .profile-panel-name { color: #F3F4F6; }
body.dark-mode .profile-panel-email { color: #D1D5DB; }
body.dark-mode .profile-panel-phone { color: #D1D5DB; }
body.dark-mode .profile-panel-close { background: #374151; color: #F3F4F6; }
body.dark-mode .profile-panel-item { color: #F3F4F6; }
body.dark-mode .profile-panel-item:hover { background: #374151; }
body.dark-mode .orders-badge { background: #10B981; }
body.dark-mode .profile-panel-divider { background: #374151; }
body.dark-mode .profile-panel-logout { color: #EF4444; background: #1a2332; }

/* Checkout */
body.dark-mode .checkout-section { background: #283141; border-color: #374151; }
body.dark-mode .checkout-section h3 { color: #F3F4F6; }
body.dark-mode .checkout-item { border-bottom-color: #374151; }
body.dark-mode .checkout-item-name { color: #F3F4F6; }
body.dark-mode .checkout-total { border-top-color: #374151; color: #F3F4F6; }
body.dark-mode .time-slot-btn { background: #374151; border-color: #4B5563; color: #9CA3AF; }
body.dark-mode .time-slot-btn.active { background: var(--primary-green); color: white; border-color: var(--primary-green); }

/* Checkout form inputs */
body.dark-mode .form-input { background: #374151; border-color: #4B5563; color: #F3F4F6; }
body.dark-mode .form-input:disabled { background: #2d3a4a; color: #F3F4F6; -webkit-text-fill-color: #F3F4F6; opacity: 1; }
body.dark-mode .form-input::placeholder { color: #6B7280; }
body.dark-mode .form-label { color: #D1D5DB; }
body.dark-mode .location-btn.secondary { background: #374151; border-color: #4B5563; color: #D1D5DB; }
body.dark-mode .modal-actions .cancel-btn { color: #D1D5DB; }
body.dark-mode .google-btn { background: #374151; border-color: #4B5563; color: #F3F4F6; }

/* Map - don't invert iframe */
body.dark-mode .map-container { border-color: var(--primary-green); }
body.dark-mode .map-container iframe { filter: none; }

/* Login modal tabs/inputs */
body.dark-mode .login-tab { background: transparent; color: #9CA3AF; }
body.dark-mode .login-tab.active { background: var(--primary-green); color: white; }
body.dark-mode .login-input { background: #374151; border-color: #4B5563; color: #F3F4F6; }
body.dark-mode .login-lang-btn { background: #374151; border-color: #4B5563; }

/* Login card and form */
body.dark-mode .login-card { background: #1F2937; }
body.dark-mode .login-tabs { background: #374151; }
body.dark-mode .login-header h2 { color: #F3F4F6; }
body.dark-mode .login-header p { color: #9CA3AF; }
body.dark-mode .login-close-btn { background: #374151; color: #F3F4F6; }

/* Login form inputs and labels */
body.dark-mode .login-input-group label { color: #D1D5DB; }
body.dark-mode .login-input-group input { background: #374151; border-color: #4B5563; color: #F3F4F6; }
body.dark-mode .login-input-group input::placeholder { color: #6B7280; }
body.dark-mode .login-label-row a { color: var(--primary-green); }
body.dark-mode .form-label { color: #D1D5DB; }
body.dark-mode .password-toggle { color: #9CA3AF; }
body.dark-mode .google-btn { background: #374151; border-color: #4B5563; color: #F3F4F6; }

/* Success Toast */
body.dark-mode .success-toast { background: #1F2937; border: 1px solid #374151; }
body.dark-mode .success-toast strong { color: #F3F4F6; }
body.dark-mode .success-toast span { color: #9CA3AF; }

/* Auth toast (Welcome back, items added, errors) */
body.dark-mode .auth-toast { background: #1F2937; border: 1px solid #374151; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
body.dark-mode .toast-msg { color: #F3F4F6; }

/* Mini cart toast */
body.dark-mode .mini-cart-toast { background: #374151; border: 1px solid #4B5563; }

/* Loading */
body.dark-mode .loading-container { background: #111827; }
body.dark-mode .loading-text { color: #9CA3AF; }

/* Scrollbar */
body.dark-mode ::-webkit-scrollbar-track { background: #1F2937; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #4B5563; }

/* WhatsApp - keep as is, green works in dark */

/* Product grid area */
body.dark-mode .products-container { background: transparent; }

/* Hero banner */
body.dark-mode .hero { background: linear-gradient(135deg, #0f2920 0%, #14392b 100%); }

/* No orders */
body.dark-mode .no-orders { color: #9CA3AF; }

/* Cart close button */
body.dark-mode .cart-close { color: #9CA3AF; }
body.dark-mode .cart-close:hover { color: #F3F4F6; }

/* Delete button in cart */
body.dark-mode .remove-item { background: #374151; }

/* Checkout address/notes */
body.dark-mode textarea { background: #374151; border-color: #4B5563; color: #F3F4F6; }

/* Email verify modal */
body.dark-mode .verify-icon { color: var(--primary-green); }

/* Links */
body.dark-mode a:not(.whatsapp-float):not(.reorder-btn):not(.modal-btn) { color: var(--primary-green); }

/* Smooth transition - targeted, not wildcard (iOS fix) */
body.dark-mode .header,
body.dark-mode .search-bar-container,
body.dark-mode .search-bar,
body.dark-mode .categories,
body.dark-mode .category-btn,
body.dark-mode .product-card,
body.dark-mode .cart-sidebar,
body.dark-mode .cart-item,
body.dark-mode .cart-footer,
body.dark-mode .phone-modal-card,
body.dark-mode .checkout-modal-card,
body.dark-mode .orders-modal-card,
body.dark-mode .profile-panel,
body.dark-mode .auth-toast,
body.dark-mode .login-card,
body.dark-mode .order-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==================== ORDER SUCCESS MODAL ==================== */
.order-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.order-success-overlay.show {
    display: flex;
}
.order-success-card {
    background: white;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 360px;
    width: 100%;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes successPop {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    animation: checkBounce 0.6s ease 0.3s both;
}
@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.order-success-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    color: #1F2937;
    margin-bottom: 0.5rem;
}
.order-success-card .success-subtitle {
    color: #6B7280;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}
.order-success-card .success-order-id {
    background: #ECFDF5;
    color: #065F46;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1.5rem;
}
.order-success-card .track-order-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    margin-bottom: 0.75rem;
}
.order-success-card .track-order-btn:hover {
    background: #059669;
}
.order-success-card .continue-btn {
    width: 100%;
    padding: 0.85rem;
    background: transparent;
    color: #6B7280;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Dark mode for success modal */
body.dark-mode .order-success-card { background: #1F2937; }
body.dark-mode .order-success-card h2 { color: #F3F4F6; }
body.dark-mode .order-success-card .success-subtitle { color: #9CA3AF; }
body.dark-mode .order-success-card .success-order-id { background: #14392b; color: #6EE7B7; }
body.dark-mode .order-success-card .continue-btn { color: #9CA3AF; }

#recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* ==================== BOOKMARK / SAVED ITEMS ==================== */
.bookmark-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 2;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.bookmark-btn:hover { transform: scale(1.15); }
.bookmark-btn.saved { background: #FEF3C7; border-color: #F59E0B; }
body.dark-mode .bookmark-btn { background: rgba(55,65,81,0.9); border: 1px solid rgba(255,255,255,0.15); }
body.dark-mode .bookmark-btn.saved { background: #78350F; border-color: #F59E0B; }

/* Saved Items Modal — categories inherit from .categories */
.saved-items-categories {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
    flex-shrink: 0;
}

/* Saved items modal — fixed header+cats, scrollable content */
#savedItemsModal.show {
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
}
#savedItemsModal .orders-modal-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    touch-action: auto;
}
#savedItemsModal .orders-modal-header {
    padding: 1.5rem 1.5rem 0.75rem;
    margin-bottom: 0;
    flex-shrink: 0;
}
#savedItemsModal #savedItemsContainer {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 8rem;
}

/* Saved items grid inside modal — 2 columns like main */
.saved-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
}
.saved-items-grid .product-card {
    font-size: 0.9rem;
}
.saved-items-grid .product-card .product-image {
    height: 120px;
}
.saved-items-grid .product-card .product-info {
    padding: 0.6rem 0.75rem;
}
.saved-items-grid .product-name {
    font-size: 0.85rem;
}
.saved-items-grid .product-price {
    font-size: 0.9rem;
}
.saved-items-grid .product-quantity-selector {
    gap: 0.25rem;
}
.saved-items-grid .product-qty-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}
.saved-items-grid .product-qty-display {
    min-width: 28px;
    font-size: 0.85rem;
}
.saved-items-grid .add-to-cart {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Empty state */
.saved-items-empty {
    text-align: center;
    padding: 3rem 2rem;
}
.saved-items-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.saved-items-empty p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}
.saved-items-empty small {
    color: #6B7280;
    font-size: 0.85rem;
}
.saved-items-empty .start-shopping-link {
    display: inline-block;
    margin-top: 1rem;
    color: #10B981;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Dark mode */
body.dark-mode .saved-items-empty p { color: #F3F4F6; }
