/* ==========================================================================
   VARIABILI E COLORI (COLORE CALDO ELEGANTE E FLUTTUAZIONE CARD)
   ========================================================================== */
:root {
  --primary-dark: #0a3e3c;
  --primary-light: #78bfb8;
  --bg-color: #f3eee6; /* Tonalità sabbia/crema calda ed elegante */
  --surface: #ffffff;
  --text-main: #2c3531;
  --text-muted: #666666;
  --shadow-elevation: 0 10px 25px rgba(10, 62, 60, 0.1), 0 3px 8px rgba(0,0,0,0.05); /* Effetto fluttuante marcato */
  --radius: 16px;
  --spacing-base: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  padding-bottom: 80px;
}

/* ==========================================================================
   WIDGET TRADUZIONE GOOGLE
   ========================================================================== */
.translate-bar {
  display: flex;
  justify-content: center;
  padding-bottom: 15px;
}
.goog-te-gadget-simple {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: none !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ==========================================================================
   HERO CON IMMAGINE DI SFONDO RIPRISTINATA
   ========================================================================== */
.hero-section {
  background-image: url('immagini/copertina.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 50px 0 60px 0;
  text-align: center;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.hero-description {
  font-size: 15px;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   NAVIGAZIONE STICKY
   ========================================================================== */
.sticky-nav {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 12px;
}

.nav-list a {
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  background: #eef5f4;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   LAYOUT E CARD FLUTTUANTI
   ========================================================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-base);
}

.center { text-align: center; }

.page-content section { margin-top: 36px; }

.section-header { margin-bottom: 18px; }
.section-header h2 { font-size: 22px; color: var(--primary-dark); margin-bottom: 4px; }
.section-header p { font-size: 14px; color: var(--text-muted); }

/* Card a rilievo ed effetto fluttuante */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  border: 1px solid rgba(255,255,255,0.8);
  overflow: hidden;
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-body { padding: 18px; }

/* Scroll orizzontale per card */
.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 6px 4px 18px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }
.horizontal-scroll .card {
  flex: 0 0 85%;
  max-width: 320px;
  margin-bottom: 0;
  scroll-snap-align: start;
}
.horizontal-scroll .card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.horizontal-scroll .card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.horizontal-scroll .card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ==========================================================================
   PULSANTI UNIFORMI E CENTRATI
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-whatsapp {
  display: block;
  text-align: center;
  margin: 10px auto 0 auto;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--primary-dark);
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  width: 100%;
}

.btn-secondary {
  background: white;
  color: var(--primary-dark);
  border: 1px solid var(--primary-dark);
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
}

.btn-komoot {
  background-color: #93c938 !important;
  color: white !important;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  padding: 12px 20px;
  font-size: 15px;
  width: 100%;
}

.whatsapp-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 15px rgba(37,211,102,0.4);
  z-index: 1000;
  text-decoration: none;
}

/* ==========================================================================
   LAYOUT MAPPE AFFIANCATE (SPLIT MAP + SIDEBAR)
   ========================================================================== */
.side-by-side-card {
  display: flex;
  flex-direction: row !important;
  height: 480px;
  overflow: hidden;
  padding: 0 !important;
}

.left-map {
  flex: 1;
  width: 50%;
  height: 100%;
}
.left-map .leaflet-map {
  height: 100% !important;
  width: 100%;
  z-index: 1; 
}

.right-info {
  flex: 1;
  width: 50%;
  height: 100%;
  padding: 12px;
  background: #fff;
  border-left: 1px solid #eee;
}

.scroll-area {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.map-actions-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.map-legend-chips-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-chip {
  display: block;
  background: #eef5f4;
  color: var(--primary-dark);
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}
.map-chip.active {
  background: var(--primary-dark);
  color: white;
}

.side-list li {
  display: flex;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}
.side-list li:last-child { border-bottom: none; }
.side-list .place-info {
  width: 100%;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-btn {
  padding: 6px 10px !important;
  font-size: 12px !important;
  margin-top: 4px !important;
}

/* ==========================================================================
   LISTE, BADGE E BOX ALERT ZTL
   ========================================================================== */
.place-list { list-style: none; }
.place-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.mini-link {
  background: #eef5f4;
  color: var(--primary-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.badge {
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #555;
  font-weight: 600;
}
.badge.time { background: #e8f5e9; color: #2e7d32; }

/* Box giallo ZTL mantenuto integro nei colori ed elegante negli spazi */
.alert-box {
  background: #fff3cd;
  color: #856404;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  border: 1px solid #ffeeba;
  line-height: 1.4;
}

/* ==========================================================================
   OTTIMIZZAZIONE CIBO & STREET FOOD
   ========================================================================== */
.food-scroll .food-card {
  min-width: 250px;
}
.food-scroll .food-card img {
  height: 110px;
}
.food-scroll .card-body {
  padding: 12px;
}
.food-scroll h3 {
  font-size: 16px !important;
  margin-bottom: 6px !important;
}
.food-scroll .place-list li {
  padding: 6px 0;
  font-size: 13px;
}

.compact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  background: #f0f0f0;
  color: #333;
  padding: 5px 8px;
  border-radius: 12px;
  font-size: 11px;
  position: relative;
  cursor: help;
}

.chip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: normal;
  width: 180px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.chip.show-tooltip::after {
  opacity: 1;
  visibility: visible;
}
/* ==========================================================================
   DETTAGLI PERCORSO (LUNGHEZZA, TEMPO, DIFFICOLTÀ)
   ========================================================================== */
.percorso-dettagli {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 15px 0;
  padding: 12px 10px;
  background-color: #f7f9f9;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0a3e3c;
  border: 1px solid rgba(120, 191, 184, 0.2);
}

.percorso-dettagli span {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* ==========================================================================
   SEZIONE PRENOTA E APPARTAMENTI
   ========================================================================== */
.prenota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.appartamento-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(120, 191, 184, 0.2);
  display: flex;
  flex-direction: column;
}

.appartamento-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.appartamento-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.appartamento-body h3 {
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.appartamento-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Stili per le sottopagine dei dettagli appartamento */
.appartamento-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.foto-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.foto-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.foto-gallery img:hover {
  transform: scale(1.02);
}

.info-box-appartamento {
  background: #f7f9f9;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 15px 0;
  border-left: 4px solid var(--primary-dark);
}

.info-box-appartamento h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.info-box-appartamento ul {
  padding-left: 20px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.info-box-appartamento li {
  margin-bottom: 6px;
}
/* Correzione altezza e overflow per le card del cibo */
.food-scroll .food-card {
  height: auto !important;
  min-height: 380px;
}

.food-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}

.food-card .place-list {
  max-height: none !important;
  overflow: visible !important;
}
/* ==========================================================================
   CORREZIONI DEFINITIVE: CHIP STREET FOOD & BOTTONI RISTORANTI
   ========================================================================== */

/* 1. Sistema i chip di Street Food (testo mai tagliato e spaziature corrette) */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible !important;
  max-height: none !important;
}

.chip {
  display: inline-block;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal !important; /* Permette al testo di andare a capo se necessario */
  height: auto !important;
}

/* 2. Rende i bottoni "Apri in Maps" dei ristoranti piccoli, eleganti e staccati */
.food-card .place-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.food-card .place-info {
  flex-grow: 1;
  font-size: 13px;
}

/* Pulsante mini uniforme per i ristoranti */
.food-card .mini-btn {
  padding: 4px 10px !important;
  font-size: 11px !important;
  border-radius: 12px !important;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto !important;
}
/* CORREZIONE FORZATA PER I CHIP DI STREET FOOD */
.food-card .card-body {
  height: 100% !important;
  justify-content: flex-start !important;
  overflow: visible !important;
}

.chips-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 10px !important;
}

.chip {
  display: inline-block !important;
  position: relative !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  height: auto !important;
  white-space: normal !important;
  background: #f0f4f4 !important;
  border-radius: 8px !important;
  color: var(--primary-dark) !important;
  box-sizing: border-box !important;
}