/* ==========================================================================
   EZZAMNI RESTAURANT DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
    --bg-dark: #141210;       /* Premium warm charcoal ash-wood */
    --bg-card: rgba(26, 23, 20, 0.75); /* Warm tinted dark card */
    --bg-header: rgba(18, 16, 14, 0.9);   /* Cozy dark slate/charcoal header */
    --bg-input: rgba(255, 159, 10, 0.04);  /* Subtle warm ember tint */
    
    --primary: #FF9F0A;       /* Vibrant Gold / Amber (Flame) */
    --primary-hover: #E08700;
    --primary-glow: rgba(255, 159, 10, 0.2);
    
    --secondary: #30D158;     /* Mint Green (WhatsApp / Success) */
    --secondary-hover: #24A142;
    --secondary-glow: rgba(48, 209, 88, 0.25);
    
    --text-main: #F7F5F2;     /* Warm white for less harsh contrast */
    --text-muted: #A39382;    /* Warm muted brown-gray */
    --text-light: #E0D8D0;    /* Soft warm light text */
    
    --border-light: rgba(255, 159, 10, 0.08); /* Cozy warm ember border */
    --border-active: rgba(255, 159, 10, 0.4);
    
    --font-primary: 'Outfit', sans-serif;
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px 0 var(--primary-glow);
}

/* --- CSS Variables & Design Tokens (Orange Light Mode) --- */
:root[data-theme="light"] {
    --bg-dark: #FFF8F0;         /* Soft warm cream / light orange background */
    --bg-card: rgba(255, 255, 255, 0.85); /* Solid white card with slight transparency for glassmorphism */
    --bg-header: rgba(255, 248, 240, 0.85); /* Blurred light header */
    --bg-input: rgba(255, 159, 10, 0.06);   /* Light orange tinted input background */
    
    --primary: #E07A00;         /* Deep readable Orange for text/button */
    --primary-hover: #C26600;
    --primary-glow: rgba(224, 122, 0, 0.15);
    
    --secondary: #24A142;       /* Readable mint green */
    --secondary-hover: #1E8235;
    --secondary-glow: rgba(36, 161, 66, 0.15);
    
    --text-main: #2C1800;       /* Dark warm brown for text contrast */
    --text-muted: #8F7860;      /* Muted brown for subtexts */
    --text-light: #5C4020;      /* Semi-dark brown */
    
    --border-light: rgba(224, 122, 0, 0.12); /* Subtle warm borders */
    --border-active: rgba(224, 122, 0, 0.4);
    
    --shadow-soft: 0 8px 32px 0 rgba(224, 122, 0, 0.08); /* Soft orange tint shadows */
    --shadow-glow: 0 0 20px 0 var(--primary-glow);
}

/* --- Base Setup --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    line-height: 1.5;
    overflow-x: hidden;
    /* Reserve room so the sticky cart bar never covers the last item */
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.arabic {
    font-family: 'Outfit', Arial, sans-serif; /* Fallback, Arabic text uses system fonts beautifully */
    font-weight: 600;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- App Layout Containers --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* --- Header Section --- */
.main-header {
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-glow);
    padding: 2px;
    background: rgba(0, 0, 0, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.05em;
}

.brand-title .arabic {
    color: var(--primary);
    font-size: 1.5rem;
}

.brand-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    font-size: 1.15rem;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    transform: scale(1.08);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.header-badges {
    display: flex;
    gap: 10px;
}

.badge {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    background: rgba(48, 209, 88, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(48, 209, 88, 0.3);
}

.location-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

/* --- Hero Section --- */
.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Fire glow effect behind hero */
.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 80%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 159, 10, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-headline {
    font-size: 3.2rem;
    line-height: 1.15;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-headline .highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtext {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 550px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B00 100%);
    color: #000000;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.05rem;
    box-shadow: 0 8px 25px rgba(255, 159, 10, 0.35);
    transition: var(--transition-bounce);
}

.cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(255, 159, 10, 0.5);
}

.cta-btn:active {
    transform: translateY(0) scale(0.98);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glow-container {
    position: relative;
    width: 340px;
    height: 340px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-floating-dish {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 159, 10, 0.3);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8),
                0 0 40px -10px rgba(255, 159, 10, 0.4);
    animation: floatAnimation 6s ease-in-out infinite;
    z-index: 2;
}

.glow-effect {
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 159, 10, 0.2) 0%, rgba(255, 159, 10, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite;
}

/* Floating Animations */
@keyframes floatAnimation {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* --- Search & Controls Section --- */
.controls-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: -20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 85px; /* Pinned below the sticky header on desktop */
    z-index: 90;
}

.search-box {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

#search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    padding: 16px 20px 16px 52px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 400;
    transition: var(--transition-smooth);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 159, 10, 0.1);
}

.clear-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Category Slider */
.categories-wrapper {
    overflow: hidden;
    position: relative;
}

/* Gradient fade indicators for scroll */
.categories-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: linear-gradient(90deg, rgba(22, 22, 28, 0) 0%, rgba(22, 22, 28, 0.9) 100%);
    pointer-events: none;
}

.categories-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
}

.categories-tabs::-webkit-scrollbar {
    display: none; /* Safari & Chrome */
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-bounce);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: var(--primary);
    color: #000000;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(255, 159, 10, 0.25);
}

/* --- Menu Section --- */
.menu-section {
    margin-bottom: 80px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.items-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Dynamic Menu Grid */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
    min-height: 200px;
}

/* --- Category Section (banner + items) --- */
.cat-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-margin-top: 100px;
}

.cat-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    isolation: isolate;
}
.cat-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 0% 50%, rgba(255, 159, 10, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.cat-hero-img {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at top, rgba(255,159,10,0.18), transparent 60%),
        rgba(20, 18, 16, 0.6);
}
.cat-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}
.cat-hero-img.is-transparent img {
    /* Transparent cutouts get padding + contain so the whole dish shows */
    object-fit: contain;
    padding: 16px;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.55));
}
.cat-section:hover .cat-hero-img img {
    transform: scale(1.04);
}

.cat-hero-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cat-name {
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0;
}
.cat-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}
.cat-count {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--primary);
    font-weight: 600;
}

.cat-hero.no-image {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    text-align: center;
}
.cat-hero.no-image .cat-tagline {
    margin-left: auto;
    margin-right: auto;
    max-width: 380px;
}

/* --- Items grid inside a section --- */
.cat-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* --- Tight text-only menu card (used in section view) --- */
.menu-card.text-only {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    box-shadow: 0 4px 16px -8px rgba(0, 0, 0, 0.5);
}
.menu-card.text-only:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
}
.menu-card.text-only .card-details {
    padding: 16px 18px;
    flex: 1;
    min-width: 0;
}
.menu-card.text-only .card-title {
    font-size: 1.05rem;
    line-height: 1.25;
    margin: 0 0 4px;
}
.menu-card.text-only .card-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0 0 12px;
    color: var(--text-muted);
}
.menu-card.text-only .card-footer {
    align-items: center;
    gap: 12px;
}
.menu-card.text-only .card-price {
    font-size: 1.15rem;
}

@media (max-width: 640px) {
    .cat-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    .cat-hero-img { aspect-ratio: 16 / 9; }
    .cat-items { grid-template-columns: 1fr; }
}

.menu-loader {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 15px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Menu Cards --- */
.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    position: relative;
}

.menu-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-active);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 159, 10, 0.1);
}

.card-img-container {
    height: 180px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.card-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition-smooth);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
}

/* If standard JPEG cover fit */
.card-img.standard-photo {
    height: 100%;
    width: 100%;
    object-fit: cover;
    filter: none;
}

.menu-card:hover .card-img {
    transform: scale(1.08) rotate(2deg);
}

/* --- Image-less cards: typography placeholder --- */
.card-img-container.no-image,
.item-img-container.no-image {
    background:
        radial-gradient(ellipse at top, rgba(255, 159, 10, 0.18), transparent 60%),
        linear-gradient(135deg, rgba(255, 159, 10, 0.06), rgba(255, 159, 10, 0) 70%),
        rgba(22, 22, 28, 0.95);
    position: relative;
    overflow: hidden;
}
.card-img-container.no-image::before,
.item-img-container.no-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 159, 10, 0.12), transparent 55%);
    pointer-events: none;
}
.no-image-mark {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 5rem;
    line-height: 1;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(255, 159, 10, 0.45);
    letter-spacing: -0.04em;
    opacity: 0.85;
    transition: var(--transition-smooth);
}

/* --- Order success state (post-Telegram submit) --- */
.order-success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 24px 32px;
    gap: 14px;
}
.success-mark {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle, rgba(48, 209, 88, 0.35), transparent 65%),
        rgba(48, 209, 88, 0.12);
    border: 2px solid var(--secondary);
    color: var(--secondary);
    font-size: 2.5rem;
    margin-bottom: 8px;
    animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.success-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}
.success-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 320px;
    margin: 0;
}
.success-ref {
    margin-top: 12px;
    padding: 10px 18px;
    background: rgba(255, 159, 10, 0.08);
    border: 1px solid rgba(255, 159, 10, 0.25);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}
.order-success-state .btn-start-shopping {
    margin-top: 24px;
}
.menu-card.no-image:hover .no-image-mark {
    transform: scale(1.08);
    opacity: 1;
}
.item-img-container.no-image .no-image-mark {
    font-size: 1.75rem;
}

.card-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--primary);
    color: #000000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none; /* never blocks card clicks */
}

.card-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.45;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.add-to-cart-btn {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition-bounce);
}

.add-to-cart-btn:hover {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 0 10px var(--primary);
}

.add-to-cart-btn:active {
    transform: scale(0.9);
}

/* Quantity controls in card */
.card-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    font-size: 0.85rem;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.qty-val {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 14px;
    text-align: center;
}

/* --- No results --- */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.no-results h4 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* ==========================================================================
   CART SYSTEM (STICKY BAR & OVERLAY DRAWER)
   ========================================================================== */

/* --- Sticky Bottom Cart Bar (Mobile) --- */
.sticky-cart-bar {
    position: fixed;
    /* Respect iOS home-indicator safe area */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translate(-50%, calc(120% + env(safe-area-inset-bottom, 0px))); /* Hidden initially */
    z-index: 90;
    width: calc(100% - 32px);
    max-width: 500px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticky-cart-bar.active {
    transform: translate(-50%, 0);
}

.sticky-cart-container {
    background: linear-gradient(135deg, rgba(28, 25, 23, 0.95) 0%, rgba(20, 18, 16, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-active);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 159, 10, 0.15);
    cursor: pointer;
}

.cart-summary-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-icon-badge {
    position: relative;
    font-size: 1.4rem;
    color: var(--primary);
}

.badge-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: #000000;
    font-size: 0.75rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.cart-total-info {
    display: flex;
    flex-direction: column;
}

.cart-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.view-cart-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Cart Drawer Overlay --- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.4s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Cart Drawer Panel --- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--bg-dark);
    border-left: 1px solid var(--border-light);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cart-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.1);
}

.drawer-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-title i {
    color: var(--primary);
}

.close-drawer-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.close-drawer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* Empty State inside drawer */
.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: auto;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-cart-state i {
    font-size: 4rem;
    color: rgba(255,255,255,0.03);
    margin-bottom: 20px;
}

.empty-title {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-text {
    font-size: 0.85rem;
    margin-bottom: 24px;
    max-width: 280px;
}

.btn-start-shopping {
    background: var(--primary);
    color: #000000;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-family: var(--font-primary);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,159,10,0.2);
    transition: var(--transition-smooth);
}

.btn-start-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,159,10,0.3);
}

/* Cart list and details */
.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cart Item Card */
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
}

.item-img-container {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.item-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.item-img.standard-photo {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.item-details-row {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
}

.remove-item-btn:hover {
    color: #FF453A; /* iOS light red */
}

/* Mini Quantity selectors in cart */
.mini-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.mini-qty-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.mini-qty-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mini-qty-val {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 12px;
    text-align: center;
}

/* Order retract configuration */
.order-config-section {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.config-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.order-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    display: none; /* Hide real radio */
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition-smooth);
}

.option-content i {
    font-size: 1rem;
}

.type-option input:checked + .option-content {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 4px 10px rgba(255, 159, 10, 0.15);
}

/* Form Fields */
.order-details-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.form-group label .required {
    color: #FF453A;
}

.form-group input,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-main);
    font-family: var(--font-primary);
    /* 16px minimum prevents iOS Safari from auto-zooming on focus */
    font-size: 16px;
    transition: var(--transition-smooth);
    width: 100%;
    min-height: 44px;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.input-help {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Pricing summary box */
.order-summary-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

.summary-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 4px 0;
}

.total-line {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Distance-based delivery hint (only when mode = delivery) */
.delivery-note {
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 159, 10, 0.06);
    border: 1px solid rgba(255, 159, 10, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}
.delivery-note i {
    color: var(--primary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.total-line span:last-child {
    color: var(--primary);
    font-size: 1.3rem;
}

/* Drawer Footer */
.drawer-footer {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    background: rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-hover) 100%);
    color: #FFFFFF;
    border: none;
    padding: 16px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(48, 209, 88, 0.25);
    transition: var(--transition-bounce);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(48, 209, 88, 0.4);
}

.checkout-btn:active {
    transform: translateY(0);
}

.checkout-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.main-footer {
    background: #0e0d0c;
    border-top: 1px solid var(--border-light);
    padding: 50px 20px 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-contact i {
    color: var(--primary);
    width: 20px;
    margin-right: 8px;
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

#menu-anchor {
    scroll-margin-top: 80px; /* Offset to prevent sticky header from overlapping contents on scroll */
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet (Portrait) */
@media screen and (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 20px 60px;
        gap: 30px;
    }
    
    .hero-content {
        align-items: center;
    }
    
    .hero-headline {
        font-size: 2.6rem;
    }
    
    .hero-subtext {
        margin-bottom: 24px;
    }
    
    .glow-container {
        width: 280px;
        height: 280px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile Devices */
@media screen and (max-width: 576px) {
    html {
        font-size: 14px; /* Slightly smaller base font for mobile */
    }
    
    body {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }

    .container {
        padding: 0 12px;
    }

    /* --- Compact Header --- */
    .main-header {
        padding: 8px 0;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .brand-logo {
        width: 42px;
        height: 42px;
        border-width: 1.5px;
    }
    
    .brand-title {
        font-size: 1.15rem;
        gap: 6px;
    }
    
    .brand-title .arabic {
        font-size: 1.1rem;
    }

    .brand-tagline {
        font-size: 0.72rem;
    }
    
    .header-badges {
        display: none; /* Hide badges on very small phones to save space */
    }
    
    /* --- Compact Hero Section --- */
    .hero-section {
        padding: 24px 12px;
        text-align: center;
        gap: 12px;
    }
    
    .hero-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 16px;
    }
    
    .hero-headline {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .hero-subtext {
        font-size: 0.92rem;
        margin-bottom: 16px;
        line-height: 1.4;
    }

    .cta-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    
    /* --- Compact Controls & Tabs --- */
    .controls-section {
        position: sticky;
        top: 59px; /* Pinned below the sticky header on mobile */
        z-index: 90;
        background: rgba(20, 18, 16, 0.9); /* Blend of dark bg and blur */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: none;
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        padding: 12px 12px 6px;
        margin-top: -20px;
        margin-left: -12px;
        margin-right: -12px;
        margin-bottom: 20px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .search-box {
        margin-bottom: 12px;
    }

    .search-icon {
        left: 14px;
        font-size: 0.95rem;
    }

    #search-input {
        padding: 10px 16px 10px 38px;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }

    .clear-btn {
        right: 14px;
        font-size: 1rem;
    }

    .categories-tabs {
        gap: 8px;
        padding-bottom: 4px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-height: 36px;
    }
    .tab-emoji { font-size: 0.95rem; }
    
    /* --- Mobile category sections (No big banner images, clean flat divider) --- */
    .menu-grid { gap: 20px; }

    .cat-section { gap: 8px; }

    .cat-hero {
        display: grid;
        grid-template-columns: 1fr 110px;
        gap: 16px;
        align-items: center;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-soft);
        position: relative;
        isolation: isolate;
    }

    .cat-hero::before {
        display: none; /* remove background glow */
    }

    .cat-hero-img {
        grid-column: 2;
        grid-row: 1;
        width: 110px;
        height: 85px;
        border-radius: var(--radius-sm);
        background: rgba(0, 0, 0, 0.2);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cat-hero-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cat-hero-img.is-transparent img {
        object-fit: contain;
        padding: 6px;
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    }

    .cat-hero-text {
        grid-column: 1;
        gap: 2px;
    }

    .cat-name { 
        font-size: 1.15rem; 
        font-weight: 700;
        margin: 0;
    }

    .cat-tagline { 
        font-size: 0.8rem; 
        color: var(--text-muted);
        font-style: normal;
        margin: 0;
    }

    .cat-count { 
        display: none; 
    }

    .cat-hero.no-image {
        grid-template-columns: 1fr;
    }

    .cat-items { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px; 
    }

    /* --- Item cards on mobile (highly optimized, tight rows) --- */
    .menu-card,
    .menu-card.text-only { 
        display: flex;
        flex-direction: column;
        height: 100%; 
        border-radius: var(--radius-md);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .menu-card .card-img-container {
        height: 160px;
        padding: 6px;
    }

    .menu-card .card-details,
    .menu-card.text-only .card-details {
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex-grow: 1;
        height: 100%;
        gap: 6px;
    }

    .menu-card .card-title,
    .menu-card.text-only .card-title {
        font-size: 0.95rem;
        line-height: 1.25;
        margin: 0;
    }

    .menu-card .card-desc,
    .menu-card.text-only .card-desc {
        font-size: 0.78rem;
        margin-bottom: 8px;
        line-height: 1.35;
        flex-grow: 1;
    }

    .menu-card .card-price,
    .menu-card.text-only .card-price { 
        font-size: 0.95rem; 
        margin: 0;
    }

    /* --- Card sizes/buttons --- */
    .card-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin-bottom: 6px;
        max-width: 100%;
    }

    .add-to-cart-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .card-quantity-controls {
        padding: 2px 4px;
        gap: 8px;
    }

    .qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .qty-val {
        font-size: 0.85rem;
        min-width: 14px;
    }

    .menu-section {
        margin-bottom: 40px;
    }

    .section-header {
        margin-bottom: 16px;
        padding-bottom: 8px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .items-count {
        font-size: 0.8rem;
    }
    
    /* --- Sticky Bottom Cart Bar (Mobile) --- */
    .sticky-cart-bar {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 24px);
    }

    .sticky-cart-container {
        padding: 10px 16px;
        border-radius: var(--radius-sm);
    }

    .cart-summary-info {
        gap: 12px;
    }

    .cart-icon-badge {
        font-size: 1.2rem;
    }

    .badge-count {
        top: -6px;
        right: -8px;
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .cart-label {
        font-size: 0.7rem;
    }

    .cart-price {
        font-size: 1rem;
    }

    .view-cart-btn {
        font-size: 0.85rem;
        gap: 4px;
    }
    
    /* Cart Drawer Slide up on mobile (feels like a native bottom-sheet).
       height:auto + max-height lets the sheet hug its content, so a filled
       cart no longer leaves a big empty void above the send button. */
    .cart-drawer {
        max-width: 100%;
        height: auto;
        max-height: 90%;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid var(--border-light);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }

    /* Keep the empty-cart state generous and centred even though the sheet
       now sizes to its content. */
    .empty-cart-state {
        min-height: 50vh;
    }
    
    .drawer-header {
        padding: 16px 16px;
    }

    .drawer-title {
        font-size: 1.15rem;
    }
    
    .drawer-body {
        padding: 16px;
    }

    .cart-item {
        padding: 8px 10px;
        gap: 12px;
        border-radius: var(--radius-sm);
    }

    .item-name {
        font-size: 0.9rem;
    }

    .item-price {
        font-size: 0.85rem;
    }

    .order-config-section {
        padding-top: 16px;
    }

    .config-title {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .order-type-selector {
        padding: 3px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
    }

    .option-content {
        padding: 8px 2px;
        font-size: 0.7rem;
        gap: 4px;
    }

    .option-content i {
        font-size: 0.9rem;
    }

    .order-details-form {
        gap: 12px;
    }

    .form-group {
        gap: 4px;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        min-height: 38px;
    }

    .order-summary-box {
        padding: 12px;
        border-radius: var(--radius-sm);
    }

    .summary-line {
        font-size: 0.85rem;
    }

    .total-line {
        font-size: 1rem;
    }

    .total-line span:last-child {
        font-size: 1.15rem;
    }

    .drawer-footer {
        padding: 16px;
    }

    .checkout-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   THEME-SPECIFIC OVERRIDES (LIGHT MODE POLISH)
   ========================================================================== */
:root[data-theme="light"] {
    color-scheme: light;
}

/* Light mode specific background and text contrast fixes */
:root[data-theme="light"] .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .location-badge {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .tab-btn {
    background: rgba(0, 0, 0, 0.03);
}

:root[data-theme="light"] .tab-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .tab-btn.active {
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(224, 122, 0, 0.25);
}

:root[data-theme="light"] .cta-btn {
    color: #FFFFFF;
}

:root[data-theme="light"] .clear-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .cart-drawer {
    background: #FFFDFB;
}

:root[data-theme="light"] .drawer-header {
    background: rgba(0, 0, 0, 0.02);
}

:root[data-theme="light"] .drawer-footer {
    background: rgba(0, 0, 0, 0.02);
}

:root[data-theme="light"] .cart-item {
    background: rgba(0, 0, 0, 0.02);
}

:root[data-theme="light"] .empty-cart-state i {
    color: rgba(0, 0, 0, 0.03);
}

:root[data-theme="light"] .order-type-selector {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .qty-btn:hover,
:root[data-theme="light"] .mini-qty-btn:hover,
:root[data-theme="light"] .close-drawer-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .close-drawer-btn {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .sticky-cart-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 248, 240, 0.98) 100%);
    border-color: var(--border-light);
}

:root[data-theme="light"] .cart-price {
    color: var(--text-main);
}

:root[data-theme="light"] .main-footer {
    background: #FFF5E6;
}

:root[data-theme="light"] .cat-hero-img {
    background: rgba(0, 0, 0, 0.03);
}

:root[data-theme="light"] .cat-hero-img.is-transparent img {
    filter: drop-shadow(0 12px 24px rgba(224,122,0,0.25));
}

:root[data-theme="light"] .menu-card.text-only {
    box-shadow: 0 4px 16px -8px rgba(224, 122, 0, 0.15);
}

:root[data-theme="light"] .success-mark {
    background:
        radial-gradient(circle, rgba(48, 209, 88, 0.15), transparent 65%),
        rgba(48, 209, 88, 0.05);
}

:root[data-theme="light"] .success-ref {
    background: rgba(224, 122, 0, 0.05);
}

:root[data-theme="light"] .spinner {
    border-top: 3px solid var(--primary);
}

/* Custom scrollbar in light mode */
:root[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================================================
   B&B GRILL — CATEGORY-FIRST REDESIGN (appended overrides & new components)
   ========================================================================== */

:root {
    --font-display: "Playfair Display", Georgia, serif;
}

/* --- Compact brand banner (no longer sticky; pills bar sticks instead) --- */
.main-header {
    position: relative;
    overflow: hidden;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-light);
}
.header-banner-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(20,18,16,0.78) 0%, rgba(20,18,16,0.92) 100%),
        url('assets/images/cat-grills.png') center/cover no-repeat;
    filter: saturate(1.1);
    z-index: 0;
}
.main-header .header-container { position: relative; z-index: 1; }

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.social-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}
.header-actions { gap: 10px; }

/* --- Sticky controls bar (pills + search) --- */
.controls-sticky {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0 10px;
}
.controls-sticky .categories-wrapper { margin-bottom: 10px; }
.controls-sticky .search-box { margin: 0; }

/* --- View system + transitions --- */
.view { display: none; }
.view.is-active { display: block; animation: viewIn .35s ease both; }
@keyframes viewIn {
    /* opacity only — a lingering transform would turn the fixed .detail-float
       into a section-relative element; keeping it transform-free lets the
       cutout stay anchored to the viewport like a true background watermark. */
    from { opacity: 0; }
    to   { opacity: 1; }
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .3s; }

main.container { padding-top: 24px; padding-bottom: 120px; }

/* --- Decorative section divider --- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 6px 0 26px;
}
.divider-line {
    height: 1px;
    flex: 1;
    max-width: 90px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: .6;
}
.section-eyebrow {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--primary);
    letter-spacing: .02em;
    white-space: nowrap;
}

/* --- Category grid of photo tiles --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.cat-tile {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: var(--radius-lg, 18px);
    overflow: hidden;
    aspect-ratio: 1 / 1.05;
    background: var(--bg-card);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    isolation: isolate;
    opacity: 0;
    transform: translateY(14px);
    animation: tileIn .5s cubic-bezier(.22,.61,.36,1) forwards;
    animation-delay: calc(var(--i) * 55ms);
    transition: transform .25s ease, box-shadow .25s ease;
}
@keyframes tileIn { to { opacity: 1; transform: translateY(0); } }

.cat-tile-img { position: absolute; inset: 0; z-index: 0; }
.cat-tile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.22,.61,.36,1);
}
.cat-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(20,18,16,0) 30%, rgba(20,18,16,0.55) 62%, rgba(20,18,16,0.95) 100%);
    transition: background .25s ease;
}
.cat-tile-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 14px 14px 16px;
    text-align: left;
}
.cat-tile-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.22rem;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    margin: 0;
}
.cat-tile-tagline {
    margin: 4px 0 0;
    font-size: 0.74rem;
    color: rgba(255,255,255,0.82);
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-tile-count {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 3;
    min-width: 26px; height: 26px;
    padding: 0 7px;
    border-radius: var(--radius-full, 999px);
    background: var(--primary);
    color: #000;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.cat-tile:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.cat-tile:hover .cat-tile-img img { transform: scale(1.07); }
.cat-tile:hover::after { background: linear-gradient(180deg, rgba(20,18,16,0) 20%, rgba(226,91,29,0.18) 55%, rgba(20,18,16,0.95) 100%); }
.cat-tile:active { transform: scale(.97); }

/* --- Detail view (one category's items) --- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 9px 16px;
    border-radius: var(--radius-full, 999px);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background .2s ease, transform .2s ease;
}
.back-btn:hover { background: rgba(255,255,255,0.1); }
.back-btn:active { transform: translateX(-3px); }

.detail-banner {
    position: relative;
    border-radius: var(--radius-lg, 18px);
    overflow: hidden;
    min-height: 150px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.detail-banner-text { padding: 18px 20px; }
.detail-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.detail-tagline { margin: 4px 0 8px; color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.detail-count {
    display: inline-block;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 3px 12px;
    border-radius: var(--radius-full, 999px);
}

/* --- Item lists (detail + search): responsive columns --- */
.detail-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* two food items per line, incl. phones */
    gap: 10px;
}
@media (min-width: 720px) {
    .detail-items { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 1040px) {
    .detail-items { grid-template-columns: repeat(4, 1fr); }
}

/* Staggered card entrance (reuses Zamnia .menu-card.text-only styling) */
.detail-items .menu-card.text-only,
.view-search .menu-card.text-only {
    opacity: 0;
    transform: translateY(12px);
    animation: cardIn .4s ease forwards;
    animation-delay: calc(var(--i) * 35ms);
}
@keyframes cardIn { to { opacity: 1; transform: translateY(0); } }

/* --- Cart bar attention pulse on add --- */
.sticky-cart-bar.pulse { animation: cartPulse .4s ease; }
@keyframes cartPulse {
    0% { transform: translateX(-50%) scale(1); }
    40% { transform: translateX(-50%) scale(1.04); }
    100% { transform: translateX(-50%) scale(1); }
}

/* --- Light theme adjustments for new components --- */
:root[data-theme="light"] .cat-tile { background: #eee3d6; }
:root[data-theme="light"] .social-btn { background: rgba(0,0,0,0.04); color: #3a2a1a; }

/* --- Wider screens: more tile columns --- */
@media (min-width: 720px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .cat-tile-name { font-size: 1.35rem; }
}
@media (min-width: 1040px) {
    .category-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .cat-tile, .view.is-active,
    .detail-items .menu-card.text-only,
    .view-search .menu-card.text-only {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .cat-tile-img img { transition: none; }
}

/* --- Floating decorative cutout in category detail view --- */
.view-detail { position: relative; }
.detail-items { position: relative; z-index: 2; }
.detail-items .menu-card.text-only { position: relative; z-index: 2; }
/* Cutout floats in the viewport corner and follows the scroll, like a watermark.
   It lives inside .view-detail, so it only renders while the detail view is shown. */
.detail-float {
    position: fixed;
    right: max(4px, calc((100vw - 1200px) / 2 + 4px));
    bottom: 78px;                 /* sits above the sticky cart bar */
    /* Fixed square box + object-fit:contain => every cutout renders the same size,
       regardless of its own width/height, anchored to the bottom-right corner. */
    width: clamp(170px, 46vw, 240px);
    height: clamp(170px, 46vw, 240px);
    object-fit: contain;
    object-position: bottom right;
    z-index: 0;                   /* BEHIND the cards — glows through the glass, never covers text */
    opacity: 0.85;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 16px 26px rgba(0,0,0,0.55));
    animation: floatBob 6s ease-in-out infinite;
    transition: opacity .3s ease;
}
@keyframes floatBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}
@media (min-width: 680px) {
    .detail-float { width: 300px; height: 300px; opacity: 0.95; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .detail-float { animation: none; }
}
