.gift-card,
.gift-standalone {
  --gift-champagne: #f3dcb5;
  --gift-pale: #eee6fb;
  --gift-night: #180d3b;
  --gift-surface:
    linear-gradient(151deg, transparent 28%, #a67bff1c 49%, transparent 65%),
    radial-gradient(ellipse at 95% 6%, #574093 0, #37227b 32%, #180d3b 75%);
}

.gift-standalone {
  --ink: #fff;
  --muted: var(--gift-pale);
  --line: #e9d8ff46;
  --paper: var(--gift-night);
  --purple: var(--gift-champagne);
  --action-ink: var(--gift-champagne);
  --gift-input: #1f1339;
  --gift-error: #ffd2ca;
  --gift-placeholder: #cbbdde;
  color-scheme: dark;
}

.gift-card .button,
.gift-activation-controls .button {
  background: var(--lime);
  color: #191a22;
}

.gift-card .button:hover,
.gift-activation-controls .button:hover {
  background: #d3eb39;
}

.gift-section {
  margin-block: 32px 104px;
}

.gift-card {
  display: grid;
  grid-template: "copy art" auto "action art" auto / 1.1fr 1fr;
  align-content: center;
  column-gap: clamp(24px, 4vw, 64px);
  min-height: 420px;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  border-radius: 32px;
  background: var(--gift-surface);
  color: #fff;
  box-shadow: inset 0 0 0 1px #f3dcb550;
}

.gift-copy {
  grid-area: copy;
  align-self: end;
}

.gift-copy h2 {
  max-width: 13ch;
  margin: 0 0 18px;
  color: inherit;
  font-size: clamp(36px, 4.3vw, 60px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.048em;
}

.gift-description {
  max-width: 41ch;
  color: #f2eaff;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.55;
  text-wrap: pretty;
}

.gift-action {
  grid-area: action;
  align-self: start;
  margin-top: 26px;
}

.gift-action .button {
  gap: 22px;
}

.gift-art {
  grid-area: art;
  display: grid;
  justify-items: center;
  align-items: center;
  min-width: 0;
}

.gift-art img {
  display: block;
  width: min(113%, 590px);
  max-width: none;
  height: auto;
  filter: drop-shadow(0 24px 25px #130633a1);
}

body.gift-preview-open {
  overflow: hidden;
}

.gift-dialog {
  box-sizing: border-box;
  width: calc(100% - 40px);
  max-width: 860px;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 28px 32px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  color-scheme: light;
  color: var(--ink);
}

.gift-dialog::backdrop {
  background: #191a2273;
  backdrop-filter: blur(6px);
}

.gift-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gift-dialog h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.gift-dialog .close-dialog {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.gift-dialog .close-dialog svg {
  width: 20px;
  height: 20px;
}

.gift-field label {
  margin: 0 0 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}

.gift-field {
  display: grid;
}

.gift-field :is(input, textarea),
#gift-occasion {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--gift-input, #fff);
  color: var(--ink);
  font-size: 16px;
}

.gift-personalization {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.gift-personalization .gift-field {
  min-width: 0;
}

.gift-personalization textarea {
  min-height: 84px;
  resize: vertical;
  font: inherit;
  font-size: 15px;
}

.gift-dialog :is([data-gift-field], [data-gift-email], [data-gift-promo-code]):focus {
  outline: none;
  border-color: var(--purple);
}

.gift-standalone [data-gift-email]:focus {
  outline: none;
  background: #2f2154;
  border-color: var(--gift-champagne);
}

.gift-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gift-occasion-picker {
  position: relative;
  min-width: 0;
}

#gift-occasion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 14px;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

#gift-occasion:disabled {
  cursor: default;
  opacity: .6;
}

#gift-occasion:hover:not(:disabled),
#gift-occasion[aria-expanded="true"] {
  border-color: var(--purple);
}

#gift-occasion svg,
.gift-occasion-options svg {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--purple);
}

#gift-occasion[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.gift-occasion-options:not([hidden]) {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  inset-block-start: calc(100% + 5px);
  display: grid;
  gap: 2px;
  max-height: min(360px, 45dvh);
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px #27144124;
}

.gift-occasion-options [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: start;
  cursor: pointer;
}

.gift-occasion-options [aria-selected="false"] svg {
  visibility: hidden;
}

.gift-occasion-options [aria-selected="true"] {
  background: var(--lavender, #f1edff);
}

.gift-occasion-options [role="option"]:hover {
  background: #eeebf8;
}

.gift-occasion-picker button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 1px;
}

.gift-certificate {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #211040;
  box-shadow: 0 10px 28px #27144120;
}

.gift-certificate canvas {
  display: block;
  width: 100%;
  height: auto;
}

.gift-expand {
  display: none;
}

@media (max-width: 680px), (hover: none) and (pointer: coarse) {
  .gift-expand {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 8px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: zoom-in;
  }

  .gift-expand span {
    padding: 5px 9px;
    border-radius: 8px;
    background: #18112de0;
    font-size: 12px;
  }

  .gift-expand:disabled span {
    visibility: hidden;
  }
}

.gift-fullscreen[open] {
  position: fixed;
  display: flex;
  flex-direction: column;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  overflow: hidden;
  background: #18112d;
  color: #fff;
}

.gift-fullscreen-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

.gift-fullscreen-controls button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #ffffff45;
  border-radius: 12px;
  background: #ffffff14;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.gift-fullscreen-controls [data-gift-close-fullscreen] {
  min-width: 44px;
  font-size: 24px;
}

.gift-fullscreen-view {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.gift-fullscreen-view canvas {
  flex: none;
  width: 100%;
  max-width: 1040px;
  height: auto;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}

.gift-fullscreen-view.is-zoomed canvas {
  width: 200%;
  max-width: none;
  max-height: none;
}

.gift-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gift-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.gift-details summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 550;
}

.gift-how {
  display: grid;
  gap: 10px;
  margin: 14px 0 12px;
  padding-inline-start: 22px;
  line-height: 1.5;
}

.gift-how li::marker {
  color: var(--purple);
  font-weight: 650;
}

.gift-how-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .gift-section {
    margin-block: 24px 64px;
  }

  .gift-card {
    grid-template: "copy" "art" "action" / 1fr;
    gap: 18px;
    min-height: 0;
    padding: 26px 22px 22px;
    border-radius: 24px;
  }

  .gift-copy h2 {
    margin-bottom: 12px;
    font-size: clamp(31px, 7.6vw, 44px);
  }

  .gift-art img {
    width: min(106%, 430px);
  }

  .gift-action {
    margin: 0;
  }

  .gift-action .button {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
    padding-inline: 16px;
  }

  .gift-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 20px;
  }

  .gift-dialog-heading {
    gap: 10px;
  }

  .gift-certificate {
    border-radius: 8px;
  }

}

.gift-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 18px;
}

.gift-flow {
  width: min(100%, 520px);
  gap: 10px;
  margin-top: 18px;
}

.gift-dialog .gift-flow {
  width: 100%;
}

.gift-flow p {
  line-height: 1.5;
}

.gift-dialog label[for="gift-buyer-email"] {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.gift-email-hint {
  color: var(--muted);
  font-size: 13px;
}

.gift-email-error,
.gift-code-error {
  color: var(--gift-error, #a32c2c);
  font-size: 14px;
}

.gift-agreements {
  display: grid;
  gap: 8px;
}

.gift-flow .gift-agreement {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 400;
}

.gift-field .gift-agreement input {
  appearance: auto;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--purple);
}

.gift-checkout-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 13px;
}

@media (max-width: 680px) {
  .gift-flow .gift-agreement { font-size: 15px; }
  .gift-checkout-documents { font-size: 12px; }
}

.gift-flow a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gift-page {
  width: min(800px, calc(100% - 32px));
  margin: 32px auto;
}

.gift-page-brand { font-weight: 650; margin-bottom: 25px; }
.gift-page h1 { line-height: 1.15; margin-bottom: 18px; }

@media (max-width: 680px) {
  .gift-occasion-options:not([hidden]) {
    position: static;
    margin-top: 5px;
  }
}

.gift-order-placed .gift-occasion-field,
.gift-order-placed .gift-personalization,
.gift-order-placed .gift-details {
  display: none;
}

.gift-promo {
  padding-block: 2px 6px;
  border-top: 1px solid var(--line);
}

.gift-promo summary {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  gap: 6px;
  color: var(--purple);
  font-size: 14px;
  cursor: pointer;
}

.gift-promo summary::-webkit-details-marker {
  display: none;
}

.gift-promo summary svg {
  display: block;
  width: 16px;
  height: 16px;
}

.gift-promo[open] summary svg {
  transform: rotate(180deg);
}

.gift-promo [role="status"] {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.gift-promo:has(input[aria-invalid="true"]) [role="status"] {
  color: #a32c2c;
}

.gift-dialog .gift-flow input[aria-invalid="true"] {
  border-color: #a32c2c;
}

.gift-invoice-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 16px;
  color: var(--muted);
}

.gift-invoice-total strong {
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.gift-editor[hidden],
.gift-page [data-gift-receipt] .gift-expand {
  display: none;
}

.gift-page [data-gift-download] {
  margin-top: 12px;
  color: var(--action-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gift-standalone {
  min-height: 100vh;
  padding-block: clamp(20px, 5vw, 48px) 36px;
  background: var(--gift-surface) fixed;
  color: var(--ink);
}

.gift-standalone .gift-page {
  margin-block: 0;
}

.gift-redeem-page {
  width: min(100% - 32px, 520px);
}

.gift-redeem-page .gift-page-brand {
  margin-bottom: 24px;
}

.gift-activation {
  padding: clamp(20px, 5.4vw, 36px);
  border: 1px solid #f3dcb552;
  border-radius: 22px;
  background: #180d3baa;
}

.gift-activation-controls .gift-flow {
  width: 100%;
  gap: 16px;
  margin: 0;
}

.gift-activation-controls h1 {
  margin: 0;
  font-size: clamp(28px, 6.4vw, 36px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.043em;
}

.gift-activation-controls h1 + p {
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.gift-activation-head {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.gift-activation-head p {
  color: var(--muted);
  font-size: 15px;
}

.gift-activation-controls .gift-field label {
  margin-bottom: 6px;
}

.gift-activation-controls input[aria-invalid="true"] {
  border-color: #ffc1b7;
}

.gift-activation-controls .button {
  min-height: 48px;
  padding: 12px 18px;
}

.gift-action-link {
  justify-self: start;
  min-height: 44px;
  padding: 8px 12px;
  margin-left: -12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--lime);
  font: 550 14px/1.4 var(--font, Onest, Arial, sans-serif);
  cursor: pointer;
}

.gift-action-link:hover {
  background: #e1f75b1c;
}

.gift-activation-controls .gift-status:not([hidden]) {
  margin-top: 12px;
}

.gift-field input::placeholder,
.gift-field textarea::placeholder {
  color: var(--gift-placeholder, var(--muted));
  opacity: 1;
}
