/**
 * PWA install footer + iOS tutorial — Giada Pet Sitter & Store
 * Author: Luca — 07/05/2026 — event bot-lella-giada-20260507
 *
 * Componente site-wide visibile su tutte le pagine giadapetsitter.it.
 * Si nasconde automaticamente quando display-mode: standalone.
 *
 * Brand tokens (coerenti con palette Alessia chunk a1ed87ab):
 *   coral #F19D76, crema #FFF5E6, salvia #A8B99C, bordeaux #4B1528
 */

:root {
  --gpwa-coral:    #F19D76;
  --gpwa-coral-d:  #D97847;
  --gpwa-crema:    #FFF5E6;
  --gpwa-salvia:   #A8B99C;
  --gpwa-bordeaux: #4B1528;
  --gpwa-text:     #2A1419;
  --gpwa-text-mu:  #7a6a6f;
  --gpwa-radius:   16px;
  --gpwa-shadow:   0 -8px 32px rgba(75, 21, 40, 0.12);
}

/* Display-mode standalone => mai mostrare */
@media (display-mode: standalone), (display-mode: minimal-ui) {
  .gpwa-install-footer,
  .gpwa-ios-modal,
  .gpwa-generic-modal {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
   Footer site-wide — variante banner orizzontale
---------------------------------------------------------------- */

.gpwa-install-footer {
  display: none; /* attivata da JS quando trigger disponibile */
  background: #fff;
  border-top: 3px solid var(--gpwa-coral);
  box-shadow: var(--gpwa-shadow);
  padding: 16px 18px 18px;
  /* FIX 09/05/2026 — Marco: banner deve essere fixed bottom, prima era
     position:relative e finiva fuori viewport in fondo alla pagina (3060px).
     z-index 1050 sopra navbar (sticky-top 1020) e FAB whatsapp (1040). */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
}

.gpwa-install-footer.is-visible {
  display: block;
  animation: gpwa-slide-up 360ms cubic-bezier(.2,.8,.2,1) both;
}

/* FAB WhatsApp rimosso 11/05/2026 (Luca) — rimosse anche le compensazioni di posizione. */

@keyframes gpwa-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.gpwa-install-footer__inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.gpwa-install-footer__icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gpwa-coral) center/cover no-repeat;
  box-shadow: 0 4px 12px rgba(217, 120, 71, 0.28);
}

.gpwa-install-footer__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.gpwa-install-footer__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gpwa-text);
  line-height: 1.25;
}

.gpwa-install-footer__sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--gpwa-text-mu);
}

.gpwa-install-footer__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.gpwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 120ms ease, background 120ms;
  text-decoration: none;
}
.gpwa-btn:active { transform: scale(0.97); }

.gpwa-btn--primary {
  background: var(--gpwa-coral);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 120, 71, 0.32);
}
.gpwa-btn--primary:hover { background: var(--gpwa-coral-d); color: #fff; }

.gpwa-btn--ghost {
  background: transparent;
  color: var(--gpwa-text-mu);
  padding: 10px 12px;
}
.gpwa-btn--ghost:hover { color: var(--gpwa-text); }

.gpwa-install-footer__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--gpwa-text-mu);
  cursor: pointer;
  border-radius: 50%;
}
.gpwa-install-footer__close:hover { background: rgba(0,0,0,0.05); }

/* position:relative legacy rimosso 09/05/2026 — sostituito da position:fixed sopra */

/* Mobile: stack verticale */
@media (max-width: 600px) {
  .gpwa-install-footer__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  .gpwa-install-footer__icon { margin: 0 auto; }
  .gpwa-install-footer__actions { justify-content: center; }
}

/* ----------------------------------------------------------------
   Modal iOS tutorial
---------------------------------------------------------------- */

.gpwa-ios-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(11, 20, 26, 0.55);
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

.gpwa-ios-modal.is-visible {
  display: flex;
  animation: gpwa-fade-in 240ms ease both;
}

@keyframes gpwa-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.gpwa-ios-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: var(--gpwa-crema);
  border-radius: var(--gpwa-radius);
  box-shadow: 0 12px 40px rgba(75, 21, 40, 0.25);
  padding: 22px 20px 24px;
  overflow: hidden;
  animation: gpwa-slide-up 360ms cubic-bezier(.2,.8,.2,1) both;
}

.gpwa-ios-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gpwa-coral) 0%, var(--gpwa-coral-d) 100%);
}

.gpwa-ios-card__close {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--gpwa-text-mu);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.gpwa-ios-card__close:hover { background: rgba(0,0,0,0.05); }

.gpwa-ios-card__head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-right: 28px;
}

.gpwa-ios-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gpwa-coral) center/cover no-repeat;
  box-shadow: 0 4px 12px rgba(217, 120, 71, 0.28);
  flex: 0 0 auto;
}

.gpwa-ios-card__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--gpwa-bordeaux);
  line-height: 1.15;
}

.gpwa-ios-card__intro {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gpwa-text);
}

.gpwa-ios-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: gpwa-step;
}

.gpwa-ios-step {
  counter-increment: gpwa-step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid rgba(75, 21, 40, 0.10);
}
.gpwa-ios-step:first-child { border-top: 0; }

.gpwa-ios-step__num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gpwa-coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
}
.gpwa-ios-step__num::before { content: counter(gpwa-step); }

.gpwa-ios-step__text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--gpwa-text);
}
.gpwa-ios-step__text strong { color: var(--gpwa-bordeaux); }

.gpwa-ios-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f0eadf;
  vertical-align: -7px;
  margin: 0 2px;
}
.gpwa-ios-glyph svg { width: 14px; height: 14px; }

.gpwa-ios-card__footer {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--gpwa-text-mu);
  font-style: italic;
}

/* ----------------------------------------------------------------
   Modal generico universale (Firefox / Chromium senza engagement / altri)
   Luca 11/05/2026 — Task 3 universal install fallback.
   Stile parallelo al modal iOS — coerenza visiva, niente glifi SVG.
---------------------------------------------------------------- */

.gpwa-generic-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(11, 20, 26, 0.55);
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

.gpwa-generic-modal.is-visible {
  display: flex;
  animation: gpwa-fade-in 240ms ease both;
}

.gpwa-generic-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: var(--gpwa-crema);
  border-radius: var(--gpwa-radius);
  box-shadow: 0 12px 40px rgba(75, 21, 40, 0.25);
  padding: 22px 20px 24px;
  overflow: hidden;
  animation: gpwa-slide-up 360ms cubic-bezier(.2,.8,.2,1) both;
}

.gpwa-generic-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gpwa-coral) 0%, var(--gpwa-coral-d) 100%);
}

.gpwa-generic-card__close {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--gpwa-text-mu);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.gpwa-generic-card__close:hover { background: rgba(0,0,0,0.05); }

.gpwa-generic-card__head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding-right: 28px;
}

.gpwa-generic-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--gpwa-coral) center/cover no-repeat;
  box-shadow: 0 4px 12px rgba(217, 120, 71, 0.28);
  flex: 0 0 auto;
}

.gpwa-generic-card__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--gpwa-bordeaux);
  line-height: 1.15;
}

.gpwa-generic-card__intro {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gpwa-text);
}

.gpwa-generic-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: gpwa-gstep;
}

.gpwa-generic-step {
  counter-increment: gpwa-gstep;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid rgba(75, 21, 40, 0.10);
}
.gpwa-generic-step:first-child { border-top: 0; }

.gpwa-generic-step__num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gpwa-coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
}
.gpwa-generic-step__num::before { content: counter(gpwa-gstep); }

.gpwa-generic-step__text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--gpwa-text);
}
.gpwa-generic-step__text strong { color: var(--gpwa-bordeaux); }

.gpwa-generic-card__hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--gpwa-text-mu);
  font-style: italic;
}
