/*
 * Foglio di stile del Kiosk — recuperato dal sistema legacy
 * (legacy/kiosk.assodoro.com/public_html/index.html), mai portato nella
 * riscrittura TypeScript.
 */
    /* Ponte col tema dinamico, stesso schema di POS/KDS: nomi di variabile
       identici al legacy, ma scoped su [data-assodoro-theme-root] (dove
       ThemeProvider mette le sue variabili) invece che su :root statico. */
    [data-assodoro-theme-root] {
      --primary: var(--md-primary);
      --on-primary: var(--md-on-primary);
      --bg: var(--md-bg);
      --surface: var(--md-surface);
      /* Letterale come nel legacy (vedi nota in fondo al file). */
      --surface2: #221817;
      --surface3: #2e2120;
      --text: var(--md-on-surface);
      /* Il legacy NON tematizzava questa variabile: era il letterale qui
         sotto. Agganciarla a `--md-outline` l'ha resa il colore dei BORDI,
         che nel tema di produzione e' un grigio scuro (#605D66): il testo
         secondario e' cosi' sceso a ~2.9:1 di contrasto, sotto la soglia di
         leggibilita', su ogni schermata di questa app. */
      --muted: #c4aeab;
      /* Anche questa era letterale nel legacy. Sul totem quasi ogni bordo
         e' spesso 2-3px: col grigio del tema il totem diventava un
         reticolo di contorni invece di card morbide su fondo scuro. */
      --outline: #3a2927;
      --success: #4CAF50;
      --error: #F28B82;
      --error-bg: #3C1A18;
      --warning: #FFBE55;
      --radius: 18px;
      --radius-lg: 24px;
      --shadow: 0 4px 24px rgba(0,0,0,.4);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    html, body { height: 100%; overflow: hidden; }
    /* var(--x, fallback): stesso motivo di POS/KDS — le variabili sono
       su un div DENTRO <body>, non visibili a <body> stesso. */
    body { font-family: var(--assodoro-font, 'Montserrat', sans-serif); background: var(--md-bg, #100c0b); color: var(--md-on-surface, #f0e8e5); user-select: none; }
    /* Il reset originale (font-family + cursor) non bastava: un testo senza
       colore proprio dentro un bottone (es. .prod-name in .prod-card)
       ereditava il nero di default del browser invece del colore del tema —
       bug reale trovato verificando dal vivo (rgb(0,0,0) contro sfondo
       scuro). Le classi specifiche vincono comunque per specificità. */
    button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; text-align: center; cursor: pointer; padding: 0; appearance: none; -webkit-appearance: none; }

    /* I <button> tornano a centrare il proprio contenuto, che e' il
       comportamento nativo: il reset qui sopra lo aveva sostituito con
       `inherit`, quindi ogni bottone piu' largo della propria etichetta la
       mostrava incollata a sinistra (misurato: "Procedi al Pagamento" sfalsato
       di 41px in un bottone da 307px). Le poche eccezioni sono i bottoni usati
       come SCHEDA, dove il testo e' un blocco su piu' righe e va a bandiera. */
    .prod-card, .ing-item { text-align: left; }

    /* ====== TRANSITIONS ====== */
    .screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; }
    .screen-enter { animation: fadeSlideIn .3s ease forwards; }
    @keyframes fadeSlideIn { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }

    /* ====== BOOT / LOADING ====== */
    .boot-screen {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 100vh; gap: 1.5rem; text-align: center; padding: 2rem;
    }
    .boot-logo { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
    .spinner { width: 48px; height: 48px; border: 4px solid var(--outline); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .boot-error { color: var(--error); font-size: .95rem; max-width: 340px; line-height: 1.5; }
    .retry-btn {
      background: var(--primary); color: var(--on-primary); border: none; border-radius: 100px;
      padding: .9rem 2.5rem; font-size: 1rem; font-weight: 700;
    }

    /* ====== WELCOME ====== */
    .welcome {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 100vh; gap: 2.8rem; padding: 4rem 3rem; text-align: center;
      background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(157,32,35,.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 110%, rgba(157,32,35,.1) 0%, transparent 60%);
    }
    .welcome-logo {
      font-size: 4.5rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em;
      line-height: 1;
    }
    .welcome-logo img { height: 140px; object-fit: contain; filter: brightness(0) invert(1); }

    .welcome-orb {
      width: 160px; height: 160px; border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, rgba(157,32,35,.5) 0%, rgba(157,32,35,.08) 60%, transparent 80%);
      border: 1.5px solid rgba(157,32,35,.25);
      display: flex; align-items: center; justify-content: center;
      font-size: 5.5rem; line-height: 1;
      box-shadow: 0 0 60px rgba(157,32,35,.15), inset 0 1px 0 rgba(255,255,255,.06);
      animation: orb-float 4s ease-in-out infinite;
    }
    @keyframes orb-float {
      0%,100% { transform: translateY(0) scale(1); box-shadow: 0 0 60px rgba(157,32,35,.15); }
      50% { transform: translateY(-10px) scale(1.03); box-shadow: 0 16px 60px rgba(157,32,35,.25); }
    }

    .welcome-sub {
      font-size: 1.5rem; color: var(--muted);
      max-width: 480px; line-height: 1.55;
      font-weight: 400;
    }
    .start-btn {
      background: var(--primary); color: var(--on-primary); border: none; border-radius: 24px;
      padding: 2rem 6rem; font-size: 1.75rem; font-weight: 800; letter-spacing: .01em;
      box-shadow: 0 8px 48px rgba(157,32,35,.45), 0 2px 0 rgba(255,255,255,.08) inset;
      transition: transform .12s, box-shadow .12s; min-width: 380px;
      position: relative; overflow: hidden;
    }
    .start-btn::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
      background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 100%);
      border-radius: 24px 24px 0 0; pointer-events: none;
    }
    .start-btn::after {
      content: ''; position: absolute; inset: 0; border-radius: inherit;
      background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.28) 50%, transparent 80%);
      background-size: 300% 100%; background-position: 300% 0;
      animation: shimmer 2.8s ease-in-out infinite;
    }
    @keyframes shimmer { 0%,50% { background-position: 300% 0; } 100% { background-position: -300% 0; } }
    .start-btn:active { transform: scale(.96); box-shadow: 0 4px 24px rgba(157,32,35,.4); }
    .welcome-footer { font-size: .95rem; color: var(--muted); opacity: .45; animation: blink 2.5s ease-in-out infinite; }
    @keyframes blink { 0%,100%{opacity:.25;} 50%{opacity:.6;} }

    /* ====== ORDER TYPE ====== */
    .order-type-screen {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 100vh; gap: 2.5rem; padding: 3rem 2rem; text-align: center;
    }
    .screen-heading { font-size: 1.9rem; font-weight: 700; }
    .screen-sub { color: var(--muted); font-size: 1rem; margin-top: .3rem; }
    .type-cards { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
    .type-card {
      background: var(--surface); border: 3px solid var(--outline); border-radius: var(--radius-lg);
      padding: 2.5rem 3rem; display: flex; flex-direction: column; align-items: center; gap: 1rem;
      min-width: 190px; cursor: pointer; transition: all .15s;
    }
    .type-card:active { transform: scale(.96); }
    .type-card.selected { border-color: var(--primary); background: rgba(157,32,35,.07); }
    .type-icon { font-size: 3.5rem; }
    .type-label { font-size: 1.3rem; font-weight: 700; }
    .type-desc { font-size: .88rem; color: var(--muted); }

    /* ====== BUTTONS ====== */
    .continue-btn {
      background: var(--primary); color: var(--on-primary); border: none; border-radius: 9999px;
      padding: 1.3rem 3.5rem; font-size: 1.25rem; font-weight: 700; min-width: 280px;
      transition: all .15s; box-shadow: 0 4px 20px rgba(157,32,35,.3);
    }
    .continue-btn:disabled { opacity: .3; pointer-events: none; }
    .continue-btn:active { transform: scale(.97); }
    .back-btn {
      background: transparent; color: var(--muted); border: 2px solid var(--outline);
      border-radius: 100px; padding: .9rem 2.5rem; font-size: 1.05rem; font-weight: 500; transition: all .15s;
    }
    .back-btn:active { opacity: .6; }
    .btn-row { display: flex; flex-direction: column; gap: .75rem; align-items: center; }

    /* ====== TOPBAR ====== */
    .topbar {
      background: var(--surface); padding: 1.25rem 2rem; display: flex; align-items: center;
      gap: 1.25rem; border-bottom: 2px solid var(--outline); position: sticky; top: 0; z-index: 50;
    }
    .topbar-back { background: transparent; border: 2px solid var(--outline); color: var(--text); border-radius: 14px; width: 54px; height: 54px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; }
    .topbar-logo { font-weight: 800; color: var(--primary); font-size: 1.4rem; flex: 1; }
    .topbar-logo img { height: 46px; object-fit: contain; filter: brightness(0) invert(1); }
    .topbar-badge { background: var(--surface2); color: var(--muted); border-radius: 50px; padding: .4rem 1.1rem; font-size: .95rem; font-weight: 500; }
    .cart-pill {
      background: var(--primary); color: var(--on-primary); border: none; border-radius: 50px;
      padding: .9rem 1.6rem; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .7rem;
      transition: transform .1s; box-shadow: 0 2px 12px rgba(157,32,35,.3);
    }
    .cart-pill:active { transform: scale(.96); }
    .cart-badge { background: var(--on-primary); color: var(--primary); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 900; }

    /* ====== CATEGORIES ====== */
    .cats {
      display: flex; gap: .75rem; padding: 1.1rem 2rem; overflow-x: auto;
      background: var(--surface); border-bottom: 1px solid var(--outline); scrollbar-width: none;
    }
    .cats::-webkit-scrollbar { display: none; }
    .cat-pill {
      background: var(--surface2); border: 1px solid var(--outline); border-radius: 9999px;
      padding: .55rem 1.35rem; font-size: 1rem; font-weight: 600; white-space: nowrap;
      cursor: pointer; transition: all .15s; flex-shrink: 0;
    }
    .cat-pill.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

    /* ====== CATEGORY SIDEBAR ====== */
    .menu-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }
    .cat-sidebar {
      width: 180px; flex-shrink: 0;
      background: var(--surface); border-right: 1px solid var(--outline);
      overflow-y: auto; padding: .6rem .45rem;
      display: flex; flex-direction: column; gap: .15rem;
      scrollbar-width: none;
    }
    .cat-sidebar::-webkit-scrollbar { display: none; }
    .cat-sb-item {
      display: flex; flex-direction: column; align-items: center; gap: .4rem;
      padding: 1rem .5rem .8rem; border-radius: 14px; cursor: pointer;
      transition: background .15s, transform .1s;
      text-align: center;
      position: relative; flex-shrink: 0;
      -webkit-tap-highlight-color: transparent;
    }
    .cat-sb-item:active { transform: scale(.92); }
    .cat-sb-item.active {
      background: var(--primary);
      box-shadow: 0 2px 12px rgba(157,32,35,.3);
    }
    .cat-sb-icon { font-size: 2rem; line-height: 1; }
    .cat-sb-name { font-size: .79rem; font-weight: 700; color: var(--muted); line-height: 1.25; word-break: break-word; }
    .cat-sb-item.active .cat-sb-name { color: var(--on-primary); }
    .cat-sb-badge {
      position: absolute; top: .4rem; right: .4rem;
      font-size: .62rem; font-weight: 900;
      background: var(--on-primary); color: var(--primary);
      border-radius: 50%; width: 20px; height: 20px;
      display: flex; align-items: center; justify-content: center;
    }
    .cat-sb-item.active .cat-sb-badge { background: rgba(0,0,0,.3); color: #fff; }
    .menu-content { flex: 1; overflow-y: auto; min-height: 0; }

    /* ====== PRODUCTS ====== */
    .products-wrap { padding: 1.75rem; padding-bottom: 8rem; }
    .products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }
    .prod-card {
      background: var(--surface2); border-radius: 20px; overflow: hidden;
      display: flex; flex-direction: column; cursor: pointer;
      transition: transform .12s, border-color .15s, box-shadow .15s;
      border: 2px solid transparent;
      box-shadow: 0 2px 12px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.03) inset;
    }
    .prod-card:active { border-color: var(--primary); transform: scale(.97); box-shadow: 0 0 0 3px rgba(157,32,35,.25); }
    .prod-card.in-cart { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(157,32,35,.18); }
    .prod-img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: var(--surface2); display: block; }
    .prod-img-ph {
      width: 100%; aspect-ratio: 3/2; background: linear-gradient(135deg, var(--surface2), var(--surface3));
      display: flex; align-items: center; justify-content: center; font-size: 3.8rem;
    }
    .prod-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
    .prod-name { font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
    .prod-desc { font-size: .88rem; color: var(--muted); flex: 1; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .prod-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .55rem; }
    .prod-price { font-size: 1.35rem; font-weight: 900; color: var(--primary); letter-spacing: -.01em; }
    .in-cart-qty {
      background: var(--primary); color: var(--on-primary);
      border-radius: 50%; width: 34px; height: 34px;
      display: flex; align-items: center; justify-content: center;
      font-size: .95rem; font-weight: 900;
      box-shadow: 0 2px 8px rgba(157,32,35,.4);
    }
    .oos-tag { font-size: .78rem; background: var(--error-bg); color: var(--error); border-radius: 6px; padding: .2rem .5rem; font-weight: 600; align-self: flex-start; }

    /* ====== CART FAB ====== */
    .cart-fab {
      position: fixed; bottom: 2rem; right: 2rem; z-index: 100;
      background: var(--primary); color: var(--on-primary); border: none; border-radius: 20px;
      padding: 1.2rem 2rem; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .8rem;
      box-shadow: 0 8px 32px rgba(157,32,35,.4); transition: transform .1s;
    }
    .cart-fab:active { transform: scale(.96); }
    .cart-fab-badge { background: var(--on-primary); color: var(--primary); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 900; }

    /* ====== MODAL / SHEET ====== */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 300; display: flex; align-items: flex-end; justify-content: center; animation: fadeBg .2s; }
    @keyframes fadeBg { from{opacity:0;} to{opacity:1;} }
    .modal-sheet {
      background: var(--surface); border-radius: 28px 28px 0 0; width: 100%; max-width: 820px;
      max-height: 90vh; display: flex; flex-direction: column; animation: slideUp .3s ease;
    }
    @keyframes slideUp { from{transform:translateY(100%);} to{transform:translateY(0);} }
    .modal-handle { width: 48px; height: 5px; background: var(--outline); border-radius: 2px; margin: 1.1rem auto .5rem; flex-shrink: 0; }
    .modal-header { padding: .5rem 2rem 1.1rem; border-bottom: 1px solid var(--outline); flex-shrink: 0; }
    .modal-title { font-size: 1.5rem; font-weight: 700; }
    .modal-subtitle { font-size: 1rem; color: var(--muted); margin-top: .2rem; }
    .modal-body { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.75rem; }
    .modal-footer { padding: 1.25rem 2rem 2.5rem; border-top: 1px solid var(--outline); display: flex; gap: .75rem; flex-shrink: 0; }
    .section-lbl { font-size: .9rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
    .notes-input { background: var(--surface2); border: 2px solid var(--outline); border-radius: 12px; padding: .85rem 1rem; color: var(--text); font-size: .92rem; font-family: inherit; width: 100%; resize: none; transition: border-color .2s; box-sizing: border-box; }
    .notes-input:focus { outline: none; border-color: var(--primary); }

    /* Sizes */
    .size-chips { display: flex; gap: .6rem; flex-wrap: wrap; }
    .size-chip {
      background: var(--surface2); border: 2px solid var(--outline); border-radius: 50px;
      padding: .55rem 1.2rem; font-size: .9rem; font-weight: 500; cursor: pointer; transition: all .15s;
      display: flex; flex-direction: column; align-items: center; gap: .1rem;
    }
    .size-chip.selected { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
    .size-chip-price { font-size: .72rem; font-weight: 700; opacity: .8; }

    /* Ingredients */
    .ing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .ing-item { background: var(--surface2); border: 2px solid var(--outline); border-radius: 12px; padding: .65rem 1rem; display: flex; align-items: center; gap: .55rem; cursor: pointer; transition: all .15s; }
    .ing-item.selected { border-color: var(--primary); background: rgba(157,32,35,.08); }
    .ing-item.removed  { border-color: var(--error);   background: rgba(242,139,130,.08); }
    .ing-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--outline); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .65rem; }
    .ing-item.selected .ing-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
    .ing-item.removed  .ing-dot { background: var(--error);   border-color: var(--error);   color: #fff; }
    .ing-name { font-size: .85rem; font-weight: 500; flex: 1; }
    .ing-extra-price { font-size: .75rem; color: var(--primary); font-weight: 700; }
    .ing-base-lbl { font-size: .68rem; color: var(--muted); background: var(--surface3); border-radius: 4px; padding: .1rem .3rem; }

    /* Notes */
    .notes-input { background: var(--surface2); border: 2px solid var(--outline); border-radius: 12px; padding: .85rem 1rem; color: var(--text); font-size: .92rem; font-family: inherit; width: 100%; resize: none; transition: border-color .2s; }
    .notes-input:focus { outline: none; border-color: var(--primary); }

    /* Qty in modal */
    .modal-qty-row { display: flex; align-items: center; gap: .75rem; }
    .qty-btn { background: var(--surface2); border: 2px solid var(--outline); color: var(--text); border-radius: 10px; width: 42px; height: 42px; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; transition: background .12s; }
    .qty-btn:active { background: var(--outline); }
    .qty-num { font-size: 1.2rem; font-weight: 700; min-width: 28px; text-align: center; }

    /* ====== CART SHEET ====== */
    .sheet-title { text-align: center; font-weight: 700; font-size: 1.1rem; padding-bottom: 1rem; }
    .sheet-items { flex: 1; overflow-y: auto; padding: .5rem 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
    .cart-row { background: var(--surface2); border-radius: 14px; padding: .85rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
    .cart-row-top { display: flex; align-items: flex-start; gap: .6rem; }
    .cr-name { flex: 1; font-size: .92rem; font-weight: 600; line-height: 1.3; }
    .cr-custom { font-size: .78rem; color: var(--muted); line-height: 1.5; padding-left: .2rem; }
    .cr-bottom { display: flex; align-items: center; gap: .6rem; }
    .cr-qty-row { display: flex; align-items: center; gap: .55rem; flex: 1; }
    .cr-qty-btn { background: var(--surface); border: 2px solid var(--outline); color: var(--text); border-radius: 8px; width: 32px; height: 32px; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
    .cr-qty-btn:active { background: var(--outline); }
    .cr-qty-num { font-weight: 700; min-width: 18px; text-align: center; font-size: .95rem; }
    .cr-price { font-weight: 700; color: var(--primary); font-size: .9rem; }
    .cr-del { background: transparent; border: none; color: var(--error); font-size: 1rem; padding: .2rem; opacity: .7; }
    .cr-del:active { opacity: 1; }
    .sheet-footer { padding: 1.1rem 1.5rem 2rem; border-top: 1px solid var(--outline); display: flex; flex-direction: column; gap: .85rem; }
    .total-line { display: flex; justify-content: space-between; font-size: 1rem; }
    .total-line.big { font-size: 1.3rem; font-weight: 700; }

    /* ====== TIME SLOT ====== */
    .timeslot-screen {
      display: flex; flex-direction: column; height: 100%;
    }
    .timeslot-header {
      padding: 2rem 2rem 1.2rem; background: var(--surface);
      border-bottom: 1px solid var(--outline); flex-shrink: 0;
    }
    .timeslot-header h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: .3rem; }
    .timeslot-header p { color: var(--muted); font-size: .95rem; }

    /* Date tabs */
    .date-tabs {
      display: flex; gap: .6rem; padding: 1rem 2rem;
      overflow-x: auto; scrollbar-width: none;
      background: var(--surface); border-bottom: 1px solid var(--outline);
      flex-shrink: 0;
    }
    .date-tabs::-webkit-scrollbar { display: none; }
    .date-tab {
      background: var(--surface2); border: 2px solid var(--outline);
      border-radius: 14px; padding: .75rem 1.4rem;
      text-align: center; cursor: pointer; transition: all .15s; flex-shrink: 0;
    }
    .date-tab:active { transform: scale(.95); }
    .date-tab.active {
      background: var(--primary); color: var(--on-primary); border-color: var(--primary);
      box-shadow: 0 2px 12px rgba(157,32,35,.35);
    }
    .date-tab-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
    .date-tab.active .date-tab-label { opacity: .85; }
    .date-tab-day { font-size: 1.05rem; font-weight: 800; margin-top: .15rem; }

    .timeslot-body { flex: 1; overflow-y: auto; padding: 1.5rem 2rem 9rem; }
    .slot-section-title { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }
    .slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
    .slot-card {
      background: var(--surface); border: 2px solid var(--outline); border-radius: 18px;
      padding: 1.2rem 1rem; text-align: center; cursor: pointer; transition: all .15s;
    }
    .slot-card.selected {
      border-color: var(--primary); background: rgba(157,32,35,.09);
      box-shadow: 0 0 0 3px rgba(157,32,35,.18);
    }
    .slot-card.full { opacity: .3; pointer-events: none; }
    .slot-card:active { transform: scale(.95); }
    .slot-time { font-size: 1.3rem; font-weight: 800; margin-bottom: .35rem; letter-spacing: -.01em; }
    .slot-avail { font-size: .78rem; font-weight: 600; color: var(--muted); }
    .slot-avail.low { color: var(--warning); }
    .slot-avail.gone { color: var(--error); }
    .slot-check { font-size: 1.2rem; margin-top: .4rem; color: var(--primary); }
    .slot-empty { text-align: center; padding: 3rem 1rem; opacity: .45; }
    .slot-empty-icon { font-size: 3rem; margin-bottom: .75rem; }
    .slot-empty-text { font-size: 1rem; }
    .timeslot-footer {
      position: fixed; bottom: 0; left: 0; right: 0;
      background: rgba(26,17,16,.88); border-top: 1px solid var(--outline);
      backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
      padding: 1rem 2rem 1.4rem;
      display: flex; align-items: center; gap: 1rem;
      box-shadow: 0 -8px 32px rgba(0,0,0,.3);
    }

    /* ====== CUSTOMER NAME ====== */
    .customer-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 3rem; gap: 2.5rem; }
    .name-input {
      width: 100%; max-width: 580px; background: var(--surface); border: 3px solid var(--outline); border-radius: var(--radius);
      padding: 1.6rem 2rem; color: var(--text); font-size: 1.8rem; font-family: inherit;
      text-align: center; transition: border-color .2s;
    }
    .name-input:focus { outline: none; border-color: var(--primary); }
    .name-input::placeholder { color: var(--muted); }

    /* ====== PAYMENT ====== */
    .payment-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 3rem; gap: 2.25rem; }
    .pay-summary {
      background: var(--surface); border-radius: 20px; border: 1px solid var(--outline);
      padding: 1.6rem 1.8rem; width: 100%; max-width: 560px;
      display: flex; flex-direction: column; gap: .8rem;
    }
    .pay-row { display: flex; justify-content: space-between; font-size: 1.05rem; }
    .pay-row.total {
      font-size: 1.55rem; font-weight: 800; border-top: 1px solid var(--outline);
      padding-top: .85rem; margin-top: .15rem; color: var(--primary);
    }
    .pay-methods { display: flex; gap: 1.1rem; flex-wrap: wrap; justify-content: center; }
    .pay-card {
      background: var(--surface); border: 2px solid var(--outline); border-radius: 20px;
      padding: 2rem 3rem; display: flex; flex-direction: column; align-items: center; gap: .8rem;
      min-width: 190px; cursor: pointer; transition: all .15s;
    }
    .pay-card.selected {
      border-color: var(--primary); background: rgba(157,32,35,.09);
      box-shadow: 0 0 0 4px rgba(157,32,35,.12);
    }
    .pay-card:active { transform: scale(.95); }
    .pay-icon { font-size: 2.8rem; }
    .pay-label { font-size: 1.2rem; font-weight: 700; }
    .pay-check { font-size: .85rem; color: var(--primary); font-weight: 600; }
    .pay-footer { display: flex; gap: .75rem; width: 100%; max-width: 560px; }

    /* ====== PROCESSING ====== */
    .processing-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 2rem; text-align: center; padding: 3rem; }
    .processing-spinner { width: 88px; height: 88px; border: 6px solid var(--outline); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }

    /* ====== SUCCESS ====== */
    .success-screen {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 100vh; gap: 1.75rem; text-align: center; padding: 3rem;
      background: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(62,218,138,.06) 0%, transparent 60%);
    }
    .success-check {
      width: 100px; height: 100px; border-radius: 50%;
      background: linear-gradient(135deg, rgba(62,218,138,.2), rgba(62,218,138,.08));
      border: 2px solid rgba(62,218,138,.35);
      display: flex; align-items: center; justify-content: center;
      font-size: 3.5rem; line-height: 1;
      animation: bounceIn .5s cubic-bezier(.17,.67,.42,1.3);
      box-shadow: 0 0 40px rgba(62,218,138,.15);
    }
    @keyframes bounceIn { 0%{transform:scale(0) rotate(-10deg);opacity:0;} 70%{transform:scale(1.12) rotate(2deg);} 100%{transform:scale(1) rotate(0);opacity:1;} }
    .success-title {
      font-size: 2.8rem; font-weight: 800; letter-spacing: -.02em;
    }
    .success-sub { color: var(--muted); font-size: 1.15rem; max-width: 400px; line-height: 1.65; }
    .order-box {
      background: var(--surface);
      border: 2px solid rgba(157,32,35,.4);
      border-radius: 24px;
      padding: 2rem 4.5rem;
      display: flex; flex-direction: column; align-items: center; gap: .5rem;
      box-shadow: 0 0 0 6px rgba(157,32,35,.08), 0 8px 40px rgba(0,0,0,.3);
      position: relative; overflow: hidden;
    }
    .order-box::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
      background: linear-gradient(90deg, transparent, var(--primary), transparent);
    }
    .order-box-lbl { font-size: .85rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
    .order-box-num {
      font-size: 6.5rem; font-weight: 900; color: var(--primary); line-height: 1;
      letter-spacing: -.03em;
      text-shadow: 0 0 40px rgba(157,32,35,.3);
    }
    .order-box-name { font-size: 1.2rem; font-weight: 500; color: var(--muted); }
    .success-info {
      background: var(--surface); border-radius: var(--radius); border: 1px solid var(--outline);
      padding: 1.25rem 2rem; display: flex; flex-direction: column; gap: .65rem;
      width: 100%; max-width: 400px;
    }
    .sinfo-row { display: flex; align-items: center; gap: .8rem; font-size: 1rem; }
    .sinfo-icon { font-size: 1.3rem; }
    .countdown-wrap { width: 100%; max-width: 260px; }
    .countdown-lbl { font-size: .78rem; color: var(--muted); text-align: center; margin-bottom: .5rem; letter-spacing: .03em; }
    .countdown-bar { height: 4px; background: var(--outline); border-radius: 3px; overflow: hidden; }
    .countdown-fill { height: 100%; background: var(--primary); transition: width 1s linear; }

    /* ====== MISC ====== */
    .empty { text-align: center; padding: 3rem 2rem; opacity: .45; font-size: 1rem; line-height: 1.7; }
    .err-banner { background: var(--error-bg); color: var(--error); border-radius: 12px; padding: .9rem 1.2rem; display: flex; align-items: center; gap: .7rem; font-size: .88rem; margin: 1rem 1.5rem; }
    .divider { border: none; border-top: 1px solid var(--outline); margin: .4rem 0; }

    /* timeout bar */
    .tbar { height: 3px; background: var(--outline); position: fixed; top: 0; left: 0; right: 0; z-index: 999; }
    .tbar-fill { height: 100%; background: var(--primary); transition: width 1s linear; }

    /* ====== STEP PROGRESS ====== */
    .step-progress {
      display: flex; align-items: center; justify-content: center; gap: .5rem;
      padding: 1rem 2rem .5rem; background: var(--surface);
    }
    .step-dot {
      width: 10px; height: 10px; border-radius: 50%;
      background: var(--outline); transition: all .3s cubic-bezier(.34,1.56,.64,1);
      flex-shrink: 0;
    }
    .step-dot.done  { background: var(--primary); opacity: .55; }
    .step-dot.active { background: var(--primary); width: 32px; border-radius: 5px; }
    .step-connector { flex: 1; max-width: 40px; height: 2px; background: var(--outline); flex-shrink: 0; border-radius: 1px; overflow: hidden; position: relative; }
    .step-connector.done::after { content: ''; position: absolute; inset: 0; background: var(--primary); opacity: .6; }

    .step-header {
      padding: 1rem 2rem .75rem; background: var(--surface);
      border-bottom: 1px solid var(--outline);
    }
    .step-title {
      font-size: 1.75rem; font-weight: 800;
    }
    .step-sub   { font-size: .95rem; color: var(--muted); margin-top: .15rem; }

    /* ====== BOTTOM BAR (cart + avanti) ====== */
    .step-bottom {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
      background: rgba(26,17,16,.88); border-top: 1px solid var(--outline);
      backdrop-filter: blur(20px) saturate(1.4);
      -webkit-backdrop-filter: blur(20px) saturate(1.4);
      padding: 1rem 2rem 1.4rem;
      display: flex; align-items: center; gap: 1rem;
      box-shadow: 0 -8px 32px rgba(0,0,0,.3);
    }
    .step-cart-info {
      flex: 1; display: flex; flex-direction: column; gap: .15rem;
    }
    .step-cart-count { font-size: .9rem; color: var(--muted); }
    .step-cart-total { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
    .step-next-btn {
      background: var(--primary); color: var(--on-primary); border: none;
      border-radius: 16px; padding: 1.1rem 2.4rem; font-size: 1.15rem; font-weight: 800;
      white-space: nowrap; transition: transform .1s, box-shadow .1s;
      box-shadow: 0 4px 20px rgba(157,32,35,.4), 0 1px 0 rgba(255,255,255,.1) inset;
      letter-spacing: .01em;
    }
    .step-next-btn:active { transform: scale(.96); box-shadow: 0 2px 10px rgba(157,32,35,.35); }
    .step-skip-btn {
      background: transparent; border: 2px solid var(--outline); color: var(--muted);
      border-radius: 9999px; padding: 1.1rem 1.8rem; font-size: 1rem; font-weight: 500;
      white-space: nowrap; transition: all .15s;
    }
    .step-back-btn {
      background: transparent; border: none; color: var(--muted); padding: .5rem;
      font-size: 1.9rem; line-height: 1;
    }
    .products-wrap-stepped { padding: 1.75rem 2rem 10rem; }

/* ============================================================
   Icone (sostituiscono le emoji del legacy)
   ------------------------------------------------------------
   Le emoji erano glifi di testo: si allineavano da sole alla riga
   e prendevano la dimensione del font. Un <svg> inline no, quindi
   qui gli si ridanno gli stessi due comportamenti. `currentColor`
   nell'SVG fa il resto: l'icona segue il colore del testo e quindi
   il tema scelto in Impostazioni, cosa che l'emoji non faceva.
   ============================================================ */
.eq-ico {
  flex: none;
  vertical-align: -0.18em;
}

/* Etichetta con icona a sinistra: usa il flusso flex invece di uno
   spazio, cosi' il testo non va a capo sotto l'icona. */
.eq-ico-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

/* Lo stato di attesa: il legacy usava la clessidra, qui gira. */
.eq-ico-spin { animation: eq-ico-spin 0.9s linear infinite; transform-origin: 50% 50%; }
@keyframes eq-ico-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eq-ico-spin { animation: none; } }

/* `.sheet-title` centrava il testo con `text-align`. Da riga icona+testo e'
   un contenitore flex, e siccome `.modal-sheet` e' a colonna il titolo occupa
   tutta la larghezza: senza `justify-content` icona e testo finirebbero
   spiaccicati a sinistra invece che al centro del foglio. */
.sheet-title.eq-ico-row { justify-content: center; }
