/* --- Variabili e Reset --- */
:root {
  --primary-color: #2b3a2f;
  --accent-color: #8c9c8a;
  --text-dark: #333333;
  --bg-light: #f9f9f7;
  --white: #ffffff;
  --font-heading: "Cormorant Garamond", serif;
  --font-body: "Montserrat", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--white);
  overflow-x: hidden;
}

/* --- Tipografia --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--primary-color);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

/* --- Navigazione --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 5%;
  position: absolute;
  width: 100%;
  top: 0;
  z-index: 10;
}

.logo a {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.lang-switcher {
  color: var(--white);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-btn {
  cursor: pointer;
  opacity: 0.6;
  transition:
    opacity 0.3s ease,
    font-weight 0.3s ease;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  opacity: 1;
  font-weight: 700;
  color: var(--accent-color);
}

/* Navigazione per pagine interne (sfondo scuro) */
.navbar.solid-bg {
  background-color: var(--primary-color);
  position: static;
  padding: 1.5rem 5%;
}

/* --- Bottoni --- */
/* --- Bottoni --- */
.hero-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

/* Stile Strutturale Condiviso: li rende cloni perfetti */
.btn-solid,
.btn-outline {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 52px;
  /* Altezza bloccata per entrambi */
  padding: 0 2.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  /* Il bordo è incluso nei 52px */
}

/* Colori specifici Bottone Vuoto */
.btn-outline {
  border: 1px solid var(--white);
  background-color: transparent;
  color: var(--white);
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary-color) !important;
}

/* Colori specifici Bottone Pieno */
.btn-solid {
  background-color: var(--primary-color);
  color: var(--white);
  border: 1px solid var(--primary-color);
  /* Ha un bordo scuro per bilanciare il bordo bianco dell'altro */
}

.btn-solid:hover {
  background-color: transparent;
  color: var(--white);
  border-color: var(--white);
}

/* --- Hero Section (Solo Home) --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  position: relative;
  z-index: 1;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: -1;
}

.hero-content {
  max-width: 800px;
  padding: 0 20px;
}

.hero h1 {
  color: var(--white);
  font-size: 4.5rem;
  margin-bottom: 1rem;
  letter-spacing: 3px;
}

.hero p {
  color: var(--bg-light);
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 1px;
}

/* --- Page Header (Pagine Interne) --- */
.page-header {
  background-color: var(--bg-light);
  padding: 6rem 5% 4rem;
  text-align: center;
}

.page-header h1 {
  font-size: 3.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* --- Sezioni Generiche --- */
.section {
  padding: 6rem 5%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

.section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.divider {
  height: 2px;
  width: 60px;
  background-color: var(--accent-color);
  margin: 1.5rem 0;
}

.divider.center {
  margin: 1.5rem auto;
}

/* --- About (Home) --- */
.about-text {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about-text p {
  font-size: 1.1rem;
  color: #555;
}

/* --- Menu Grid --- */
.menu-category,
.menu-subcategory {
  margin-bottom: 4rem;
}

.menu-category h2,
.menu-subcategory h2 {
  font-size: 2rem;
  color: var(--accent-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.menu-item h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.menu-item .price {
  color: var(--accent-color);
  font-family: var(--font-body);
  white-space: nowrap;
  flex-shrink: 0;
}

.menu-item p {
  font-size: 0.95rem;
  color: #666;
}

/* --- Allergeni --- */
.allergen-badge {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: #888;
  background-color: #f0f0f0;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: super;
  /* Keep it as a real superscript */
  font-weight: 400;
  cursor: help;
}

.allergen-legend-container {
  margin-top: 4rem;
  padding: 2rem;
  background-color: var(--bg-light);
  border: 1px solid #eaeaea;
  border-radius: 8px;
}

.allergen-legend-container h4 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.allergen-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.allergen-item {
  font-size: 0.85rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.allergen-number {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 20px;
  background-color: #e0e0e0;
  color: #333;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 600;
}

/* --- Contatti Form --- */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.contact-info p {
  margin-bottom: 2rem;
  color: #555;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ddd;
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--bg-light);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* --- Footer --- */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 4rem 5% 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.footer-col p {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #aaa;
}

/* --- Menu Tabs (Navigazione Categorie) --- */
/* --- Dropdown Categorie Menu --- */
.menu-filter-container {
  max-width: 400px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

.filter-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 0.8rem;
}

.menu-select {
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  background-color: var(--bg-light);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  cursor: pointer;

  /* Rimuove la freccia brutta di default del browser */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Aggiunge una freccia minimal in SVG */
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232b3a2f" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 1.5rem center;
  background-size: 1.2em;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.menu-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
  color: var(--accent-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

/* Animazione di comparsa per i piatti */
.fade-in {
  animation: fadeIn 0.4s ease-in-out;
}

/* --- Mappa Google --- */
.map-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 8px;
  /* Bordo leggermente arrotondato */
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  /* Leggera ombra elegante */
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Hamburger Menu (Base) --- */
.hamburger {
  display: none;
  /* Nascosto su desktop */
  cursor: pointer;
  z-index: 100;
}

.hamburger .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--white);
}

/* --- Menu Tabs (Migliorati per Desktop) --- */
.menu-tabs {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  /* Aggiungiamo overflow per il mobile */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Nasconde scrollbar su Firefox */
}

.menu-tabs::-webkit-scrollbar {
  display: none;
  /* Nasconde scrollbar su Chrome/Safari */
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #888;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  /* Impedisce al testo di andare a capo */
}

/* --- Animazione di Caricamento (Loader) --- */
.loader-container {
  text-align: center;
  padding: 4rem 0;
}

.loader {
  border: 4px solid var(--bg-light);
  /* Colore di sfondo del cerchio */
  border-top: 4px solid var(--primary-color);
  /* Colore della parte che gira */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loader-container p {
  margin-top: 1rem;
  color: var(--primary-color);
  font-weight: 500;
  letter-spacing: 1px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- Media Queries (Mobile Responsive) --- */
@media (max-width: 768px) {
  /* 1. Gestione Menu Mobile (Hamburger) */
  .hamburger {
    display: block;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    left: -100%;
    top: 0;
    gap: 0;
    flex-direction: column;
    background-color: var(--primary-color);
    width: 100%;
    height: 100vh;
    text-align: center;
    transition: 0.3s;
    justify-content: center;
    z-index: 99;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    margin: 1.5rem 0;
  }

  .nav-links a {
    font-size: 1.5rem;
  }

  /* 2. Regolazioni Generali Mobile */
  .hero h1 {
    font-size: 3rem;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .map-container {
    min-height: 300px;
    margin-top: 2rem;
  }

  /* 3. Miglioramento UX Tabs Menu Mobile */
  .menu-tabs {
    justify-content: flex-start;
    /* Allinea a sinistra per lo scorrimento */
    padding-bottom: 5px;
    /* Spazio per lo scorrimento visivo */
    border-bottom: 1px solid #eee;
    /* Linea guida visiva */
    margin-bottom: 2rem;
  }

  .tab-btn {
    font-size: 1.1rem;
    padding: 0.5rem;
  }
}

/* --- Quick Info Bar --- */
.quick-info {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 2rem 5%;
  margin-top: -5px;
  /* Rimuove lo spazio con la hero */
}

.quick-info-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.info-item h4 {
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-item p,
.info-item a {
  font-size: 1rem;
  font-weight: 300;
}

.info-item a:hover {
  color: var(--accent-color);
}

/* --- Galleria / Specialità Visive --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.gallery-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 300px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
  /* Effetto zoom al passaggio del mouse */
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 2rem 1.5rem 1.5rem;
  color: var(--white);
}

.gallery-overlay h3 {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.gallery-overlay p {
  font-size: 0.9rem;
  color: #ddd;
}

/* --- Menu Fisso del Giorno --- */
.menu-giorno-wrapper {
  background-color: var(--bg-light);
  border: 1px solid #ddd;
  padding: 3rem 2rem;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  text-align: center; /* Center everything inside */
}

.menu-giorno-header h2 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  text-align: center;
  font-style: italic; /* Match paper menu */
  letter-spacing: 2px;
}

.formule-menu {
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

.menu-riga {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.3rem 0;
  width: 100%;
}

.menu-nome {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 1.1rem;
  flex-shrink: 1; /* Permette al testo di restringersi e andare a capo se necessario */
  padding-right: 15px; /* Spazio prima dei puntini */
}

.menu-dots {
  flex-grow: 1;
  border-bottom: 2px dotted #ccc;
  margin: 0 10px;
  opacity: 0.7;
  flex-shrink: 0; /* Impedisce ai punti di sparire completamente */
  min-width: 30px; /* Assicura che ci siano sempre almeno un po' di punti visibili */
}

.menu-prezzo {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 1.1rem;
  flex-shrink: 0; /* Il prezzo non deve mai andare a capo o nascondersi */
  padding-left: 10px;
}



.menu-sezione {
  margin-bottom: 1.5rem;
  text-align: left;
}

.menu-sezione h3 {
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: normal;
}

.menu-sezione p {
  font-size: 1.05rem;
  color: var(--text-dark);
  padding: 0.2rem 0;
  margin-bottom: 0;
}

.menu-footer {
  margin-top: 2rem;
  text-align: center;
}

.menu-footer h3 {
  font-size: 1.2rem;
  color: var(--text-dark);
  font-style: italic;
  text-transform: uppercase;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Media Queries (Mobile Responsive) --- */
@media (max-width: 768px) {
  /* --- Navbar e Hamburger --- */
  .navbar {
    padding: 1rem 5%;
    z-index: 100;
    /* Assicurati che sia flex e che spinga gli elementi ai lati opposti */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .hamburger {
    display: block;
    z-index: 101;
    /* Rimuovi il margin-left: auto; non serve più grazie a space-between */
    margin-left: 0;
    /* Aggiungiamo un po' di spazio per sicurezza */
    padding-left: 15px;
  }

  /* Animazione Hamburger in "X" */
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* --- Menu a Tendina (Nav-links) --- */
  .nav-links {
    position: fixed;
    left: -100%;
    top: 0;
    flex-direction: column;
    background-color: var(--primary-color);
    width: 100%;
    height: 100vh;
    /* Menu a tutto schermo */
    text-align: center;
    transition: 0.3s ease-in-out;
    justify-content: center;
    z-index: 99;
    /* Sta sotto la navbar e l'hamburger */
    padding-top: 60px;
    /* Spazio in alto per non coprire il logo */
    /* Rimuovi il gap, useremo il margin sui li */
    gap: 0;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    margin: 2rem 0;
    /* Più spazio tra le voci di menu */
  }

  .nav-links a {
    font-size: 1.5rem;
    display: block;
    /* Rende l'intera area cliccabile */
  }

  /* Nascondi il bottone "Contatti" dentro il menu mobile e mostralo come link normale */
  .nav-links .btn-outline {
    border: none;
    padding: 0;
  }

  .nav-links .btn-outline:hover {
    background-color: transparent;
    color: var(--accent-color) !important;
  }

  /* --- Altre Regolazioni Mobile --- */
  .hero-content {
    width: 100%;
    padding: 0 20px;
  }

  .hero h1 {
    font-size: 2.2rem;
    /* Rimpicciolito per evitare a capo strani */
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    /* Ombra per migliorare la lettura */
  }

  .hero p {
    font-size: 1.1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    /* Ombra per la lettura */
  }

  /* --- Fix Bottoni Hero Mobile --- */
  .hero-buttons {
    flex-direction: column;
    /* Li impila verticalmente in modo forzato */
    width: 100%;
    gap: 1rem;
    /* Spazio ridotto tra i due bottoni su mobile */
  }

  .hero-buttons .btn-solid,
  .hero-buttons .btn-outline {
    width: 100%;
    /* Occupa tutta la larghezza disponibile... */
    max-width: 320px;
    /* ...ma non si allarga all'infinito su tablet */
    margin: 0 auto;
    /* Li centra perfettamente */
  }

  /* --- UX Tabs Menu Mobile --- */
  .menu-tabs {
    justify-content: flex-start;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
  }

  .tab-btn {
    font-size: 1.1rem;
    padding: 0.5rem;
  }

  /* Rimpicciolisci un po' il titolo del menu del giorno su mobile */
  .menu-giorno-wrapper h2 {
    font-size: 1.6rem;
  }
}
