/**
 * PERCHÉ: Gestisce lo stile visuale dei pulsanti Call to Action persistenti.
 *        Su mobile (<= 768px) mostra una barra fissa in fondo allo schermo con WhatsApp e Preventivo.
 *        Su desktop (>= 769px) trasforma WhatsApp in un pulsante fluttuante circolare posizionato in basso a sinistra.
 * UTILIZZO: Caricato globalmente sia nei layout standard che nel layout del wizard per mantenere lo stile intatto.
 * DIPENDENZE: FontAwesome 6 per le icone, variabili CSS del tema globale.
 * INFO: Isola lo stile dei pulsanti per evitare conflitti con altri fogli di stile specifici delle viste.
 */

/* --- COMPORTAMENTO SU DISPOSITIVI MOBILI (<= 768px) --- */
@media (max-width: 768px) {
  .gz-mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 87, 124, 0.15);
    padding: 12px 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(10, 18, 64, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
  }

  /* Aggiunge spazio in fondo alla pagina per evitare che la barra copra i contenuti finali */
  body {
    padding-bottom: 74px !important;
  }

  /* Gestione layout a pulsante unico su mobile (es. solo WhatsApp) */
  .gz-mobile-cta-bar:has(.gz-mobile-cta-whatsapp:only-child) {
    justify-content: center;
  }

  .gz-mobile-cta-bar:has(.gz-mobile-cta-whatsapp:only-child) .gz-mobile-cta-whatsapp {
    flex: 0 1 200px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* .gz-mobile-cta-bar:has(.gz-mobile-cta-whatsapp:only-child) .gz-mobile-cta-whatsapp::after {
    content: "WhatsApp";
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
  } */

  /* Gestione layout a pulsante unico su mobile (es. solo Preventivo) */
  .gz-mobile-cta-bar:has(.gz-mobile-cta-btn:only-child) {
    justify-content: center;
  }

  .gz-mobile-cta-bar:has(.gz-mobile-cta-btn:only-child) .gz-mobile-cta-btn {
    flex: 0 1 280px;
  }
}

/* --- STILI CONDIVISI DEI BOTTONI (applicati su mobile di base) --- */
.gz-mobile-cta-whatsapp {
  flex: .5;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease-in-out;
  padding: 2px;
  border-radius: 100%;
  position: absolute;
  width: 42px;
  height: 42px;
  line-height: 42px;
  top: -70px;
  right: 20px;
}

.gz-mobile-cta-whatsapp:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
}

.gz-mobile-cta-btn {
  flex: 1.3;
  background: linear-gradient(135deg, #00577c 0%, #007bb0 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 87, 124, 0.3);
  transition: all 0.2s ease-in-out;
  text-align: center;
  padding: 7px;
}

.gz-mobile-cta-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 87, 124, 0.2);
}

.gz-mobile-cta-btn i,
.gz-mobile-cta-whatsapp i {
  font-size: 1.15rem;
}

.gz-mobile-cta-btn .gz-arrow-icon {
  font-size: 0.85rem;
  margin-left: auto;
  opacity: 0.8;
  padding-right: 4px;
}

/* --- COMPORTAMENTO SU DISPOSITIVI DESKTOP (>= 769px) --- */
@media (min-width: 769px) {

  /* La barra diventa un contenitore invisibile fluttuante in basso a sinistra */
  .gz-mobile-cta-bar {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    z-index: 9999;
    pointer-events: none;
    /* Lascia passare i click sulle parti vuote */
  }

  /* Rende cliccabili solo i bottoni figli */
  .gz-mobile-cta-bar>* {
    pointer-events: auto;
  }

  /* Nasconde il bottone preventivo su desktop (presente solo nel menu del sito) */
  .gz-mobile-cta-btn {
    display: none !important;
  }

  /* WhatsApp diventa un pulsante circolare fluttuante di grande impatto visuale */
  .gz-mobile-cta-whatsapp {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    /* Forza la forma perfettamente circolare */
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
    padding: 0 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative;
  }

  .gz-mobile-cta-whatsapp i {
    font-size: 2.1rem !important;
    /* Icona ingrandita per una migliore visibilità su PC */
    margin: 0 !important;
  }

  /* Effetti di micro-animazione per l'hover su desktop */
  .gz-mobile-cta-whatsapp:hover {
    transform: scale(1.15) translateY(-4px);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.55) !important;
  }

  .gz-mobile-cta-whatsapp:active {
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
  }
}