/* WP PWA Installer — Popup CSS (Mobile First) */

:root {
  --pwa-primary:    #3b82f6;
  --pwa-primary-dk: #2563eb;
  --pwa-text:       #1f2937;
  --pwa-text-muted: #6b7280;
  --pwa-bg:         #ffffff;
  --pwa-radius:     20px;
  --pwa-shadow:     0 25px 60px rgba(0, 0, 0, 0.25);
  --pwa-transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Overlay ───────────────────────────────── */
.pwa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  display: flex;
  align-items: flex-end;         /* Bottom sheet su mobile */
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pwa-overlay--visible {
  opacity: 1;
}

/* ── Popup card ────────────────────────────── */
.pwa-popup {
  background: var(--pwa-bg);
  border-radius: var(--pwa-radius) var(--pwa-radius) 0 0;
  box-shadow: var(--pwa-shadow);
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 480px;
  position: relative;
  transform: translateY(100%);
  transition: transform var(--pwa-transition);
  text-align: center;
}

.pwa-overlay--visible .pwa-popup {
  transform: translateY(0);
}

/* ── Tablet/Desktop: popup centrato ────────── */
@media (min-width: 600px) {
  .pwa-overlay {
    align-items: center;
  }

  .pwa-popup {
    border-radius: var(--pwa-radius);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform var(--pwa-transition), opacity 0.25s ease;
  }

  .pwa-overlay--visible .pwa-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ── Handle bar (mobile) ─────────────────── */
.pwa-popup::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: -16px auto 20px;

  @media (min-width: 600px) {
    display: none;
  }
}

/* ── Close button ────────────────────────── */
.pwa-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: var(--pwa-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.pwa-popup__close:hover {
  background: #e5e7eb;
}

/* ── Icon ────────────────────────────────── */
.pwa-popup__icon {
  margin-bottom: 16px;
}

.pwa-popup__icon img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ── Typography ──────────────────────────── */
.pwa-popup__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--pwa-text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.pwa-popup__text {
  font-size: 0.9375rem;
  color: var(--pwa-text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

/* ── Buttons ─────────────────────────────── */
.pwa-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 10px;
}

.pwa-popup__btn:active {
  transform: scale(0.97);
}

.pwa-popup__btn--primary {
  background: var(--pwa-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.pwa-popup__btn--primary:hover {
  background: var(--pwa-primary-dk);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.pwa-popup__btn--secondary {
  background: #ecfdf5;
  color: #059669;
  border: 2px solid #6ee7b7;
}

.pwa-popup__btn--secondary:hover {
  background: #d1fae5;
}

.pwa-popup__btn--ghost {
  background: transparent;
  color: var(--pwa-text-muted);
  font-weight: 400;
  font-size: 0.875rem;
  padding: 8px;
  margin-bottom: 0;
}

.pwa-btn-icon {
  font-size: 1.1rem;
}

/* ── iOS Steps ───────────────────────────── */
.pwa-ios-steps {
  text-align: left;
  padding: 0 0 0 20px;
  margin: 0 0 20px;
  color: var(--pwa-text);
  line-height: 1.8;
  font-size: 0.9375rem;
}

.pwa-ios-steps li {
  margin-bottom: 6px;
}

.pwa-ios-share-icon {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 0.8rem;
  font-style: normal;
  vertical-align: middle;
}

/* ── Section utility ─────────────────────── */
.pwa-popup__section {
  width: 100%;
}

/* ── Animazione bounce sull'icona ────────── */
@keyframes pwa-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.pwa-overlay--visible .pwa-popup__icon img {
  animation: pwa-bounce 2s ease-in-out 0.5s 2;
}

/* ── Riduzione movimento ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  .pwa-overlay, .pwa-popup, .pwa-popup__icon img {
    animation: none;
    transition: none;
  }
}
