/* ═══════════════════════════════════════════════════════════════════════
   Promo popup - email → today's discount code (inc/promo-popup.php, 2026-09-11)

   Desktop: centred card. Phone: bottom sheet - the thumb reaches the field
   and the button, and the page stays visible above it.
   Uses the same tokens as the PDP exit popup (page-product.css) so the two
   read as one family.
   ═══════════════════════════════════════════════════════════════════════ */

.vh-promo-pop {
  position: fixed;
  inset: 0;
  z-index: var(--vh-z-modal, 10000);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.vh-promo-pop[hidden] { display: none; }

.vh-promo-pop__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 21, 0.55);
  animation: vhPromoFade 240ms var(--vh-ease-out, ease-out);
}

.vh-promo-pop__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--vh-white, #fff);
  border-radius: var(--vh-radius-xl, 20px);
  box-shadow: var(--vh-shadow-xl, 0 24px 60px rgba(0, 0, 0, 0.2));
  padding: 36px 32px 28px;
  text-align: center;
  font-family: var(--vh-font-body, inherit);
  color: var(--vh-espresso, #2C2825);
  animation: vhPromoRise 320ms var(--vh-ease-out, ease-out);
}

@keyframes vhPromoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vhPromoRise {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.vh-promo-pop__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--vh-warm-gray, #A89F95);
  cursor: pointer;
  border-radius: 50%;
}
.vh-promo-pop__close:hover,
.vh-promo-pop__close:focus-visible { color: var(--vh-ink, #1A1715); background: var(--vh-linen, #F5F0EB); }

/* The occasion - the reason for the discount. */
.vh-promo-pop__badge {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--vh-linen, #F5F0EB);
  color: #C4623A;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.vh-promo-pop__badge:empty { display: none; }

.vh-promo-pop__title {
  margin: 0 0 8px;
  font-family: var(--vh-font-heading, inherit);
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--vh-ink, #1A1715);
  letter-spacing: -0.01em;
}

.vh-promo-pop__text {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--vh-charcoal, #4A4440);
}

.vh-promo-pop__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.vh-promo-pop__input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--vh-sand, #EDE7DF);
  border-radius: var(--vh-radius-md, 10px);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS Safari from zooming into the field */
  color: var(--vh-ink, #1A1715);
  background: var(--vh-white, #fff);
  box-sizing: border-box;
}
.vh-promo-pop__input:focus {
  outline: none;
  border-color: var(--vh-ink, #1A1715);
  box-shadow: 0 0 0 3px rgba(26, 23, 21, 0.08);
}

.vh-promo-pop__hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.vh-promo-pop__submit,
.vh-promo-pop__continue {
  width: 100%;
  min-height: 50px;
  justify-content: center;
}
.vh-promo-pop__submit[disabled] { opacity: 0.7; cursor: progress; }

.vh-promo-pop__msg {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--vh-error, #DC2626);
}

.vh-promo-pop__consent {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--vh-warm-gray, #A89F95);
}

.vh-promo-pop__dismiss {
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--vh-charcoal, #4A4440);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ── Code step ─────────────────────────────────────────────────────── */

.vh-promo-pop__label {
  margin: 4px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vh-charcoal, #4A4440);
}

.vh-promo-pop__code {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 0 auto 16px;
  max-width: 320px;
  border: 2px dashed #C4623A;
  border-radius: var(--vh-radius-md, 10px);
  overflow: hidden;
}

.vh-promo-pop__code-value {
  flex: 1;
  padding: 14px 12px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--vh-ink, #1A1715);
  user-select: all;
}

.vh-promo-pop__copy {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 0;
  border-left: 2px dashed #C4623A;
  background: var(--vh-linen, #F5F0EB);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--vh-ink, #1A1715);
  cursor: pointer;
}
.vh-promo-pop__copy:hover,
.vh-promo-pop__copy:focus-visible { background: var(--vh-sand, #EDE7DF); }

/* ── Phone: bottom sheet ───────────────────────────────────────────── */

@media (max-width: 600px) {
  .vh-promo-pop {
    align-items: flex-end;
    padding: 0;
  }
  .vh-promo-pop__dialog {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 30px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    animation-name: vhPromoSheet;
  }
  @keyframes vhPromoSheet {
    from { transform: translateY(100%); }
    to   { transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .vh-promo-pop__overlay,
  .vh-promo-pop__dialog { animation: none; }
}
