/* =============================================================================
   Velorex Music — coupons: the cart field and the promo card
   Used by: index.html, rendered by src/js/storefront/coupon.js
   ============================================================================= */

/* ---- Cart: apply a code -------------------------------------------------- */
.coupon-form {
  display: flex;
  gap: 0.5rem;
  margin: 0.9rem 0 0.2rem;
}
.coupon-input {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.coupon-input::placeholder { letter-spacing: 0.02em; text-transform: none; font-weight: 400; color: var(--text-muted); }
.coupon-input:focus { outline: 2px solid var(--secondary); outline-offset: 1px; }
[data-theme="light"] .coupon-input { background: #ffffff; }

.coupon-btn { flex: 0 0 auto; padding-inline: 1.1rem; }

.coupon-error {
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 600;
  margin-top: 0.45rem;
  line-height: 1.5;
}
.coupon-error[hidden] { display: none !important; }

.coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.9rem 0 0.2rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: rgba(0, 212, 170, 0.10);
  border: 1px dashed var(--success);
}
.coupon-tag {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--success);
}
.coupon-tag i { margin-right: 0.35rem; }
.coupon-remove {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.coupon-remove:hover { color: var(--danger); }

.summary-row.discount span:last-child { color: var(--success); font-weight: 700; }

/* ---- Promo card ----------------------------------------------------------
   A CORNER CARD, not a full-screen curtain. A full-screen overlay on arrival is
   what Google classifies as an intrusive interstitial — a documented mobile
   ranking negative — which is the same reason the intro splash is constrained
   the way it is (CLAUDE.md §15). This never covers the content and never
   blocks a click on the page behind it. Don't promote it to a modal. */
.coupon-promo {
  position: fixed;
  z-index: 900;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(20rem, calc(100vw - 2.5rem));
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(1.25rem);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease;
}
.coupon-promo.is-in { transform: translateY(0); opacity: 1; }

.promo-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.35rem;
  cursor: pointer;
}
.promo-close:hover { color: var(--text); }

.promo-eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}
.promo-headline {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.promo-min { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.3rem; }

.promo-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.6rem 0.85rem;
  border: 1px dashed var(--secondary);
  border-radius: 10px;
  background: rgba(255, 107, 53, 0.08);
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.promo-code:hover { background: rgba(255, 107, 53, 0.14); }
.promo-code.is-copied { border-style: solid; border-color: var(--success); color: var(--success); background: rgba(0, 212, 170, 0.10); }

.promo-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.55rem; }

@media (max-width: 480px) {
  .coupon-promo { right: 0.75rem; left: 0.75rem; bottom: 0.75rem; width: auto; }
}

/* The slide-in is the only motion here; the card itself still appears, because
   it is information rather than decoration. */
@media (prefers-reduced-motion: reduce) {
  .coupon-promo { transition: none; transform: none; opacity: 1; }
}
