/* ==========================================================================
   PAUSE A PARIS - SHARED FOUNDATION (design tokens + common components)
   --------------------------------------------------------------------------
   Loaded by index.html (menu) AND magasin.html (shop):
   a single source of truth for the brand, colours, typography,
   reset, loader, notifications and animations.
   1. Tokens (light / dark)
   2. Reset & base styles
   3. Forms & buttons
   4. Utilities
   5. Loader
   6. Notifications (toast)
   8. Reveal animations
   ========================================================================== */

/* ==========================================================================
   1. TOKENS - "PAUSE A PARIS" BRAND GUIDELINES
   --------------------------------------------------------------------------
   Official palette:
     - Pistachio / mint green #A8D5BA - #B2D8B6  (brand accent)
     - Charcoal / slate        #14201C - #1E2826  (premium contrast)
     - Review-star gold        #FFD700

   Usage rule (must be followed by every change):
     - Pistachio is RESERVED for brand accents: primary buttons
       (.btn-mint, add-to-cart, confirm actions), badges, active/selected
       states, decorative rules and the focus ring.
     - Text (titles, descriptions, prices, labels) and everyday icons
       stay NEUTRAL: white / light grey in dark mode, charcoal / slate
       grey in light mode - never tinted green.
     - Google review stars are gold (--star).
   Legacy variable names (--accent, --secondary-text, --background...) are
   kept: script.js uses them in inline styles.
   ========================================================================== */

:root {
    /* Typography */
    --font-display: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* --- Brand (pistachio): accents, badges, primary buttons --- */
    --mint: #A8D5BA;
    --mint-2: #B2D8B6;
    --mint-deep: #7FB894;
    --mint-grad: linear-gradient(135deg, #B2D8B6 0%, #A8D5BA 48%, #8CC7A1 100%);
    --ink-on-mint: #12211A;

    /* --- Brand (charcoal / slate) --- */
    --charcoal: #14201C;
    --charcoal-2: #1E2826;
    --charcoal-3: #2A3632;

    /* --- Light text & surfaces (neutral, no green tint) --- */
    --primary-text: #161D1B;
    --secondary-text: #576067;
    --background: #F6F7F7;
    --surface: #FFFFFF;
    --surface-2: #F0F2F3;
    --surface-3: #E6EAEC;
    --border-color: #E1E5E7;
    --border-strong: #C9D0D4;

    /* --- Brand accent for small elements (rules, focus) ---
       Darker pistachio: readable on light backgrounds. */
    --accent: #3F7F5F;
    --accent-light: rgba(168, 213, 186, 0.28);

    /* --- States --- */
    --success: #3F7F5F;
    --danger: #C0453F;
    --ink-invert: #F7FAF8;
    --on-dark: #FFFFFF;                      /* text on a dark background (video, charcoal) */
    --on-dark-2: rgba(255, 255, 255, 0.8);   /* secondary text on a dark background */

    /* --- Effects --- */
    --glass: rgba(246, 247, 247, 0.84);
    --overlay: rgba(11, 15, 16, 0.62);
    --star: #FFD700;                         /* review stars: gold */

    /* Shapes */
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 11px;
    --shell: 1180px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(20, 26, 28, 0.06);
    --shadow-s: 0 4px 16px -6px rgba(20, 26, 28, 0.16);
    --shadow-m: 0 16px 40px -18px rgba(20, 26, 28, 0.3);
    --shadow-l: 0 30px 70px -28px rgba(20, 26, 28, 0.45);
    /* Legacy aliases */
    --shadow: var(--shadow-s);
    --shadow-hover: var(--shadow-m);

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --nav-h: 62px;
    color-scheme: light;
}

body.dark-mode {
    --mint: #A8D5BA;
    --mint-2: #B2D8B6;
    --mint-deep: #8CC7A1;
    --ink-on-mint: #10201A;

    --charcoal: #0E1213;
    --charcoal-2: #161B1D;
    --charcoal-3: #20272A;

    /* High-contrast white / light-grey text, charcoal-slate surfaces */
    --primary-text: #FFFFFF;
    --secondary-text: #C5CCD1;
    --background: #0F1314;
    --surface: #161B1D;
    --surface-2: #1D2326;
    --surface-3: #252C30;
    --border-color: #2B3337;
    --border-strong: #3B454A;

    --accent: #A8D5BA;
    --accent-light: rgba(168, 213, 186, 0.16);

    --success: #8CC7A1;
    --danger: #E0706A;
    --ink-invert: #0F1513;
    --on-dark: #FFFFFF;
    --on-dark-2: rgba(255, 255, 255, 0.8);

    --glass: rgba(15, 19, 20, 0.84);
    --overlay: rgba(0, 0, 0, 0.72);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.42);
    --shadow-s: 0 4px 18px -6px rgba(0, 0, 0, 0.52);
    --shadow-m: 0 18px 44px -20px rgba(0, 0, 0, 0.75);
    --shadow-l: 0 30px 70px -28px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 14px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--primary-text);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
}

body.no-scroll {
    overflow: hidden;
}

img,
video,
svg,
canvas {
    display: block;
    max-width: 100%;
}

video {
    object-fit: cover;
    background: var(--charcoal);
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Discreet scrollbars */
[class*="scroll"]::-webkit-scrollbar,
.nav-container::-webkit-scrollbar,
.popular-carousel::-webkit-scrollbar,
.cart-items::-webkit-scrollbar,
.side-menu-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

::selection {
    background: var(--mint);
    color: var(--ink-on-mint);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Videos: the poster shows immediately, the video fades in once lazy
   loading injects it (script.js / magasin-script.js). */
.lazy-video {
    opacity: 0;
    transition: opacity 0.55s ease;
}

.lazy-video.loaded {
    opacity: 1;
}

/* ==========================================================================
   3. FORMS & BUTTONS
   ========================================================================== */

/* iPhone: Safari automatically zooms into any field whose font size is
   below 16px on focus. Every field (input, select, textarea) is therefore
   at least 16px - never go below that, even in a component override
   (verified by tools/check-compat.mjs). */
input,
textarea,
select {
    font: inherit;
    font-size: 16px;
    color: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--secondary-text);
    opacity: 0.72;
}

.btn-mint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 52px;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink-on-mint);
    background: var(--mint-grad);
    box-shadow: 0 18px 36px -18px rgba(127, 184, 148, 1);
    transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
}

.btn-mint:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.btn-mint:active {
    transform: scale(0.98);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 52px;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-text);
    background: var(--surface);
    border: 1px solid var(--border-color);
    transition: transform var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    color: var(--primary-text);
    background: var(--surface-2);
}

.btn-ghost:disabled,
.btn-mint:disabled,
.btn-mint[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--primary-text);
    transform: translateY(-1px);
}

/* ==========================================================================
   4. UTILITIES
   ========================================================================== */

.eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ==========================================================================
   5. LOADER (shared menu / shop)
   ========================================================================== */

.loader-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 32%, #1E2A26 0%, #141C19 55%, #0A0F0D 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loader-content {
    text-align: center;
    display: grid;
    gap: 1.1rem;
    justify-items: center;
}

.loader-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-size: clamp(1.7rem, 8vw, 2.6rem);
    font-weight: 700;
    /* Always light: the loader background is charcoal in both themes
       (--ink-invert became almost black in dark mode, hiding the title). */
    color: var(--on-dark);
    letter-spacing: 0.06em;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.loader-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeInUpLetter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.loader-title span:nth-child(1) { animation-delay: 0.04s; }
.loader-title span:nth-child(2) { animation-delay: 0.08s; }
.loader-title span:nth-child(3) { animation-delay: 0.12s; }
.loader-title span:nth-child(4) { animation-delay: 0.16s; }
.loader-title span:nth-child(5) { animation-delay: 0.20s; }
.loader-title span:nth-child(6) { animation-delay: 0.24s; }
.loader-title span:nth-child(7) { animation-delay: 0.28s; }
.loader-title span:nth-child(8) { animation-delay: 0.32s; }
.loader-title span:nth-child(9) { animation-delay: 0.36s; }
.loader-title span:nth-child(10) { animation-delay: 0.40s; }
.loader-title span:nth-child(11) { animation-delay: 0.44s; }
.loader-title span:nth-child(12) { animation-delay: 0.48s; }
.loader-title span:nth-child(13) { animation-delay: 0.52s; }

.loader-sub {
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--on-dark-2);
}

.loader-bar {
    width: 148px;
    height: 2px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.loader-bar-inner {
    width: 35%;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, var(--mint), transparent);
    animation: loaderSlide 1.1s ease-in-out infinite;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes loaderSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

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

/* ==========================================================================
   FOOTER SIGNATURE (shared: menu, shop)
   Last line of every footer, discreet and centered like the rest of
   the footer; only the link carries the brand accent on hover.
   ========================================================================== */

.footer-credit {
    font-size: 0.74rem;   /* same discreet size as the copyright line (style.css) */
    text-align: center;
    opacity: 0.75;
}

.footer-credit a {
    color: var(--accent);   /* signature green, readable on light backgrounds (shop) */
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--mint-deep);
    text-underline-offset: 3px;
}

.footer-credit a:hover {
    text-decoration-thickness: 2px;
}

/* ==========================================================================
   6. NOTIFICATIONS (TOAST)
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(6.4rem + env(safe-area-inset-bottom));
    z-index: 200;
    transform: translate(-50%, 120%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(92vw, 420px);
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    background: var(--primary-text);
    color: var(--background);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    box-shadow: var(--shadow-l);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s var(--ease-spring), opacity var(--transition);
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast i {
    color: var(--mint);
}

/* Dark mode: the toast is light, so a dark pistachio icon stays readable */
body.dark-mode .toast i {
    color: #3F7F5F;
}

/* ==========================================================================
   7. MODALS, CART & CHECKOUT FLOW (shared components)
   --------------------------------------------------------------------------
   These shared components are used by the menu's modals, cart and checkout.
   ========================================================================== */

/* ==========================================================================
   11. MODALS
   ========================================================================== */

.modal-overlay,
.order-popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 1.1rem;
    background: var(--overlay);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.active,
.order-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content,
.order-popup-content {
    position: relative;
    width: 100%;
    max-width: 460px;
    width: min(100%, 460px);
    max-height: 88vh;
    max-height: 88svh;
    overflow-y: auto;
    padding: 1.35rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-l);
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
}

.modal-overlay.active .modal-content,
.order-popup-overlay.active .order-popup-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   DETAIL MODAL VIDEO - CARD FORMAT (4/5)
   The modal uses exactly the 4/5 framing of the menu cards
   (.popular-card video, style.css): no stretching, no overflow.
   The video shown is the card's own element, moved as-is (script.js),
   so nothing is re-downloaded when the modal opens.
   -------------------------------------------------------------------------- */
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 430px;
    width: min(100%, 430px);
}

.modal-video-wrap {
    position: relative;
    flex: 0 0 auto;                /* never compressed by the rest of the modal */
    width: 100%;
    /* STRICTLY 4/5 frame (same as the cards): the width (max 360px) is also
       bounded by the available height (56% of the viewport x 4/5).
       The height therefore always follows from the ratio: a max-height
       would crop the height without narrowing the width, distorting the frame. */
    max-width: 360px;
    max-width: min(360px, calc(56vh * 4 / 5));
    max-width: min(360px, calc(56svh * 4 / 5));
    aspect-ratio: 4 / 5;
    margin: 0 auto 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--charcoal);
    box-shadow: var(--shadow-m);
}

.modal-video-wrap[hidden] {
    display: none;
}

.modal-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
    opacity: 1;
    background: var(--charcoal);
}

/* Hide any native controls that could break the framing */
.modal-content video::-webkit-media-controls,
.modal-content video::-webkit-media-controls-panel,
.modal-content video::-webkit-media-controls-play-button {
    display: none !important;
    -webkit-appearance: none;
}

.modal-content h3,
.modal-content p {
    width: 100%;
    padding-inline: 0.35rem;
    text-align: center;
}

.modal-content h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--secondary-text);
    line-height: 1.65;
}

.close-modal,
.close-order-popup,
.close-boisson-popup {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 4;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--secondary-text);
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.close-modal:hover,
.close-order-popup:hover,
.close-boisson-popup:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

/* --- Included drink popup --- */
.order-popup-header {
    padding-right: 2.4rem;
    margin-bottom: 1rem;
}

.order-popup-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.order-popup-header h3 i {
    color: var(--primary-text);
}

.boisson-subtitle {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--secondary-text);
}

.boisson-options {
    display: grid;
    gap: 0.5rem;
}

.boisson-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    transition: background-color var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}

.boisson-option i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--surface);
    color: var(--primary-text);
    font-size: 0.85rem;
    transition: background-color var(--transition), color var(--transition);
}

.boisson-option:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    transform: translateX(2px);
}

.boisson-option.selected {
    background: var(--mint-grad);
    border-color: transparent;
    color: var(--ink-on-mint);
    font-weight: 700;
}

.boisson-option.selected i {
    background: rgba(27, 20, 16, 0.18);
    color: var(--ink-on-mint);
}

.skip-boisson-btn {
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text);
    background: transparent;
    border: 1px dashed var(--border-color);
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.skip-boisson-btn:hover {
    color: var(--primary-text);
    border-color: var(--border-strong);
    background: var(--surface-2);
}

/* --- Quantity / comment popup --- */
.popup-item-price {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    font-size: 0.85rem;
    font-weight: 700;
}

.order-popup-body {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    justify-self: center;
    padding: 0.3rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
}

.qty-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary-text);
    box-shadow: var(--shadow-xs);
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.qty-btn:hover {
    background: var(--primary-text);
    color: var(--surface);
}

.qty-btn:active {
    transform: scale(0.92);
}

.qty-value {
    min-width: 44px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#popup-comment {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    font-size: 16px;               /* 16px minimum: no automatic zoom on iPhone */
    line-height: 1.45;
    -webkit-appearance: none;
    appearance: none;
    resize: vertical;
    min-height: 74px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

#popup-comment::placeholder {
    color: var(--secondary-text);
    opacity: 0.75;
}

#popup-comment:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.add-to-cart-btn {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink-on-mint);
    background: var(--mint-grad);
    box-shadow: 0 16px 32px -18px rgba(168, 213, 186, 1);
    transition: transform var(--transition), filter var(--transition);
}

.add-to-cart-btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   12. CART & CHECKOUT FLOW
   ========================================================================== */

.cart-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 110;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    touch-action: none;            /* swiping on the overlay must not scroll the page */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    z-index: 130;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    max-height: 92svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;              /* scrolling happens inside .cart-body */
    overscroll-behavior: contain;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-l);
    transform: translateY(102%);
    /* Closed = hidden after the animation: its shadow no longer spills
       over the screen edge (bottom on mobile, right on desktop) and its
       fields are no longer keyboard-reachable. */
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
}

.cart-panel.open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

/* Scrolling cart body (menu): order type + customer details + items
   scroll as one smooth block, while the header and footer (total +
   confirm button) stay visible. Essential on small screens (iPhone SE
   etc.) and when the keyboard is open. */
.cart-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-padding-top: 0.75rem;
    scroll-padding-bottom: 1.25rem;
}

.cart-body .cart-items {
    flex: none;
    overflow: visible;
    padding-bottom: 1.15rem;
}

.cart-panel::before {
    content: '';
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: var(--border-color);
    margin: 0.6rem auto 0.2rem;
    flex: 0 0 auto;
}

.cart-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.15rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-header h3 i {
    color: var(--primary-text);
    font-size: 1rem;
}

.close-cart {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--secondary-text);
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.close-cart:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

.order-type-section {
    padding: 0.9rem 1.15rem 0.3rem;
}

.order-type-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.order-type-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
}

.order-type-btn {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.35rem;
    border-radius: 11px;
    border: 1px solid transparent;   /* no 1px shift when the tab becomes active */
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--secondary-text);
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.order-type-btn i {
    font-size: 0.95rem;
}

.order-type-btn:hover {
    color: var(--primary-text);
}

.order-type-btn.active {
    background: var(--surface);
    color: var(--primary-text);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}

.order-type-btn.active i {
    color: var(--accent);
}

.order-fields {
    padding: 0.6rem 1.15rem 0;
}

.order-field-group {
    display: none;
    gap: 0.4rem;
}

.order-field-group.active {
    display: grid;
}

.order-field-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.order-field-group label i {
    color: var(--secondary-text);
    font-size: 0.72rem;
}

.order-field-group input,
.order-field-group textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;                  /* iOS: the time field no longer overflows to the right */
    min-height: 48px;
    padding: 0.72rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    font-size: 16px;               /* 16px minimum: no automatic zoom on iPhone */
    line-height: 1.4;
    -webkit-appearance: none;      /* removes the native iOS inner shadow / rounding */
    appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.order-field-group textarea {
    resize: vertical;              /* never horizontally: no sideways overflow */
    min-height: 84px;
}

/* iOS centers the time field value and forces a minimum width on it:
   align it left like the other fields. */
.order-field-group input[type="time"] {
    text-align: left;
}

.order-field-group input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
}

.order-field-group input::placeholder,
.order-field-group textarea::placeholder {
    color: var(--secondary-text);
    opacity: 0.7;
}

.order-field-group input:focus,
.order-field-group textarea:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.order-field-group input.error,
.order-field-group textarea.error {
    border-color: var(--danger);
    background: rgba(214, 69, 69, 0.06);
    box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12);
}

.cart-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.85rem 1.15rem;
    display: grid;
    gap: 0.5rem;
    align-content: start;
}


/* Menu cart count badge */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(192, 69, 63, 0.5);
}

/* Menu cart open button */
.cart-float {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(1.1rem + env(safe-area-inset-bottom));
    z-index: 70;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ink-on-mint);
    background: var(--mint-grad);
    font-size: 1.2rem;
    box-shadow: 0 18px 38px -16px rgba(127, 184, 148, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
    transition: transform var(--transition), box-shadow var(--transition);
}

.cart-float:hover {
    transform: translateY(-3px) scale(1.04);
}

.cart-float:active {
    transform: scale(0.96);
}

.cart-empty {
    padding: 2.2rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--secondary-text);
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    animation: cartItemIn 0.32s var(--ease-spring) both;
}

.cart-item-info {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.cart-item-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.cart-item-comment {
    font-size: 0.76rem;
    color: var(--secondary-text);
}

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

.cart-item-remove {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 0.78rem;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.cart-item-remove:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    transform: scale(1.06);
}


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

/* Menu cart footer */
.cart-footer .btn-mint,
.cart-footer .btn-ghost {
    width: 100%;
}

.cart-footer {
    flex: 0 0 auto;
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    background: var(--surface);
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.cart-total > span:last-child {
    text-align: right;
    font-size: 1.05rem;
    color: var(--primary-text);
}

/* Cart drawer: full-screen on mobile, side panel on desktop */
@media (min-width: 992px) {
    .cart-panel {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        width: 92vw;
        max-width: 430px;
        width: min(430px, 92vw);
        max-height: none;
        border-radius: var(--radius-xl) 0 0 var(--radius-xl);
        border-top: none;
        border-left: 1px solid var(--border-color);
        transform: translateX(102%);
    }

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

    .cart-panel::before {
        display: none;
    }

    .cart-header {
        padding-top: 1.3rem;
    }
}

/* ==========================================================================
   8. REVEAL ANIMATIONS
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}


/* ==========================================================================
   LEGACY BROWSER COMPATIBILITY
   --------------------------------------------------------------------------
   Everything below applies ONLY to browsers that do not support modern
   properties. On modern browsers these rules are ignored and the design
   stays exactly as specified by the brand guidelines.

   Main case: the menu video must keep a 4/5 frame (same as the cards).
   Without aspect-ratio support (Safari 14 and older, Chrome 87 and
   older, legacy in-app browsers), the frame would collapse to zero
   height: it is rebuilt with proportional padding (5 / 4 = 125%) and the
   video is positioned inside it - never stretched, never squashed.
   ========================================================================== */

@supports not (aspect-ratio: 4 / 5) {
    .modal-video-wrap {
        height: 0;
        padding-top: 125%;
        max-height: none;
    }

    .video-placeholder {
        height: 0;
        padding-bottom: 125%;
    }

    .modal-video-wrap video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}
