/* ============================================================
   MIDNIGHT BITES DESIGN SYSTEM  (css/main.css)
   Shared by every page: colors, fonts, nav, footer, buttons,
   cards and animations. Page-specific rules live in css/<page>.css
   ------------------------------------------------------------
   Theme: dark, matte, softly textured - built for night owls.
   Fonts: "Sora" for headings, "Plus Jakarta Sans" for body text.
   ============================================================ */

/* ---------- 1. Design tokens (CSS variables) ---------- */
/* "Midnight kitchen" palette: late-night warmth in food colours -
   espresso-brown surfaces, streetlight amber, and leafy herb green.
   Rich and appetising, nothing cold or synthetic. */
:root {
    /* Surfaces, darkest to lightest (burnt-tandoori red-browns) */
    --bg-0: #170b07;            /* page background */
    --bg-1: #211008;            /* raised sections */
    --bg-2: #2b150b;            /* cards */
    --bg-3: #3b1e0f;            /* card hover */

    /* Text */
    --cream: #f4efe4;           /* main text (warm, like candlelight) */
    --muted: #bda694;           /* secondary text (warm clay) */

    /* Accents */
    --amber: #ffa733;           /* primary brand accent - the streetlight */
    --amber-deep: #e88f14;
    --amber-soft: rgba(255, 167, 51, 0.13);
    --herb: #a8d07c;            /* secondary accent - leafy herb green */
    --herb-soft: rgba(168, 208, 124, 0.13);
    --mint: #a8d07c;            /* "open now" shares the leafy green */
    --chili: #ff7a5c;           /* chili / tomato coral */
    --chili-soft: rgba(255, 122, 92, 0.14);
    --butter: #ffd98a;          /* butter / saffron gold */
    --butter-soft: rgba(255, 217, 138, 0.13);

    /* Borders & radii - gently rounded, like a gourmet plate */
    --line: rgba(242, 233, 216, 0.1);
    --radius: 10px;
    --radius-lg: 14px;

    /* Fonts */
    --font-display: 'Sora', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* ---------- 2. Base reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-0);
    color: var(--cream);
    line-height: 1.5;
}

/* Subtle grain texture for the matte dark surfaces */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 220px 220px;
    mix-blend-mode: overlay;
}

/* Candlelight glow: a warm amber pool from above (the streetlight) and
   a faint ember warmth from the corner. This ambient layer is what makes
   every page feel like a late-night kitchen, not a cold app. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(110% 60% at 80% -10%, rgba(255, 167, 51, 0.09), transparent 60%),
        radial-gradient(70% 50% at -10% 8%, rgba(196, 92, 35, 0.08), transparent 55%);
}

/* Everything sits above the grain layer */
body > * {
    position: relative;
    z-index: 2;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

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

/* Text selection picks up the streetlight amber */
::selection {
    background: var(--amber);
    color: #1a1207;
}

/* Visible keyboard-focus ring (mouse clicks don't trigger it) */
:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Slim night-mode scrollbar on desktop browsers */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
    background: var(--bg-3);
    border-radius: 10px;
    border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: #4a2413; }

/* ---------- 3. Buttons & chips ---------- */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 24px rgba(255, 167, 51, 0.25); }
    50% { box-shadow: 0 10px 28px rgba(255, 167, 51, 0.34), 0 0 0 4px rgba(255, 167, 51, 0.12); }
}

.btn,
.chip,
.filter-btn,
.nav-link,
.nav-menu a,
.nav-icon-btn,
.nav-burger,
.drawer-link,
.clear-search,
.nav-logout-btn,
.nav-user-chip {
    position: relative;
    overflow: visible;
    margin: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 15px 32px;
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-amber {
    background-color: var(--amber);
    color: #1a1207;
    box-shadow: 0 8px 24px rgba(255, 167, 51, 0.25);
    animation: pulseGlow 2.8s ease-in-out infinite;
}

.btn-amber:hover {
    background-color: var(--amber-deep);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 28px rgba(255, 167, 51, 0.35);
    animation: none;
}

.btn-ghost {
    background-color: transparent;
    color: var(--cream);
    border: 1.5px solid var(--line);
}

.btn-ghost:hover {
    border-color: var(--amber);
    color: var(--amber);
    transform: translateY(-2px) scale(1.01);
}

/* Loading spinner shown inside buttons during a submit */
.btn.is-loading { opacity: 0.85; cursor: wait; }

.btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(26, 18, 7, 0.35);
    border-top-color: #1a1207;
    border-radius: 50%;
    animation: mbSpin 0.6s linear infinite;
}

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

/* Tactile press feedback on interactive elements */
.btn:active { transform: scale(0.97); }
.chip:active,
.nav-icon-btn:active,
.nav-burger:active { transform: scale(0.94); }

/* Squash-and-release bounce, played in sync with the click "tock" */
@keyframes mbTap {
    0% { transform: scale(1); }
    35% { transform: scale(0.955); }
    70% { transform: scale(1.015); }
    100% { transform: scale(1); }
}
.mb-tap { animation: mbTap 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--herb);
    color: var(--cream);
    transform: translateY(-2px) scale(1.01);
}

.chip.active {
    background: var(--amber);
    border-color: var(--amber);
    color: #1a1207;
}

/* ---------- 4. Navbar (same markup on every page) ---------- */
/* Three columns: logo on the left, menu centred, login on the right.
   The 1fr / auto / 1fr grid keeps the menu dead-centre no matter how
   wide the logo or login button are. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    transition: transform 0.24s ease;
    will-change: transform;
}

.topbar.nav-hidden {
    transform: translateY(-100%);
}

.navbar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 17px 56px;
    isolation: isolate;
    border-bottom: 1px solid var(--line);
}

/* The frosted-glass effect lives on its own layer behind the nav content.
   Applying backdrop-filter directly to .navbar can blur its children (a
   known Safari/Android rendering bug when a filtered element also has a
   descendant with a transform, e.g. the burger's :active scale) - keeping
   it on a separate ::before guarantees the logo/menu/burger stay crisp. */
.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(23, 11, 7, 0.9);
    box-shadow: inset 0 -1px 0 rgba(242, 238, 227, 0.05);
}

.navbar .logo { justify-self: start; }     /* left column */
.nav-menu { justify-self: center; }        /* centre column */
.navbar .nav-link,
.navbar .nav-account { justify-self: end; } /* right column */

.navbar .logo a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cream);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: 0.06em;
}

.navbar .logo img {
    height: 48px;
    width: 48px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-menu a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--cream);
    background: rgba(242, 238, 227, 0.06);
    transform: translateY(-1px) scale(1.01);
}

.nav-menu a.current {
    color: var(--amber);
    background: var(--amber-soft);
}

.nav-link {
    color: #1a1207;
    background: var(--amber);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    background: var(--amber-deep);
    transform: translateY(-1px) scale(1.01);
}

/* Logged-in state, rendered by js/site.js */
.nav-account {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--amber);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--amber-soft);
    border: 1px solid rgba(255, 167, 51, 0.4);
}

.nav-logout-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cream);
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 9px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-logout-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
    transform: translateY(-1px) scale(1.01);
}

/* ---------- 5. Section shells ---------- */
.section {
    padding: 96px 56px;
}

.section.alt {
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 56px auto;
}

.section-head .eyebrow {
    display: inline-block;
    color: var(--herb);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 14px;
}

.section-head p {
    font-size: 1.02rem;
    color: var(--muted);
    line-height: 1.65;
}

/* Centered intro header used by inner pages (Stories, About, FAQ...) */
.page-hero {
    text-align: center;
    padding: 92px 28px 64px 28px;
    max-width: 760px;
    margin: 0 auto;
}

.page-hero .eyebrow {
    display: inline-block;
    color: var(--herb);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.page-hero h1 {
    font-size: clamp(2rem, 4.4vw, 3.1rem);
    font-weight: 800;
    margin-bottom: 14px;
}

.page-hero p {
    font-size: 1.04rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ---------- 6. Cards ---------- */
.card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 167, 51, 0.45);
    background: var(--bg-3);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 167, 51, 0.1);
}

/* Star rating pill used across cards */
.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cream);
    background: rgba(242, 238, 227, 0.07);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 10px;
    flex-shrink: 0;
}

.rating-pill svg {
    color: var(--amber);
}

/* "Open until" pill overlaid on photos */
.badge-hours {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(23, 11, 7, 0.82);
    backdrop-filter: blur(4px);
    color: var(--mint);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 10px;
    border: 1px solid rgba(168, 208, 124, 0.35);
}

/* ---------- 7. Scroll-reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

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

/* ---------- 8. Footer (same markup on every page) ---------- */
.footer {
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    padding: 82px 56px 38px 56px;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
    flex-wrap: wrap;
}

.footer-brand h3 a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cream);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.footer-brand img {
    height: 46px;
    width: 46px;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 280px;
    line-height: 1.6;
    margin: 12px 0 20px 0;
}

.social-icons {
    display: flex;
    gap: 14px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--muted);
    transition: all 0.2s ease;
}

.social-icons a:hover {
    color: var(--herb);
    border-color: var(--herb);
    transform: translateY(-2px);
}

.footer-links {
    display: flex;
    gap: 64px;
    flex-wrap: wrap;
}

.footer-column h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--herb);
    margin-bottom: 16px;
}

/* Each footer column gets its own food colour */
.footer-links .footer-column:nth-child(2) h4 { color: var(--butter); }
.footer-links .footer-column:nth-child(3) h4 { color: var(--chili); }

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--cream);
    opacity: 0.85;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-column ul li a:hover {
    color: var(--amber);
    opacity: 1;
}

.footer-bottom {
    max-width: 1200px;
    margin: 46px auto 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------- 9. Right-side nav controls (built by js/site.js) ---------- */
.nav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--cream);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-icon-btn:hover {
    color: var(--amber);
    border-color: var(--amber);
}

/* Heart icon fills solid amber once the visitor has 1+ saved restaurants */
.nav-fav-btn.has-favs {
    color: var(--amber);
    border-color: var(--amber);
    background: rgba(255, 167, 51, 0.12);
}
.nav-fav-btn.has-favs svg { fill: var(--amber); }

.drawer-saved.has-favs { color: var(--amber); }

.nav-fav-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--amber);
    color: #1a1207;
    font-size: 0.64rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Hamburger button - hidden on desktop, shown on mobile */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    padding: 0 11px;
    touch-action: manipulation;
}

.nav-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--cream);
    border-radius: 2px;
    transition: transform 0.25s ease;
}

/* Navbar shrinks a touch once you start scrolling */
.navbar.scrolled {
    padding-top: 9px;
    padding-bottom: 9px;
}
.navbar.scrolled::before {
    background: rgba(23, 11, 7, 0.94);
}

/* ---------- 10. Mobile slide-in drawer ---------- */
.mb-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
    pointer-events: none;
}

.mb-drawer.open {
    visibility: visible;
    pointer-events: auto;
}

.mb-drawer .drawer-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;                 /* below the panel - it must never cover the menu */
    background: rgba(16, 7, 4, 0.72);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mb-drawer.open .drawer-scrim { opacity: 1; }

.mb-drawer .drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;                 /* above the scrim so links stay sharp and tappable */
    height: 100%;
    width: min(320px, 84vw);
    background: var(--bg-1);
    border-left: 1px solid var(--line);
    border-radius: 14px 0 0 14px;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.55);
    padding: 22px 20px calc(26px + env(safe-area-inset-bottom, 0px)) 20px;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

.mb-drawer.open .drawer-panel { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.drawer-title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--cream);
    cursor: pointer;
}

.drawer-close:active { transform: scale(0.92); }

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 14px;
    border-radius: 12px;
    color: var(--cream);
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Chevron affordance so drawer items clearly read as tappable */
.drawer-links .drawer-link::after {
    content: '\203A';
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    opacity: 0.7;
}

.drawer-link-label {
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.drawer-ico {
    display: inline-flex;
    color: var(--amber);
    opacity: 0.9;
}

/* The drawer menu cycles through the food palette */
.drawer-links .drawer-link:nth-child(2) .drawer-ico { color: var(--herb); }
.drawer-links .drawer-link:nth-child(3) .drawer-ico { color: var(--chili); }
.drawer-links .drawer-link:nth-child(4) .drawer-ico { color: var(--butter); }
.drawer-links .drawer-link:nth-child(5) .drawer-ico { color: var(--herb); }

.drawer-saved .drawer-ico { color: inherit; }

.drawer-link:hover,
.drawer-link:active { background: rgba(242, 238, 227, 0.06); }

.drawer-link.current { color: var(--amber); background: var(--amber-soft); }

.drawer-saved {
    margin-top: 8px;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding-top: 18px;
    color: var(--muted);
}

.drawer-fav-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--amber);
    color: #1a1207;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.drawer-foot {
    margin-top: auto;
    padding-top: 22px;
}

.drawer-login,
.drawer-foot .btn { width: 100%; justify-content: center; }

.drawer-account {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-account span {
    color: var(--amber);
    font-weight: 700;
    text-align: center;
}

/* ---------- 11. Toast notifications ---------- */
#mb-toast-host {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}

.mb-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 10px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--cream);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.94);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mb-toast.show { opacity: 1; transform: translateY(0) scale(1); }

.mb-toast-icon { display: inline-flex; }
.mb-toast.success .mb-toast-icon { color: var(--mint); }
.mb-toast.info .mb-toast-icon { color: var(--amber); }
.mb-toast.fav .mb-toast-icon { color: var(--amber); }

/* The success icon swings like the pass bell it sounds like */
@keyframes mbBellSwing {
    0% { transform: rotate(0); }
    20% { transform: rotate(14deg); }
    45% { transform: rotate(-10deg); }
    70% { transform: rotate(5deg); }
    100% { transform: rotate(0); }
}
.mb-toast.success .mb-toast-icon { animation: mbBellSwing 0.7s ease 0.15s; transform-origin: top center; }

/* Sound toggle: dimmed when muted */
.nav-sound-btn.is-muted { color: var(--muted); opacity: 0.75; }

/* ---------- 12. Back-to-top floating button ---------- */
.mb-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--amber);
    color: #1a1207;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(255, 167, 51, 0.4);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.mb-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.mb-to-top:hover { background: var(--amber-deep); transform: translateY(-3px) scale(1.05); }

/* ---------- 13. Favourite heart button (cards & restaurant pages) ---------- */
.fav-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(23, 11, 7, 0.72);
    backdrop-filter: blur(4px);
    color: var(--cream);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fav-heart:hover { transform: scale(1.12); color: var(--amber); border-color: var(--amber); }
.fav-heart.is-fav { color: var(--amber); border-color: var(--amber); }
.fav-heart.is-fav svg { fill: var(--amber); }

@keyframes heartPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.fav-heart.pop { animation: heartPop 0.35s ease; }

/* ---------- 14. Responsive breakpoints ---------- */
/* Cap ultra-wide screens so lines don't stretch too far */
@media (min-width: 1600px) {
    .section > .section-head,
    .steps-grid, .cuisine-grid, .featured-grid, .testimonial-grid { max-width: 1280px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 900px) {
    /* Flex (not grid) on mobile: logo left, controls right, no empty centre column */
    .navbar {
        display: flex;
        justify-content: space-between;
        padding: 12px 18px;
        transition: padding 0.24s ease;
    }
    .nav-menu { display: none; }
    .nav-burger { display: flex; }
    /* Smaller icon buttons free up room; the extra gap keeps them from feeling cramped */
    .nav-right { gap: 10px; }
    .nav-icon-btn,
    .nav-burger { width: 38px; height: 38px; }
    /* On mobile the login / account and fav icon live in the drawer instead */
    .nav-right .nav-fav-btn,
    .navbar .nav-link,
    .navbar .nav-account { display: none; }
    .section, .footer { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 576px) {
    /* Smaller type + still generous spacing between blocks on phones */
    .section {
        padding-top: 80px;
        padding-bottom: 80px;
        padding-left: 24px;
        padding-right: 24px;
    }
    .section-head { margin-bottom: 44px; }
    .section-head h2 { font-size: clamp(1.5rem, 6vw, 1.9rem); }
    .section-head p { font-size: 0.94rem; }
    .page-hero { padding: 56px 24px 44px 24px; }
    .page-hero h1 { font-size: clamp(1.7rem, 8vw, 2.3rem); }
    .page-hero p { font-size: 0.96rem; }
    .btn { padding: 13px 24px; font-size: 0.92rem; }
    .chip { padding: 7px 14px; font-size: 0.82rem; }

    .footer { padding: 56px 24px 34px 24px; }
    .footer-grid { gap: 34px; }
    /* Bigger, more legible footer links on phones (survey feedback) */
    .footer-column ul li a { font-size: 1rem; }
    .footer-column ul li { margin-bottom: 13px; }
    .footer-bottom { font-size: 0.86rem; margin-top: 36px; }

    .mb-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
    #mb-toast-host { bottom: 84px; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}
