/* ═══════════════════════════════════════════════════════════════
   POPUP SALONE DEL LIBRO TORINO 2026
   Scade automaticamente dopo il 18 Maggio 2026
   ═══════════════════════════════════════════════════════════════ */

/* Overlay scuro dietro il popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.75rem;
  animation: popupFadeIn 0.4s ease-out;
  overflow-y: auto;
}

@keyframes popupFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popupSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

.popup-overlay--closing {
  animation: popupFadeOut 0.3s ease-in forwards;
}

@keyframes popupFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Card del popup */
.popup-card {
  position: relative;
  max-width: 360px;
  width: 100%;
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  background: #fdf8f0; /* --cream */
  border-radius: 1.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.2);
  animation: popupSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.popup-overlay--closing .popup-card {
  animation: popupSlideOut 0.3s ease-in forwards;
}

/* Pulsante chiudi — adattato a sfondo chiaro, touch-friendly */
.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #44403c;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, color 0.2s;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
}

.popup-close:hover {
  background: #fff;
  color: #1c1917;
  transform: scale(1.1);
}

.popup-close:focus-visible {
  outline: 2px solid #d97706;
  outline-offset: 2px;
}

/* Header con logo — sfondo chiaro per leggibilità del logo nero */
.popup-header {
  background: linear-gradient(135deg, #fef7ed 0%, #fef3c7 50%, #fde68a 100%);
  padding: 1.25rem 1rem 0.75rem;
  position: relative;
}

.popup-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, #d97706, transparent);
}

.popup-logo {
  width: 200px;
  height: auto;
  max-width: 80%;
  border-radius: 0.5rem;
}

/* Body */
.popup-body {
  padding: 1rem 1.25rem 0.75rem;
}

.popup-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.popup-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0 0 0.15rem;
  line-height: 1.2;
}

.popup-city {
  font-size: 0.95rem;
  color: #78716c;
  margin: 0 0 0.75rem;
}

.popup-date {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.popup-date-month {
  font-style: italic;
  color: #92400e;
}

.popup-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: #92400e;
  margin-bottom: 0.75rem;
}

.popup-location svg {
  flex-shrink: 0;
  color: #d97706;
}

.popup-location strong {
  color: #78350f;
}

.popup-cta {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 0.9rem;
  font-style: italic;
  color: #57534e;
  margin: 0;
  line-height: 1.45;
}

.popup-cta em {
  color: #92400e;
  font-weight: 600;
  font-style: italic;
}

/* Badge omaggio CD Audio */
.popup-gift {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 0.5rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  color: #78350f;
  margin-top: 0.6rem;
  line-height: 1.35;
}

.popup-gift svg {
  flex-shrink: 0;
  color: #d97706;
}

.popup-gift strong {
  color: #92400e;
}

/* Footer con countdown */
.popup-footer {
  padding: 0.35rem 1.25rem 0.65rem;
}

.popup-countdown {
  display: inline-block;
  font-size: 0.7rem;
  color: #a8a29e;
  letter-spacing: 0.05em;
}

.popup-countdown::before {
  content: '⟳ ';
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .popup-overlay {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 0.75rem;
  }

  .popup-card {
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 0.75rem;
  }

  .popup-header {
    padding: 0.75rem 0.5rem 0.5rem;
  }

  .popup-logo {
    width: 140px;
  }

  .popup-body {
    padding: 0.75rem 0.75rem 0.5rem;
  }

  .popup-title {
    font-size: 1.05rem;
  }

  .popup-date {
    font-size: 1rem;
  }

  .popup-location {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
  }

  .popup-cta {
    font-size: 0.82rem;
  }

  .popup-gift {
    font-size: 0.68rem;
    padding: 0.3rem 0.5rem;
  }

  .popup-footer {
    padding: 0.25rem 0.75rem 0.5rem;
  }
}
