/* ===================================================================
   Karaeino — public menu
   Shared base + 3 selectable styles (no item images):
     body.menu-style-classic  → dotted-leader menu sheet
     body.menu-style-modern   → colourful card grid
     body.menu-style-minimal  → airy minimal list
   =================================================================== */

:root {
    --brand: #8b1e2a;
    --brand-dark: #6e151f;
    --accent: #c79a4b;        /* warm gold */
    --bg: #f6efe7;            /* warm cream */
    --surface: #fffdfa;
    --text: #2b1414;
    --text-muted: #8a766f;
    --line: rgba(139, 30, 42, 0.18);
    --border: rgba(0, 0, 0, 0.07);
    --shadow-sm: 0 2px 10px rgba(43, 20, 20, 0.06);
    --shadow-md: 0 14px 40px rgba(43, 20, 20, 0.12);
    --radius: 16px;
    --maxw: 760px;
    --nav-h: 62px;
}

body.dark-mode {
    --brand: #e2929d;
    --brand-dark: #c45b66;
    --accent: #d9b873;
    --bg: #161010;
    --surface: #211818;
    --text: #f3e9e6;
    --text-muted: #b09c97;
    --line: rgba(226, 146, 157, 0.22);
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }

/* ===== Floating theme toggle ===== */
.theme-fab {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 70;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(20, 12, 12, 0.42);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.theme-fab:hover { transform: translateY(-2px) scale(1.05); background: rgba(20, 12, 12, 0.6); }
.theme-fab img { width: 20px; height: 20px; filter: brightness(0) invert(1); }

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, rgba(43, 20, 20, 0.5), rgba(43, 20, 20, 0.8)),
                url('header.webp') center/cover no-repeat;
    overflow: hidden;
}

.hero-overlay { padding: 28px 30px; animation: rise 0.8s ease both; }

.hero .logo {
    width: auto;
    height: 130px;
    max-width: 78%;
    margin: 0 auto 16px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.hero-kicker {
    display: block;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 4px;
}

.hero h1 {
    font-family: 'Cairo', sans-serif;
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 800;
    margin: 4px 0 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: clamp(1rem, 2.6vw, 1.25rem);
    margin: 0 auto 26px;
    max-width: 520px;
    opacity: 0.95;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--brand);
    color: #fff;
    padding: 13px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 10px 24px rgba(139, 30, 42, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.03);
    background: var(--brand-dark);
    box-shadow: 0 16px 30px rgba(139, 30, 42, 0.55);
}

.cta-icon { width: 22px; height: 22px; filter: brightness(0) invert(1); }

.hero-fade {
    position: absolute;
    inset: auto 0 0 0;
    height: 90px;
    background: linear-gradient(180deg, transparent, var(--bg));
}

/* ===== Category nav ===== */
.menu-nav {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    margin: 0 auto;
    max-width: var(--maxw);
    overflow-x: auto;
    scrollbar-width: none;
}

.menu-nav::-webkit-scrollbar { display: none; }

.nav-chip {
    flex: 0 0 auto;
    background: var(--surface);
    color: var(--brand);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 9px 22px;
    border: 1px solid var(--line);
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease;
}

.nav-chip:hover { transform: translateY(-2px); }

.nav-chip.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(139, 30, 42, 0.35);
}

.no-categories { color: var(--brand); font-weight: 700; padding: 10px; }

/* ===== Sections (shared) ===== */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 18px 18px 60px;
}

.menu-section { display: none; }
.menu-section.active { display: block; animation: fade 0.4s ease both; }

.sheet-head { text-align: center; margin-bottom: 26px; }

.section-title {
    font-family: 'Cairo', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 800;
    margin: 0;
    color: var(--brand);
}

.section-desc {
    color: var(--text-muted);
    margin: 6px auto 0;
    max-width: 520px;
}

.dish-list { list-style: none; margin: 0; padding: 0; }

/* Virtualization: skip layout/paint for off-screen cards in the active
   category. `auto` lets the browser remember each card's real measured size
   after first paint, so the scrollbar stays stable. Per-style heights below. */
.dish {
    content-visibility: auto;
    contain-intrinsic-size: auto 130px;
}

.menu-style-classic .dish,
.menu-style-minimal .dish { contain-intrinsic-size: auto 84px; }

.dish-name {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    color: var(--text);
}

.dish-price {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    color: var(--brand);
    white-space: nowrap;
}

.dish-desc { color: var(--text-muted); }

.dish-flag {
    display: inline-block;
    margin-inline-start: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--text-muted);
    padding: 2px 9px;
    border-radius: 50px;
    vertical-align: middle;
}

.is-unavailable .dish-name,
.is-unavailable .dish-price { opacity: 0.5; }

.empty-state {
    list-style: none;
    text-align: center;
    color: var(--text-muted);
    padding: 26px;
}

.empty-state.center {
    margin: 40px auto;
    max-width: 420px;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

/* ===================================================================
   STYLE 1 — CLASSIC (dotted-leader menu sheet)
   =================================================================== */
.menu-style-classic .menu-sheet {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 30px clamp(20px, 5vw, 44px) 34px;
    position: relative;
}

.menu-style-classic .menu-sheet::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 6px);
    pointer-events: none;
}

.menu-style-classic .section-title::after {
    content: '✦';
    display: block;
    margin-top: 8px;
    font-size: 1rem;
    color: var(--accent);
}

.menu-style-classic .dish {
    padding: 16px 4px;
    border-bottom: 1px dashed var(--line);
    animation: rise 0.45s ease both;
}

.menu-style-classic .dish:last-child { border-bottom: none; }

.menu-style-classic .dish-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.menu-style-classic .dish-name { font-size: 1.12rem; }
.menu-style-classic .dish-price { font-size: 1.1rem; }

.menu-style-classic .dish-dots {
    flex: 1;
    align-self: center;
    height: 0;
    border-bottom: 2px dotted var(--line);
    margin: 0 4px;
}

.menu-style-classic .dish-desc {
    margin: 6px 0 0;
    font-size: 0.92rem;
    max-width: 92%;
}

/* ===================================================================
   STYLE 2 — MODERN (refined card grid)
   =================================================================== */
body.menu-style-modern { --maxw: 1100px; }

.menu-style-modern .menu-sheet { background: transparent; }
.menu-style-modern .dish-dots { display: none; }
.menu-style-modern .sheet-head { margin-bottom: 30px; }

.menu-style-modern .section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    margin: 12px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.menu-style-modern .dish-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.menu-style-modern .dish {
    position: relative;
    background: var(--surface);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, var(--surface)), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px 22px 28px;
    overflow: hidden;
    isolation: isolate;
    /* Staggered entrance (capped so long lists don't drag); honours rtl */
    animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(min(var(--i, 0), 9) * 45ms);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.28s ease,
                border-color 0.28s ease;
}

/* Accent bar (start edge) */
.menu-style-modern .dish::before {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Soft glow that fades in on hover */
.menu-style-modern .dish::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.menu-style-modern .dish:hover,
.menu-style-modern .dish:focus-within {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.menu-style-modern .dish:hover::before,
.menu-style-modern .dish:focus-within::before { width: 8px; }
.menu-style-modern .dish:hover::after,
.menu-style-modern .dish:focus-within::after { opacity: 1; }

.menu-style-modern .dish-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.menu-style-modern .dish-name {
    font-size: 1.18rem;
    line-height: 1.35;
    flex: 1;
}

.menu-style-modern .dish-price {
    flex: 0 0 auto;
    color: #fff;
    font-size: 0.98rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    padding: 6px 14px;
    border-radius: 50px;
    box-shadow: 0 5px 12px rgba(139, 30, 42, 0.32);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-style-modern .dish:hover .dish-price { transform: scale(1.06); }

.menu-style-modern .dish-desc { margin: 0; font-size: 0.93rem; line-height: 1.6; }

.menu-style-modern .is-unavailable {
    opacity: 0.72;
    filter: saturate(0.6);
}
.menu-style-modern .is-unavailable::before { background: var(--text-muted); }

/* ===================================================================
   STYLE 3 — MINIMAL (airy refined list)
   =================================================================== */
body.menu-style-minimal { --maxw: 680px; }

.menu-style-minimal .menu-sheet { background: transparent; }
.menu-style-minimal .dish-dots { display: none; }
.menu-style-minimal .sheet-head { margin-bottom: 34px; }

.menu-style-minimal .section-title {
    font-weight: 700;
    letter-spacing: 1px;
}

.menu-style-minimal .section-title::after {
    content: '';
    display: block;
    width: 38px;
    height: 2px;
    margin: 12px auto 0;
    background: var(--accent);
}

.menu-style-minimal .dish {
    padding: 22px 2px;
    border-bottom: 1px solid var(--border);
    animation: fade 0.5s ease both;
}

.menu-style-minimal .dish:last-child { border-bottom: none; }

.menu-style-minimal .dish-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.menu-style-minimal .dish-name { font-size: 1.1rem; font-weight: 600; }
.menu-style-minimal .dish-price { font-size: 1.05rem; font-weight: 700; }

.menu-style-minimal .dish-desc {
    margin: 8px 0 0;
    font-size: 0.9rem;
    max-width: 90%;
}

/* ===== Footer ===== */
footer[role="contentinfo"] {
    background: #1c0c0c;
    color: #f4ece9;
    padding: 40px 18px 28px;
    margin-top: 20px;
}

.footer-inner { max-width: 720px; margin: 0 auto; text-align: center; }

.delivery-info { font-size: 1rem; margin-bottom: 22px; color: #f0d9b8; }
.hours-icon { margin-inline-end: 6px; }

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.social-icons span { font-size: 0.95rem; opacity: 0.9; }

.social-icons a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, background 0.3s ease;
}

.social-icons a:hover { transform: translateY(-3px) scale(1.08); background: var(--brand); }
.social-icons a img { width: 22px; height: 22px; filter: brightness(0) invert(1); }

.map-address p { font-weight: 700; margin: 0 0 14px; }

.map-container {
    position: relative;
    width: 100%;
    padding-bottom: 56%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.map-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.copyright { font-size: 0.85rem; opacity: 0.6; margin: 0; }

/* ===== Floating WhatsApp ===== */
.fab-whatsapp {
    position: fixed;
    inset-block-end: 22px;
    inset-inline-start: 22px;
    z-index: 70;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
    animation: pulse 2.5s infinite;
    transition: transform 0.25s ease;
}

.fab-whatsapp:hover { transform: scale(1.1); }
.fab-whatsapp img { width: 30px; height: 30px; filter: brightness(0) invert(1); }

/* ===== Animations ===== */
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%   { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70%  { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5), 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero { min-height: 60vh; }
    .hero .logo { height: 100px; max-width: 82%; }
    .nav-chip { padding: 8px 18px; font-size: 0.9rem; }
    main { padding: 14px 14px 50px; }

    .menu-style-classic .menu-sheet { padding: 24px 18px 26px; }
    .menu-style-classic .menu-sheet::before { inset: 7px; }
    .menu-style-classic .dish-name { font-size: 1.05rem; }
    .menu-style-classic .dish-desc { max-width: 100%; }

    .menu-style-modern .dish-list { grid-template-columns: 1fr; }
    .menu-style-minimal .dish-desc { max-width: 100%; }

    .fab-whatsapp { width: 52px; height: 52px; inset-block-end: 16px; inset-inline-start: 16px; }
}
