/* ========================================
   MEDIA QUERY PER SMARTPHONE MOLTO STRETTI
   MAX-WIDTH: 375PX
   ======================================== */
@media (max-width: 400px) {
  html,
  body {
    font-size: 14px;
  }

  /* Top Banner */
  .top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    padding: 0px 10px;
    font-size: 11px;
    height: 50px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px; /* Spazio minimo tra testo e link */
  }

  .banner-text {
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .banner-link {
    font-size: 14px !important;
  }

  .top-banner a {
    font-size: 18px !important;
    padding-left: 4px;
    flex-shrink: 0;
  }

  .top-banner p {
    font-size: 12px;
  }

  /* Header Container */
  .header-container {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: var(--color-background-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  main {
    padding-top: 110px;
  }

  .logo {
    height: 55px;
  }

  .navbar {
    position: relative;
    z-index: 50;
    border-bottom: none;
    box-shadow: none;
  }

  .menu-desktop {
    display: none;
  }

  .hamburger-menu {
    display: flex;
    margin-left: auto;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 20px;
    cursor: pointer;
    z-index: 100;
    position: relative;
  }

  .hamburger-menu span {
    display: block;
    height: 2.5px;
    width: 100%;
    background-color: var(--color-primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Menu Mobile */
  .menu-mobile {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 115px;
    right: -100%;
    width: 180px;
    height: calc(100vh - 115px);
    background-color: var(--color-background-light);
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    padding: 30px 15px;
    gap: 25px;
    transition: right 0.3s ease;
    z-index: 40;

    background-color: #f2f6f2; /* verde chiarissimo, eco */
    box-shadow: -3px 0 12px rgba(0, 0, 0, 0.18);
  }

  .menu-mobile.active {
    right: 0;
  }

  .menu-mobile a {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.3s;
  }

  .menu-mobile a {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .menu-mobile a:focus-visible {
    outline: none;
  }

  .menu-mobile a:hover {
    color: var(--color-accent);
  }

  /* Hamburger animazione X */
  .hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger-menu.open span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Footer */
  .footer-section {
    padding: 25px 12px 8px 12px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }

  .contact-us,
  .legal-links {
    flex: 1 1 100%;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .follow-us {
    flex: 1 1 100%;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .contact-us-subtitle,
  .legal-links-subtitle,
  .follow-us-subtitle {
    text-align: left;
    width: 100%;
    padding-bottom: 2px;
  }

  .email-container,
  .telephone-container,
  .whatsapp-container {
    font-size: 14px;
  }

  .contact-us img {
    width: 35px;
    height: 35px;
  }

  .legal-links {
    border-left: none;
    border-right: none;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 18px 0;
  }

  .legal-links a {
    width: 100%;
  }

  .legal-links p {
    font-size: 14px;
    margin: 4px 0;
  }

  .where-to-follow {
    justify-content: center;
  }

  .footer-bottom {
    font-size: 12px;
    padding-top: 8px;
  }
}

@media (max-width: 480px) {
  /* Regola base per mobile */
  html,
  body {
    font-size: 16px; /* Aumenta la dimensione base del font */
  }

  /* Top Banner */
  .top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    padding: 5px 5px; /* meno spazio verticale e laterale */
    font-size: 12px; /* testo più piccolo */
    height: 60px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px; /* Spazio minimo tra testo e link */
  }

  .banner-text {
    font-size: 14px; /* Imposta la dimensione desiderata */
    white-space: nowrap; /* Impedisce che il testo nudo vada a capo */
    overflow: hidden; /* Nasconde se non c'è spazio */
    text-overflow: ellipsis; /* Opzionale: aggiunge i tre puntini se tagliato */
  }

  .banner-link {
    font-size: 20px !important;
  }

  .top-banner a {
    font-size: 10px;
    padding-left: 5px;
    flex-shrink: 0;
  }

  .top-banner p {
    font-size: 14px;
  }

  .header-container {
    position: fixed; /* AGGIUNTO */
    top: 60px; /* Si attacca 60px sotto l'alto (sotto il top-banner) */
    left: 0; /* Aggiunto */
    width: 100%; /* Aggiunto */
    z-index: 50; /* Z-index inferiore al banner, superiore al menu mobile */
    background-color: var(
      --color-background-light
    ); /* Assicura che copra il contenuto sottostante */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Ombra opzionale per staccare */
  }

  main {
    /* Altezza totale fissa (Top Banner 60px + Header Container ~60px) = 120px */
    padding-top: 120px; /* IMPOSTATO PER COMPENSARE L'HEADER FISSO */
  }

  .logo {
    height: 65px;
  }

  .navbar {
    position: relative; /* AGGIUNGI */
    z-index: 50; /* AGGIUNGI */
    border-bottom: none;
    box-shadow: none;
  }

  .menu-desktop {
    display: none;
  }

  .hamburger-menu {
    display: flex;
    margin-left: auto;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 100;
    position: relative;
  }

  .hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--color-primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Menu Mobile Overlay (finestra moderna) */
  .menu-mobile {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 125px;
    right: -100%; /* fuori dalla pagina */
    width: 200px;
    height: calc(100vh - 125px);
    background-color: var(--color-background-light);
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    padding: 40px 20px;
    gap: 30px;
    transition: right 0.3s ease;
    z-index: 40;

    background-color: #f2f6f2; /* verde chiarissimo, eco */
    box-shadow: -3px 0 12px rgba(0, 0, 0, 0.18);
  }

  /* Mostra menu mobile quando attivo */
  .menu-mobile.active {
    right: 0;
  }

  .menu-mobile a {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.3s;
  }

  .menu-mobile a {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .menu-mobile a:focus-visible {
    outline: none;
  }

  .menu-mobile a:hover {
    color: var(--color-accent);
  }

  /* Hamburger animazione X */
  .hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger-menu.open span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  /* --- Footer --- */
  .footer-section {
    padding: 30px 15px 10px 15px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  /*
   * 🛠️ MODIFICHE PER ALLINEARE TUTTO A SINISTRA TRANNE LE ICONE SOCIAL
   */

  .contact-us,
  .legal-links {
    flex: 1 1 100%;
    align-items: flex-start; /* Allinea a SINISTRA il contenuto della sezione Contattaci e Legal */
    gap: 10px;
    width: 100%;
  }

  .follow-us {
    flex: 1 1 100%;
    align-items: center; /* Mantiene CENTRATA solo la sezione Seguici Su (icone social) */
    gap: 10px;
    width: 100%;
  }

  .contact-us-subtitle,
  .legal-links-subtitle,
  .follow-us-subtitle {
    text-align: left; /* Allinea a SINISTRA i sottotitoli */
    width: 100%; /* Occupa tutta la larghezza per l'allineamento */
    padding-bottom: 2px;
  }

  .follow-us-subtitle {
    text-align: left; /* Ri-allinea a CENTRO il sottotitolo della sezione social */
  }

  .email-container,
  .telephone-container,
  .whatsapp-container {
    font-size: 16px;
  }

  .contact-us img {
    width: 40px;
    height: 40px;
  }

  .legal-links {
    border-left: none;
    border-right: none;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 0;
  }

  /* Garantisce che i link legali siano ben allineati a sinistra */
  .legal-links a {
    width: 100%;
  }

  .legal-links p {
    font-size: 16px;
    margin: 5px 0;
  }

  .where-to-follow {
    /* Mantiene il flex per le icone, che sono centrate dal genitore (.follow-us) */
    justify-content: center;
  }

  .footer-bottom {
    font-size: 14px;
    padding-top: 10px;
  }
}

/* FINE SEZIONE MEDIA QUERY PER MOBILE (MAX-WIDTH: 480PX) - AGGIORNATA */

/* ========================================
   MEDIA QUERY PER TABLET
   MAX-WIDTH: 768PX
   ======================================== */
@media (max-width: 768px) and (min-width: 481px) {
  html,
  body {
    font-size: 16px;
  }

  /* Top Banner */
  .top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    padding: 8px 15px;
    font-size: 13px;
    height: 45px;
  }

  .banner-text {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .banner-link {
    font-size: 16px !important;
  }

  .top-banner a {
    font-size: 11px;
    padding-left: 8px;
    flex-shrink: 0;
  }

  .top-banner p {
    font-size: 15px;
  }

  /* Header Container */
  .header-container {
    position: fixed;
    top: 45px;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: var(--color-background-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  main {
    padding-top: 115px;
  }

  .logo {
    height: 70px;
  }

  .navbar {
    position: relative;
    z-index: 50;
    border-bottom: none;
    box-shadow: none;
    padding: 0 20px;
  }

  .menu-desktop {
    display: none;
  }

  .hamburger-menu {
    display: flex;
    margin-left: auto;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 24px;
    cursor: pointer;
    z-index: 100;
    position: relative;
  }

  .hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--color-primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Menu Mobile */
  .menu-mobile {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 120px;
    right: -100%;
    width: 250px;
    height: calc(100vh - 120px);
    background-color: var(--color-background-light);
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    padding: 50px 25px;
    gap: 35px;
    transition: right 0.3s ease;
    z-index: 40;

    background-color: #f2f6f2; /* verde chiarissimo, eco */
    box-shadow: -3px 0 12px rgba(0, 0, 0, 0.18);
  }

  .menu-mobile.active {
    right: 0;
  }

  .menu-mobile a {
    font-size: 22px;
    font-weight: bold;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.3s;
  }

  .menu-mobile a {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .menu-mobile a:focus-visible {
    outline: none;
  }

  .menu-mobile a:hover {
    color: var(--color-accent);
  }

  /* Hamburger animazione X */
  .hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  .hamburger-menu.open span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .follow-us-subtitle {
    text-align: center;
  }
}

/* SMALL DESKTOP / LAPTOP - max-width 1024px */
/* ========================================
   MEDIA QUERY PER TABLET ORIZZONTALE / LAPTOP PICCOLI
   MAX-WIDTH: 1024PX
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  html,
  body {
    font-size: 16px;
  }

  /* Top Banner */
  .top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    padding: 10px 20px;
    font-size: 14px;
    height: 45px;
  }

  .banner-text {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .banner-link {
    font-size: 16px !important;
  }

  .top-banner a {
    font-size: 12px;
    padding-left: 10px;
    flex-shrink: 0;
  }

  .top-banner p {
    font-size: 16px;
  }

  /* Header Container */
  .header-container {
    position: fixed;
    top: 45px;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: var(--color-background-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  main {
    padding-top: 125px;
  }

  .logo {
    height: 75px;
  }

  .navbar {
    position: relative;
    z-index: 50;
    padding: 0 30px;
  }

  /* Menu Desktop visibile ma con dimensioni ridotte */
  .menu-desktop {
    display: flex;
    gap: 25px;
  }

  .menu-desktop a {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.3s;
  }

  .menu-desktop a:hover {
    color: var(--color-accent);
  }

  .hamburger-menu {
    display: none;
  }

  .menu-mobile {
    display: none;
  }
}
