/* ==========================================================================
   RESPONSIVE.CSS — La Bottega della Pizza (Arcene)
   Da caricare DOPO il foglio di stile principale, oppure incollare in coda
   al blocco <style> esistente. Copre tutti i breakpoint: da desktop largo
   fino a smartphone piccoli (320px), incluso il widget di prenotazione,
   il menu "carta", la galleria e la lightbox.
   Ordine breakpoint: 1200 → 1024 → 900 → 768 → 640 → 480 → 400 → 360
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. BASE — target touch minimi, fix trasversali, e il fix del nav che si
   nasconde allo scroll (la classe .hidden veniva aggiunta via JS ma non
   esisteva ancora in CSS: il nav non si muoveva mai).
   -------------------------------------------------------------------------- */
button, .btn, .tab-btn, .slot, .i-btn, .cal-day, a.nav-cta, .wf-next, .wf-back {
  touch-action: manipulation;
}
img { max-width: 100%; height: auto; }

nav {
  transform: translateY(0);
  transition: transform .35s var(--ease-out), background .4s, padding .4s, box-shadow .4s;
}
nav.hidden {
  transform: translateY(-100%);
}

/* Il pulsante WhatsApp flottante finiva parzialmente sotto la home-bar su
   iPhone con notch/Dynamic Island: aggiungo il rispetto della safe-area. */
.float-wa {
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  right: calc(2rem + env(safe-area-inset-right, 0px));
}

/* --------------------------------------------------------------------------
   1. ≤1200px — desktop stretto / laptop piccolo
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .section-wrap { padding: 0 4%; }
  .book-grid, .cont-grid { gap: 4rem; }
  .nav-links { gap: 1.5rem; }
  .impasti-grid { grid-template-columns: repeat(3, 1fr); }
  .impasti-grid .impasto-card:nth-child(4) { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   2. ≤1024px — tablet orizzontale
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .ingredientinomobile-photo{display:none !important;}

  .book-grid, .cont-grid { grid-template-columns: 1fr; gap: 3.5rem; }

  .impasti-grid { grid-template-columns: 1fr 1fr; }
  .impasti-grid .impasto-card:nth-child(4) { grid-column: auto; }

  .cs-body { grid-template-columns: 1fr; gap: 1.8rem; }
  .cs-photos { height: 300px; }
  .cs-feats { grid-template-columns: 1fr 1fr; }

  .ingredienti-strip { grid-template-columns: 1fr; }
  .ingredienti-photo { min-height: 220px; }

  .proc-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: .6rem;
    background: none;
    border: none;
    padding-bottom: .5rem;
  }
  .proc-step {
    flex: 0 0 auto;
    width: 30%;
    min-width: 220px;
    scroll-snap-align: start;
    aspect-ratio: 3/4;
  }

  /* Il markup posiziona i 7 elementi con grid-column/grid-row assoluti
     pensati per la griglia desktop a 12 colonne (mosaico). Su una griglia
     a 2 colonne quei riferimenti sono invalidi: vanno azzerati TUTTI, non
     solo il primo e l'ultimo, altrimenti gli elementi si sovrappongono. */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .gallery-grid > div:nth-child(1),
  .gallery-grid > div:nth-child(2),
  .gallery-grid > div:nth-child(3),
  .gallery-grid > div:nth-child(4),
  .gallery-grid > div:nth-child(5),
  .gallery-grid > div:nth-child(6),
  .gallery-grid > div:nth-child(7) {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 4 / 3;
  }

  .p-cols { grid-template-columns: 1fr; }
  .paper-inner { padding: 2.6rem 2.2rem; }

  .liev-banner { grid-template-columns: 1fr; gap: 1.2rem; text-align: left; }
  .liev-num { font-size: 4.2rem; }

  .menu-spotlight { grid-template-columns: repeat(3, 1fr); }

  .map-wrap iframe { height: 380px; }
}

/* --------------------------------------------------------------------------
   3. ≤900px — tablet verticale
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-title { font-size: clamp(3rem, 8vw, 4.6rem); }
  .hero-sub { max-width: 100%; }
  .ingredientinomobile-photo{display:none !important;}

  .cs-pullquote blockquote { font-size: clamp(1.6rem, 4vw, 2.3rem); }

  .impasti-grid { grid-template-columns: 1fr 1fr; }
  .impasto-card { padding: 2.1rem 1.6rem; }
  .impasto-num { font-size: 5rem; }

  .proc-step { width: 34%; }

  .menu-controls { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .cat-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .3rem; -webkit-overflow-scrolling: touch; }
  .cat-tabs::-webkit-scrollbar { height: 4px; }
  .cat-tabs::-webkit-scrollbar-thumb { background: rgba(159,20,36,.3); }
  .tab-btn { flex-shrink: 0; }

  .menu-spotlight { grid-template-columns: repeat(3, 1fr); }

  .book-widget { max-width: 560px; margin: 0 auto; }
}

/* --------------------------------------------------------------------------
   4. ≤768px — soglia mobile "large" / phablet
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  #chi-siamo, #impasti, #processo, #menu, #galleria, #prenotazione, #contatti {
    padding: 6rem 0;
  }

  .ingredientinomobile-photo{display:none !important;}
  .hero-title { margin-bottom: 2rem; }
  .hero-btns { gap: .9rem; }
  .hero-btns .btn-ghost {
    width: auto;
    align-self: center;
    background: none;
    border: none;
    box-shadow: none;
    padding: .3rem 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .hero-btns .btn-ghost:hover { background: none; color: var(--cream); transform: none; box-shadow: none; }

  .nav-logo-mark { width: 36px; height: 36px; }
  .nav-logo-text .l2, .nav-logo-text .l3 { font-size: 1.05rem; }

  .cs-feats { grid-template-columns: 1fr 1fr; }
  .cs-feat { padding: 1.4rem 1.2rem; }

  .ingredienti-text { padding: 2rem; }
  .ingredienti-text h4 { font-size: 1.35rem; }

  .cs-opening { flex-direction: column; align-items: flex-start; gap: .4rem; text-align: left; }

  .proc-step { width: 46%; min-width: 190px; aspect-ratio: 4/5; }

  #processo .section-wrap::after {
    content: '← scorri per vedere tutti i passaggi →';
    display: block;
    text-align: center;
    font-family: var(--ff-disp);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(212,204,193,.35);
    margin-top: .8rem;
  }

  .paper-name { font-size: 2.8rem; }
  .paper-inner { padding: 2.2rem 1.6rem; }

  .menu-spotlight { grid-template-columns: 1fr 1fr; }
  .menu-spotlight .spot-card:nth-child(3) { display: none; }

  .gallery-grid { grid-auto-rows: auto; }
  .gallery-grid > div { aspect-ratio: 4 / 3; }

  .widget-steps { flex-wrap: wrap; }
  .sdot { flex: 1 1 20%; font-size: .44rem; }

  .map-wrap iframe { height: 320px; }
  .map-card { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   5. ≤640px — smartphone standard
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .nav-logo-text .l1 { font-size: .46rem; }
    .ingredientinomobile-photo{display:none !important;}


  #hero { min-height: 100svh; }
  .hero-left { padding-top: 96px; padding-bottom: 90px; }
  .hero-title { font-size: clamp(2.4rem, 11vw, 3.2rem); -webkit-text-stroke-width: 1.5px; line-height: .92; margin-bottom: 2rem; }
  .hero-sub { font-size: .82rem; padding-left: 1rem; }
  .hero-chips { gap: .3rem; }
  .chip { font-size: .54rem; padding: .24rem .7rem; }

  /* CTA secondaria come link testuale: la primaria (prenotazione) resta
     l'unico box pieno, il resto del blocco pesa meno in verticale. */
  .hero-btns { flex-direction: column; gap: .9rem; }
  .hero-btns .btn-primary { width: 100%; text-align: center; justify-content: center; }
  .hero-btns .btn-ghost {
    width: auto;
    align-self: center;
    background: none;
    border: none;
    box-shadow: none;
    padding: .3rem 0;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .hero-btns .btn-ghost:hover { background: none; color: var(--cream); transform: none; box-shadow: none; }

  .cs-pullquote blockquote { font-size: 1.55rem; padding-left: 1rem; }
  .cs-body p { font-size: .84rem; }
  .cs-photos { grid-template-columns: 1.2fr 1fr; height: 240px; }
  .cs-feats { grid-template-columns: 1fr 1fr; }
  .ingredienti-photo { min-height: 180px; }
  .cs-opening h4 { font-size: 1.15rem; }

  .impasti-grid { grid-template-columns: 1fr; }
  .impasto-card { padding: 2rem 1.6rem; }
  .impasto-num { font-size: 3.6rem; }
  .liev-banner { padding: 1.8rem 1.4rem; }
  .liev-num { font-size: 3.6rem; }

  .proc-step { width: 62%; min-width: 200px; }
  .proc-step:first-child { margin-left: 0; }
  .proc-strip::-webkit-scrollbar { display: none; }
  .proc-strip { scrollbar-width: none; }

  .paper-inner { padding: 1.9rem 1.2rem; }
  .paper-name { font-size: 2.3rem; }
  .paper-sub { font-size: .6rem; letter-spacing: .08em; }
  .p-item-name { font-size: .92rem; }
  .p-item-desc { font-size: .72rem; }
  .menu-spotlight { grid-template-columns: 1fr 1fr; }

  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 8px; }
  .gallery-grid > div { aspect-ratio: 16 / 11; }
  .lb-nav { display: none; }
  .lb-close { top: 1rem; right: 1rem; }

  .widget-hd { padding: 1.2rem 1.4rem; flex-wrap: wrap; gap: .5rem; }
  .widget-hd h3 { font-size: 1.1rem; }
  .sdot { font-size: .42rem; padding: .65rem .2rem; }
  .sdot .sn { font-size: 1.05rem; }
  .widget-body { padding: 1.4rem; min-height: 300px; }
  .cal-day { padding: .55rem .1rem; font-size: .78rem; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .impasto-btns-grid { grid-template-columns: 1fr; }
  .f2 { grid-template-columns: 1fr; }
  .confirm-box { padding: 1.1rem; }
  .cr { flex-direction: column; align-items: flex-start; gap: .15rem; }
  .cr .val { text-align: left; }
  .widget-footer { padding: 1rem 1.2rem; flex-wrap: wrap; gap: .5rem; }
  .step-info { order: 3; flex-basis: 100%; text-align: center; }

  .map-wrap iframe { height: 260px; }
  .map-card { grid-template-columns: 1fr; }
  .mc { border-right: none !important; }
  .reviews-row { gap: .5rem; }

  .foot-in { flex-direction: column; align-items: flex-start; gap: 1.4rem; }
  .foot-links { gap: 1.2rem 1.6rem; }

  .float-wa { width: 46px; height: 46px; }
}

/* --------------------------------------------------------------------------
   6. ≤480px — smartphone medio/piccolo
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .section-wrap { padding: 0 5.5%; }

  .hero-title { font-size: clamp(2.1rem, 12vw, 2.7rem); }
  .hero-eyebrow span { font-size: .56rem; }

  .sec-title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .ingredientinomobile-photo{display:none !important;}

  .cs-photos { grid-template-columns: 1fr 1fr; height: 200px; }
  .cs-feats { grid-template-columns: 1fr; }
  .cs-feat { padding: 1.2rem 1.1rem; }

  .impasto-card h3 { font-size: 1.55rem; }

  .menu-spotlight { grid-template-columns: 1fr; }
  .menu-spotlight .spot-card { aspect-ratio: 16/10; }

  .paper-name { font-size: 1.9rem; }
  .paper-eyebrow { font-size: .52rem; letter-spacing: .22em; }
  .p-cat-txt { font-size: .58rem; letter-spacing: .2em; }
  .paper-footer-addr { font-size: .74rem; }
  .paper-footer-note { font-size: .5rem; }

  .widget-hd h3 { font-size: 1rem; }
  .w-rating { font-size: .62rem; }
  .sdot { font-size: 0; padding: .6rem 0; }
  .sdot .sn { font-size: 1rem; }
  .sdot.done::after { top: .25rem; right: .25rem; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); gap: .25rem; }
  .slot { font-size: .68rem; padding: .45rem .1rem; }
  .i-btn { padding: .9rem 1rem; font-size: .88rem; }

  .rev-pill { padding: .65rem .9rem; }
  .rp-score { font-size: 1.5rem; }

  .foot-logo-main, .foot-logo-sub { font-size: 1.25rem; }
}

/* --------------------------------------------------------------------------
   7. ≤400px — telefoni compatti
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  .hero-title { font-size: 2.4rem; }
  .sec-title { font-size: 2.1rem; }
  .paper-name { font-size: 1.8rem; }
  .ingredientinomobile-photo{display:none !important;}

  .btn { padding: .72rem 1.3rem; font-size: .62rem; }

  .cal-grid { gap: 1px; }
  .cal-day { font-size: .72rem; padding: .5rem .05rem; }
  .cal-wday { font-size: .46rem; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .slot { font-size: .64rem; }

  .float-wa { width: 42px; height: 42px; }
  .float-wa svg { width: 19px; }

  .cs-feats { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   8. ≤360px — smartphone molto piccoli (es. iPhone SE, Android entry-level)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .section-wrap { padding: 0 6%; }
  .ingredientinomobile-photo{display:none !important;}

  .hero-title { font-size: 2.1rem; }
  .hero-sub { font-size: .78rem; }
  .chip { font-size: .5rem; padding: .2rem .6rem; }

  .sec-title { font-size: 1.9rem; }
  .cs-pullquote blockquote { font-size: 1.35rem; }

  .impasto-card { padding: 1.7rem 1.3rem; }
  .impasto-num { font-size: 3rem; }
  .liev-num { font-size: 3rem; }

  .paper-inner { padding: 1.5rem .9rem; }
  .paper-name { font-size: 1.6rem; }
  .p-item-name { font-size: .84rem; }
  .p-price { font-size: .84rem; }

  .widget-body { padding: 1.1rem; }
  .cal-day { font-size: .68rem; }
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
  .impasto-btns-grid { gap: .25rem; }
  .i-btn { padding: .8rem .9rem; font-size: .82rem; }
  .wf-next { padding: .62rem 1.3rem; font-size: .58rem; }

  .rev-pill { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   9. Mobile in landscape (orizzontale)
   -------------------------------------------------------------------------- */
@media (max-height: 480px) and (orientation: landscape) {
  #hero { min-height: auto; padding: 7rem 0 3rem; }
  .hero-left { padding-top: 0; padding-bottom: 0; }
  .hero-title { font-size: clamp(2rem, 7vw, 3rem); }
    .ingredientinomobile-photo{display:none !important;}

}

/* --------------------------------------------------------------------------
   10. Accessibilità
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  #embers-container { display: none; }
  nav { transition: none; }
}