/* ============================================================
   POPUP COMEMORATIVO 30 ANOS
   Adicionar no final de css/sections.css (ou em popup30.css)
   ============================================================ */

.popup30 {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.popup30.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.popup30-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.popup30-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, #0e0e12 0%, #1a1a1f 100%);
  border: 1px solid rgba(212, 164, 55, 0.35);
  border-radius: 12px;
  padding: 56px 48px 44px;
  text-align: center;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 164, 55, 0.08);
  transform: translateY(20px) scale(0.97);
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
  margin: auto;
}

.popup30.is-open .popup30-card {
  transform: translateY(0) scale(1);
}

/* Acento dourado decorativo no topo */
.popup30-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold, #d4a437) 50%,
    transparent 100%);
}

.popup30-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(212, 164, 55, 0.25);
  background: transparent;
  color: var(--gold, #d4a437);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 220ms ease;
}

.popup30-close:hover,
.popup30-close:focus-visible {
  background: var(--gold, #d4a437);
  color: #0e0e12;
  border-color: var(--gold, #d4a437);
  outline: none;
  transform: rotate(90deg);
}

.popup30-eyebrow {
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--gold, #d4a437);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.popup30-logo {
  display: block;
  max-width: 100%;
  height: auto;
  width: 440px;
  margin: 0 auto 22px;
  filter: drop-shadow(0 6px 20px rgba(212, 164, 55, 0.15));
}

.popup30-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
  color: #f5f0e8;
  margin: 0 0 14px;
  text-wrap: balance;
}

.popup30-title em {
  font-style: italic;
  color: var(--gold, #d4a437);
  font-weight: 500;
}

.popup30-text {
  font-family: 'Inter Tight', sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(245, 240, 232, 0.75);
  margin: 0 auto 28px;
  max-width: 460px;
  text-wrap: pretty;
}

.popup30-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.popup30-btn {
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 240ms ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.popup30-btn-primary {
  background: var(--gold, #d4a437);
  color: #0e0e12;
  border-color: var(--gold, #d4a437);
}

.popup30-btn-primary:hover,
.popup30-btn-primary:focus-visible {
  background: var(--gold-light, #e8c366);
  border-color: var(--gold-light, #e8c366);
  transform: translateY(-1px);
  outline: none;
}

.popup30-btn-ghost {
  background: transparent;
  color: rgba(245, 240, 232, 0.8);
  border-color: rgba(245, 240, 232, 0.22);
}

.popup30-btn-ghost:hover,
.popup30-btn-ghost:focus-visible {
  color: #f5f0e8;
  border-color: rgba(245, 240, 232, 0.55);
  outline: none;
}

.popup30-btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 240ms ease;
}

.popup30-btn-primary:hover .popup30-btn-arrow {
  transform: translateX(3px);
}

/* Responsivo: tablet */
@media (max-width: 720px) {
  .popup30-card { padding: 48px 32px 36px; }
  .popup30-logo { max-width: 360px; width: 80%; }
  .popup30-title { font-size: clamp(20px, 5vw, 26px); }
}

/* Responsivo: mobile */
@media (max-width: 560px) {
  .popup30 { padding: 12px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .popup30-card {
    padding: 44px 20px 28px;
    border-radius: 10px;
  }
  .popup30-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
  }
  .popup30-eyebrow {
    font-size: 10px;
    letter-spacing: 0.28em;
    margin-bottom: 14px;
  }
  .popup30-logo { width: 78%; max-width: 280px; margin-bottom: 16px; }
  .popup30-title { font-size: 22px; line-height: 1.22; margin-bottom: 12px; }
  .popup30-text { font-size: 13.5px; line-height: 1.55; margin-bottom: 22px; }
  .popup30-actions { flex-direction: column; gap: 10px; }
  .popup30-btn { width: 100%; justify-content: center; padding: 14px 20px; }
}

/* Telemóveis muito pequenos (320-360px) */
@media (max-width: 360px) {
  .popup30-card { padding: 40px 16px 24px; }
  .popup30-logo { width: 85%; max-width: 240px; }
  .popup30-title { font-size: 20px; }
  .popup30-text { font-size: 13px; }
}

/* Respeita prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .popup30,
  .popup30-card,
  .popup30-close,
  .popup30-btn,
  .popup30-btn-arrow {
    transition: none !important;
    transform: none !important;
  }
}
