/* Gift card page. Loaded after brand.css. */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gift-wrap {
  width: 100%;
  max-width: calc(1080px + var(--nd-gutter) * 2);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--nd-gutter) clamp(56px, 8vw, 96px);
  display: grid;
  gap: clamp(24px, 4vw, 40px);
}

/* Hero */
.gift-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.gift-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 14ch;
}
.gift-hero .lede { margin: 0 0 20px; max-width: 52ch; }
.gift-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--nd-text-2); }
.gift-points li { display: flex; gap: 10px; align-items: baseline; }
.gift-points li::before { content: "\2713"; color: var(--nd-gold); font-weight: 700; }

/* The card itself, used for the live preview and the result. */
.gift-preview { margin: 0; perspective: 1200px; }
.gift-card {
  position: relative;
  aspect-ratio: 1.68;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding: clamp(18px, 3.4vw, 28px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(124, 82, 255, 0.55), transparent 55%),
    radial-gradient(80% 70% at 0% 100%, rgba(10, 6, 30, 0.75), transparent 60%),
    linear-gradient(150deg, #33207a, #2a1b5c 45%, #1a1140);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: rotate(-2deg);
  transition: transform .4s var(--nd-ease);
}
.gift-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.2px solid var(--nd-gold-line);
  border-radius: 13px;
  pointer-events: none;
}
.gift-preview:hover .gift-card { transform: rotate(0deg) translateY(-4px); }
.gift-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gift-card__top img { width: min(190px, 52%); height: auto; }
.gift-card__top span {
  color: var(--nd-gold);
  font: 700 12px/1 var(--nd-font-sans);
  letter-spacing: .22em;
  text-transform: uppercase;
}
.gift-card__amount {
  align-self: center;
  font-family: var(--nd-font-display);
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.gift-card__names { position: absolute; right: clamp(18px, 3.4vw, 28px); top: 42%; display: grid; gap: 4px; text-align: right; color: #ddd5f6; font-size: 14px; max-width: 45%; }
.gift-card__names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-card__code {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #fff;
  color: #16131f;
  box-shadow: inset 4px 0 0 var(--nd-gold);
}
.gift-card__code span { font: 700 10px/1 var(--nd-font-sans); letter-spacing: .14em; text-transform: uppercase; color: #8a6514; }
.gift-card__code b { font: 700 clamp(13px, 2.2vw, 16px)/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .06em; white-space: nowrap; }
.gift-card__code em { margin-left: auto; font: 700 10px/1 var(--nd-font-sans); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: #2a1b5c; white-space: nowrap; }

/* Purchase form */
.gift-buy h2, .gift-result h2, .gift-lower h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 32px); }
.gift-buy { display: grid; gap: 8px; }
#gift-form { display: grid; gap: 8px; }
.gift-step { margin: 0; padding: 22px 0 6px; border: 0; border-top: 1px solid var(--nd-line); display: grid; gap: 16px; min-width: 0; }
.gift-step:first-of-type { border-top: 0; padding-top: 8px; }
.gift-step legend { display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 4px; font: 600 18px/1.3 var(--nd-font-display); color: var(--nd-text); float: left; width: 100%; }
.gift-step legend + * { clear: both; }
.gift-step__n {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nd-purple-tint);
  color: var(--nd-purple-text);
  font: 700 14px/1 var(--nd-font-sans);
}

.amount-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.nd .amount-chip {
  min-height: 64px;
  border: 1.5px solid var(--nd-line-strong);
  border-radius: var(--nd-radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--nd-text);
  font: 700 20px/1 var(--nd-font-display);
  cursor: pointer;
  transition: border-color .15s var(--nd-ease), background-color .15s var(--nd-ease), transform .15s var(--nd-ease);
}
.nd .amount-chip[data-cents="custom"] { font: 600 16px/1 var(--nd-font-sans); }
.nd .amount-chip:hover { border-color: var(--nd-gold-line); }
.nd .amount-chip:active { transform: scale(.97); }
.nd .amount-chip[aria-pressed="true"] { border-color: var(--nd-gold); background: var(--nd-gold-tint); color: var(--nd-gold); box-shadow: 0 0 0 3px rgba(228, 187, 92, 0.15); }
.nd .amount-chip:focus-visible { outline: 3px solid var(--nd-purple-text); outline-offset: 2px; }

.money-input { position: relative; display: block; max-width: 220px; }
.money-input > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--nd-gold); font-weight: 700; pointer-events: none; }
.nd .money-input input { padding-left: 30px !important; font-weight: 600; }

.gift-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.deliver-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deliver-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1.5px solid var(--nd-line-strong);
  border-radius: var(--nd-radius);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}
.deliver-option:has(input:checked) { border-color: var(--nd-gold); background: var(--nd-gold-tint); }
.deliver-option input { margin-top: 3px; accent-color: var(--nd-gold); width: 18px; height: 18px; flex-shrink: 0; }
.deliver-option b { display: block; color: var(--nd-text); }
.deliver-option small { color: var(--nd-muted); font-size: 14px; }

.gift-submit { display: grid; gap: 10px; padding-top: 14px; }
.gift-fine { margin: 0; color: var(--nd-muted); font-size: 14px; text-align: center; }
.gift-status { margin: 0; min-height: 1.4em; color: var(--nd-text-2); }
.gift-status[data-tone="error"] { color: var(--nd-danger); }
.gift-status[data-tone="good"] { color: var(--nd-success); }
.gift-notice { margin: 0 0 8px; padding: 14px 16px; border-radius: var(--nd-radius); background: var(--nd-warning-tint); color: var(--nd-warning); border: 1px solid rgba(242, 180, 90, 0.35); }

/* Result after checkout */
.gift-result { display: grid; gap: 14px; border-color: var(--nd-gold-line); }
.gift-result .lede { margin: 0; }
.gift-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.gift-facts dt { color: var(--nd-muted); }
.gift-facts dd { margin: 0; color: var(--nd-text); font-weight: 600; overflow-wrap: anywhere; }
.gift-facts dd.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--nd-gold); }

/* Balance and FAQ */
.gift-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 32px); align-items: start; }
.gift-balance { display: grid; gap: 12px; }
.gift-balance p { margin: 0; }
.balance-form { display: flex; gap: 10px; }
.balance-form .field { flex: 1; }
.nd .balance-form input { text-transform: uppercase; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .05em; }
.gift-faq details { border-top: 1px solid var(--nd-line); padding: 14px 0; }
.gift-faq details:last-child { border-bottom: 1px solid var(--nd-line); }
.gift-faq summary { cursor: pointer; font-weight: 600; color: var(--nd-text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.gift-faq summary::after { content: "+"; color: var(--nd-gold); font-size: 20px; line-height: 1; }
.gift-faq details[open] summary::after { content: "\2212"; }
.gift-faq summary::-webkit-details-marker { display: none; }
.gift-faq p { margin: 10px 0 0; color: var(--nd-text-2); line-height: 1.6; }

@media (max-width: 860px) {
  .gift-hero { grid-template-columns: 1fr; }
  .gift-preview { order: -1; max-width: 420px; width: 100%; margin-inline: auto; }
  .gift-lower { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .amount-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gift-fields, .deliver-options { grid-template-columns: 1fr; }
  .balance-form { flex-direction: column; }
  .gift-card__names { display: none; }
  .gift-card__code em { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gift-card, .gift-preview:hover .gift-card { transform: none; transition: none; }
}
