/* ═══════════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS
   Caricato per ultimo — override mirati per smartphone
   Target primario: 320px – 767px
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Prevenzione overflow orizzontale globale ── */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── 2. Padding verticale ridotto su mobile ── */
@media (max-width: 767px) {
  .showcase-section,
  .tutto-section,
  .beaches-section,
  .map-section,
  .restaurants-section,
  .bars-section,
  .trekking-section,
  .boat-section,
  .kitesurf-section,
  .itinerari-section,
  .transport-section,
  .essentials-section,
  .events-section,
  .weather-section,
  .quiz-section,
  .ale-section,
  .download-section,
  .notify-section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .section-head {
    margin-bottom: 28px;
  }

  .section-head h2 {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .section-head p {
    font-size: 0.92rem;
  }
}

/* ── 3. Hero: ottimizzazioni mobile ── */
@media (max-width: 767px) {
  .hero-inner {
    padding: 88px 16px 56px;
    gap: 28px;
  }

  /* bottoni hero: stack verticale, full-width leggibile */
  .hero-actions {
    gap: 10px;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    max-width: 340px;
    justify-content: center;
  }

  /* phone mockup nell'hero: leggermente più piccolo */
  .hero-phone .phone-mockup {
    width: 200px;
    height: 418px;
  }

  /* Niente animazione float su mobile (risparmio batteria) */
  .phone-float-wrap {
    animation: none !important;
  }

  /* stat bar hero */
  .hero-stats {
    gap: 12px;
    padding: 8px 16px;
    border-radius: 16px;
  }
}

/* ── 4. Hero phone: nascosto sotto 400px (schermo troppo stretto) ── */
@media (max-width: 400px) {
  .hero-phone {
    display: none;
  }
  .hero-inner {
    padding-bottom: 80px; /* più spazio per scroll-cta */
  }
}

/* ── 5. Tipografia su schermi piccoli ── */
@media (max-width: 380px) {
  h1 { font-size: clamp(1.75rem, 9vw, 2.4rem); }
  h2 { font-size: clamp(1.4rem, 7.5vw, 2rem); }
  h3 { font-size: clamp(1rem, 5vw, 1.3rem); }

  .hero-stats { gap: 8px; }
  .stat strong { font-size: 1rem; }
  .stat span   { font-size: 0.6rem; }
  .stat-sep    { display: none; }

  .btn-lg { padding: 13px 22px; font-size: 0.9rem; }
}

/* ── 6. Two-col: phone sempre sotto il testo su mobile ── */
@media (max-width: 767px) {
  .two-col,
  .two-col.reverse {
    flex-direction: column !important;
  }
  .two-col .col-text,
  .two-col.reverse .col-text  { order: 1; }
  .two-col .col-phone,
  .two-col.reverse .col-phone { order: 2; }

  /* Phone più piccolo nelle sezioni contenuto */
  .col-phone .phone-mockup {
    width: 196px;
    height: 410px;
  }

  /* Niente float animation su mobile */
  .col-phone .phone-float-wrap {
    animation: none !important;
  }

  /* Gap ridotto */
  .two-col { gap: 28px; }
}

/* ── 7. Showcase section: layout mobile pulito ── */
@media (max-width: 900px) {
  /* Ridurre padding sezione */
  .showcase-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  /* Header più compatto */
  .showcase-header {
    margin-bottom: 40px;
    padding: 0 20px;
  }

  .showcase-header h2 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

  /* Stage: colonna unica, centrata */
  .showcase-stage {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 20px;
  }

  /* Phone: prima */
  .showcase-phone-wrap { order: 1; }

  /* Feature info: dopo il phone */
  .showcase-info {
    order: 2;
    min-height: 0;
    text-align: center;
    align-items: center;
    width: 100%;
  }

  /* Feature singola: display block, no position absolute */
  .sc-feature {
    position: relative !important;
    inset: auto !important;
    display: none;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    flex-direction: column;
    align-items: center;
  }
  .sc-feature.active {
    display: flex;
  }

  /* Icona emoji più piccola */
  .sc-feature-em { font-size: 2.2rem; margin-bottom: 12px; }

  /* Titolo */
  .sc-feature h3 { font-size: 1.45rem; margin-bottom: 8px; }

  /* Descrizione breve, senza bullets */
  .sc-feature p { font-size: 0.9rem; margin-bottom: 0; max-width: 400px; }

  /* Bullets nascosti su mobile (troppo testo) */
  .sc-bullets { display: none; }

  /* Lista destra nascosta su mobile */
  .showcase-list { display: none; }

  /* Dots più grandi e cliccabili */
  .showcase-dots { margin-top: 28px; gap: 10px; }
  .sc-dot {
    width: 9px;
    height: 9px;
    cursor: pointer;
  }
}

@media (max-width: 600px) {
  /* Phone showcase leggermente più piccolo */
  .showcase-phone-wrap .phone-mockup {
    width: 230px;
  }
}

@media (max-width: 380px) {
  .showcase-phone-wrap .phone-mockup {
    width: 200px;
  }
}

/* ── 8. Beaches horizontal scroll: ottimizzato per swipe ── */
@media (max-width: 767px) {
  .beaches-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    /* Aggiungi padding per indicare che è scrollabile */
    padding-left: 16px;
    padding-right: 16px;
  }

  .beach-card {
    flex: 0 0 240px;
    /* touch target comodo */
  }

  /* Mostra freccia indicativa su mobile */
  .beach-card:last-child {
    margin-right: 16px;
  }
}

/* ── 9. Filter buttons: scroll orizzontale su mobile ── */
@media (max-width: 767px) {
  .beach-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .filter-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 0.8rem;
    padding: 8px 14px;
    min-height: 42px;
  }
}

/* ── 10. Tutto grid: font leggermente più grande ── */
@media (max-width: 479px) {
  .tutto-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tutto-item { padding: 12px 6px 10px; }
  .tutto-icon { font-size: 1.5rem; }
  .tutto-item strong { font-size: 0.75rem; }
  .tutto-item small  { font-size: 0.65rem; }
}

/* ── 11. Quiz: touch target grandi ── */
@media (max-width: 767px) {
  .quiz-opt {
    min-height: 56px;
    padding: 14px;
    gap: 14px;
  }
  .quiz-q h3 { font-size: 1rem; }
  .quiz-hint { font-size: 0.82rem; }
}

/* ── 12. Transport grid: 2 colonne su mobile ── */
@media (max-width: 640px) {
  .transport-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 380px) {
  .transport-grid { grid-template-columns: 1fr !important; }
}

/* ── 13. Essentials grid: 2 colonne su mobile ── */
@media (max-width: 559px) {
  .essentials-grid { grid-template-columns: 1fr !important; }
}

/* ── 14. Download section: bottoni stack ── */
@media (max-width: 480px) {
  .store-buttons {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

/* ── 15. Footer grid ── */
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .footer-brand { max-width: 100%; }
}

/* ── 16. Itinerari cards: leggermente più compatte ── */
@media (max-width: 639px) {
  .itinerari-grid { grid-template-columns: 1fr; }
  .itinerario-card { padding: 20px 18px; }
}

/* ── 17. Ale section: layout mobile ── */
@media (max-width: 767px) {
  .ale-section .two-col { gap: 28px; }
}

/* ── 18. Scroll cta: non sovrappone il phone su mobile ── */
@media (max-width: 767px) {
  .scroll-cta { bottom: 14px; font-size: 0.7rem; }
}

/* ── 19. Nav link active state: aggiunge feedback visivo al tap ── */
.nav-links a:active {
  opacity: 0.7;
}

/* ── 20. Check list: leggibile su mobile ── */
@media (max-width: 767px) {
  .check-list li { font-size: 0.9rem; }
  .check-list { gap: 12px; }
}

/* ── 21. Screenshots page: grid compatta su mobile ── */
@media (max-width: 480px) {
  .phone-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 12px;
  }
  .phone-frame { width: 130px !important; }
  .phone-desc  { max-width: 130px !important; font-size: 0.68rem; }
  .gallery-section { padding: 36px 16px 0; }
  .gallery-section-title { font-size: 1.2rem; }
}

/* ── 22. Notify / waitlist form su mobile ── */
@media (max-width: 480px) {
  .notify-form {
    flex-direction: column !important;
    gap: 10px;
  }
  .notify-form input,
  .notify-form button {
    width: 100%;
    border-radius: 12px !important;
  }
}

/* ── 23. Tag chips nel showcase e nei bottoni: touch-friendly ── */
.sc-dot,
.lang-tab,
.filter-btn,
.quiz-opt,
.bar-type-chip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── 24. Smooth scroll su iOS ── */
.beaches-scroll,
.beach-filters,
.sph-chips,
.mini-filters,
.lang-tabs {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── 25. Immagini screenshot: dimensione minima ── */
@media (max-width: 360px) {
  .phone-frame { width: 110px !important; }
  .phone-grid  { grid-template-columns: repeat(2, 1fr) !important; gap: 10px 8px; }
}
