/* ── Email Capture Popup ── */

#emailPopupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#emailPopupOverlay.ep-visible {
  opacity: 1;
  pointer-events: auto;
}

#emailPopup {
  background: var(--cream);
  border-radius: 10px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  display: flex;
  overflow: hidden;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

#emailPopupOverlay.ep-visible #emailPopup {
  transform: scale(1);
}

/* Close button */
.ep-close {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  z-index: 1;
}

.ep-close:hover { color: var(--mauve-dark); }

/* Left panel */
.ep-left {
  width: 110px;
  background: linear-gradient(160deg, var(--mauve), var(--mauve-dark));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 0.75rem;
  flex-shrink: 0;
  gap: 1rem;
}

.ep-deco-line {
  width: 1px;
  height: 28px;
  background: rgba(201, 151, 58, 0.45);
}

.ep-brand-name {
  color: var(--mauve-pale);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Cormorant Garamond', Georgia, serif;
  white-space: nowrap;
}

/* Right panel — shared */
.ep-right {
  padding: 1.75rem 1.5rem 1.5rem;
  flex: 1;
  min-width: 0;
}

/* ── Main state ── */
#epMain { display: block; }
#epSuccess { display: none; }

.ep-tag {
  background: var(--mauve-pale);
  color: var(--mauve);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.ep-tag img { width: 13px; height: 13px; }

.ep-headline {
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.ep-perks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.ep-perk {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-mid);
}

.ep-perk img { width: 14px; height: 14px; flex-shrink: 0; }

.ep-field-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.2s;
}

.ep-field-wrap:focus-within { border-color: var(--mauve); }
.ep-field-wrap.ep-error { border-color: #c0392b; }

.ep-field-wrap img { width: 14px; height: 14px; opacity: 0.5; flex-shrink: 0; }

.ep-field-wrap input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.82rem;
  color: var(--text-dark);
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}

.ep-field-wrap input::placeholder { color: var(--text-muted); }

.ep-submit,
.ep-shop-btn {
  background: var(--mauve);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.68rem 0;
  font-size: 0.82rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-weight: 500;
  transition: opacity 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.ep-submit:hover,
.ep-shop-btn:hover { opacity: 0.88; }

.ep-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.ep-submit img,
.ep-shop-btn img { width: 15px; height: 15px; filter: brightness(0) invert(1); }

.ep-error-msg {
  color: #c0392b;
  font-size: 0.74rem;
  text-align: center;
  margin-top: 0.4rem;
}

.ep-dismiss {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}

.ep-dismiss:hover { color: var(--mauve-dark); }

.ep-fine-print {
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-top: 0.5rem;
  line-height: 1.4;
  text-align: center;
}

/* ── Success state ── */
#epSuccess {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ep-success-icon {
  width: 52px;
  height: 52px;
  background: var(--mauve-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.ep-success-icon img { width: 26px; height: 26px; }

.ep-success-headline {
  color: var(--text-dark);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.ep-success-body {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.ep-discount-badge {
  background: var(--mauve-pale);
  border: 1px dashed var(--mauve-light);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.ep-badge-label {
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.ep-badge-amount {
  color: var(--mauve-dark);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.ep-badge-sub {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* ── Discount row in cart ── */
.cs-row.ep-discount-row { color: var(--green); }
.cs-row.ep-discount-row span:first-child { font-weight: 500; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .ep-left { width: 80px; }
  .ep-brand-name { font-size: 0.55rem; }
  .ep-headline { font-size: 1rem; }
  .ep-right { padding: 1.25rem 1.1rem 1.1rem; }
}

@media (max-width: 375px) {
  .ep-left { display: none; }
  .ep-right { padding: 1.25rem 1rem 1rem; }
  .ep-badge-amount { font-size: 1.1rem; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
