/* =============================================================
   Gift card wizard (/gift-card) — rebrand/giftcard/UI.

   Same wizard chrome as /quick-order (step pills, white cards on the
   pale-blue page, navy summary panel, red step CTA), scoped to
   #gift-card so it can load on layouts.app without touching the
   legacy bundle.

   NOTE: the chrome here duplicates sc-quick-order.css rather than
   sharing it. Deliberate for now — the alacarte page is committed and
   verified, and a late refactor of its stylesheet is a worse risk than
   two copies. If a third wizard appears, extract the shared chrome
   into one `.sc-wizard` stylesheet and have all three use it.

   Typography per the reference: Lora for the page heading, step labels,
   card titles and the summary heading; Circular Std for body copy, Bold
   on every figure.
   ============================================================= */

#gift-card {
  background-color: var(--sc-pale-blue);
  padding: var(--sc-space-8) 0 var(--sc-space-9);
  color: var(--sc-text);
  font-size: var(--sc-small);
}

/* The legacy bundle puts `padding: 20px` on every form (css/style.css:412),
   which makes the columns narrower than the heading above them. The form is a
   wrapper here; the cards supply their own padding. */
#gift-card form {
  padding: 0;
}

/* One measure for the wizard, centred, so the form has air either side instead
   of running edge to edge — matching /quick-order.
   The !important is not decoration: scancafe.css:1613 sets
   `.container { max-width: 1370px !important }` above 1401px, and nothing beats
   an !important without one. Scoped to this page; remove both together if that
   legacy rule ever goes. */
#gift-card .gc-container {
  max-width: 1180px !important;
  margin-inline: auto;
}

/* ---------- intro ---------- */

#gift-card .gc-intro {
  margin-bottom: var(--sc-space-6);
}

/* No font-size here: the site-wide h1 rule in sc-components.css owns it.
   This page-local clamp capped at 34px, which is why this heading was smaller
   than the same heading on every other page. Mirrors sc-quick-order.css. */
#gift-card .gc-intro h1 {
  margin: 0 0 var(--sc-space-3);
  color: var(--sc-navy);
  line-height: 1.2;
}

#gift-card .gc-intro p {
  margin: 0;
  max-width: 660px;
  line-height: 1.55;
}

/* ---------- messages ---------- */

#gift-card .gc-alert {
  margin-bottom: var(--sc-space-5);
  padding: var(--sc-space-4);
  border: 1px solid var(--sc-red);
  border-radius: var(--sc-radius);
  background: #fff;
  color: var(--sc-red);
}

#gift-card .gc-alert ul {
  margin: 0;
  padding-left: 1.2em;
}

#gift-card .gc-error {
  margin: var(--sc-space-4) 0 0;
  color: var(--sc-red);
  font-weight: var(--sc-weight-medium);
}

/* Off-screen rather than display:none — some bots skip hidden inputs. */
#gift-card .gc-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- layout ---------- */

#gift-card .gc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "steps aside"
    "body aside"
    "nav aside";
  gap: var(--sc-space-5);
  align-items: start;
}

#gift-card .gc-main {
  display: contents;
}

#gift-card .gc-steps {
  grid-area: steps;
}

#gift-card .gc-panel:not([hidden]) {
  display: contents;
}

#gift-card .gc-panel[hidden] {
  display: none;
}

#gift-card .gc-panel-body {
  grid-area: body;
  min-width: 0;
}

#gift-card .gc-nav {
  grid-area: nav;
}

#gift-card .gc-aside {
  grid-area: aside;
}

/* ---------- step pills ---------- */

#gift-card .gc-steps {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

#gift-card .gc-steps > li {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

#gift-card .gc-step {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--sc-border-soft);
  border-radius: var(--sc-radius-pill);
  background: #fff;
  /* Not-reached steps are grey; active and completed override to navy. */
  color: var(--sc-text-muted);
  font-family: var(--sc-font-heading);
  font-size: 1rem;
  font-weight: var(--sc-weight-medium);
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(5, 47, 86, 0.04);
  cursor: pointer;
  transition: border-color var(--sc-transition), color var(--sc-transition), box-shadow var(--sc-transition);
}

/* Upcoming steps: light gray badge + muted digit (same language as /quick-order). */
#gift-card .gc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sc-border-soft);
  color: var(--sc-text-muted);
  font-family: var(--sc-font);
  font-size: 0.875rem;
  font-weight: var(--sc-weight-bold);
}

/* Active pill: white fill, light-blue ring, navy label + filled step circle (rebrand mock). */
#gift-card .gc-step-active {
  border-color: var(--sc-navy);
  background: #fff;
  color: var(--sc-navy);
  box-shadow: none;
}

#gift-card .gc-step-active .gc-step-num {
  background: var(--sc-navy);
  color: var(--sc-on-brand);
}

#gift-card .gc-step-done {
  border-color: var(--sc-border-soft);
  background: #fff;
  color: var(--sc-navy);
  box-shadow: none;
}

#gift-card .gc-step-done .gc-step-num {
  background: var(--sc-navy);
  color: var(--sc-on-brand);
  font-size: 0.75rem;
}

/* ---------- cards ---------- */

#gift-card .gc-card {
  padding: var(--sc-space-5);
  border: 1px solid var(--sc-border-soft);
  border-radius: var(--sc-radius-lg);
  background: #fff;
  box-shadow: var(--sc-shadow-card);
}

#gift-card .gc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sc-space-4);
  align-items: start;
}

/* ---------- 1: amount ---------- */

#gift-card .gc-amount-card {
  display: grid;
  /* Art column 360px (was 220, then 297). The image is width:100% of this
     column, so the column is what sizes it.

     NOTE: gift-card.png is only 320x209, so past ~320 the browser is
     upscaling. 360 is 1.13x native -- soft under close inspection but fine
     at normal viewing. A 720x470 (2x) export would render it crisply and
     would need no CSS change. The layout ceiling is ~408px, past which the
     amount grid (4 x 94px + gaps = 400px) would be squeezed. */
  grid-template-columns: 360px minmax(0, 1fr);
  gap: var(--sc-space-5);
  align-items: center;
}

#gift-card .gc-card-art {
  width: 100%;
  height: auto;
  border-radius: var(--sc-radius);
}

#gift-card .gc-amount-body h2 {
  margin: 0 0 4px;
  color: var(--sc-navy);
  font-family: var(--sc-font-heading);
  font-size: var(--sc-h4);
  font-weight: var(--sc-weight-medium);
}

#gift-card .gc-amount-blurb {
  margin: 0 0 var(--sc-space-4);
  color: var(--sc-text-muted);
  font-size: 12px;
}

#gift-card .gc-amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sc-space-2);
  max-width: 400px;
  padding-top: var(--sc-space-4);
  border-top: 1px solid var(--sc-border-soft);
}

#gift-card .gc-amount-opt {
  margin: 0;
  cursor: pointer;
}

/* Off-screen, not display:none, so the radio keeps keyboard focus. */
#gift-card .gc-amount-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#gift-card .gc-amount-pill {
  display: block;
  padding: 9px 4px;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: #fff;
  color: var(--sc-text);
  font-size: 13px;
  text-align: center;
  transition: border-color var(--sc-transition), color var(--sc-transition);
}

#gift-card .gc-amount-opt:hover .gc-amount-pill {
  border-color: var(--sc-light-blue);
}

#gift-card .gc-amount-opt input:checked + .gc-amount-pill {
  border-color: var(--sc-light-blue);
  box-shadow: 0 0 0 1px var(--sc-light-blue);
  color: var(--sc-navy);
  font-weight: var(--sc-weight-bold);
}

#gift-card .gc-amount-opt input:focus-visible + .gc-amount-pill {
  outline: 2px solid var(--sc-navy);
  outline-offset: 2px;
}

/* ---------- 2 & 3: form cards ---------- */

#gift-card .gc-fields h2 {
  margin: 0 0 var(--sc-space-4);
  color: var(--sc-navy);
  font-family: var(--sc-font-heading);
  font-size: var(--sc-h5);
  font-weight: var(--sc-weight-medium);
}

#gift-card .gc-fields label {
  display: block;
  margin-bottom: 4px;
  color: var(--sc-navy);
  font-size: 12px;
  font-weight: var(--sc-weight-medium);
}

#gift-card .gc-opt {
  color: var(--sc-text-muted);
  font-weight: var(--sc-weight-regular);
}

#gift-card .gc-fields input,
#gift-card .gc-fields select {
  width: 100%;
  margin-bottom: var(--sc-space-3);
  padding: 9px var(--sc-space-3);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: #fff;
  color: var(--sc-navy);
  font-family: inherit;
  font-size: var(--sc-small);
}

#gift-card .gc-fields input:focus-visible,
#gift-card .gc-fields select:focus-visible {
  outline: 2px solid var(--sc-light-blue);
  outline-offset: 1px;
}

/* Card number + brand icons. Same treatment as the alacarte payment page:
   all four sit greyed inside the field and the matching one lights up. */
#gift-card .gc-cc-field {
  position: relative;
  display: block;
}

#gift-card .gc-cc-field input {
  /* room for the four icons so long numbers do not run under them */
  padding-right: 7.5rem;
}

#gift-card .gc-cc-icons {
  position: absolute;
  top: 50%;
  right: 10px;
  display: flex;
  gap: 4px;
  align-items: center;
  /* the field keeps the click, not the icons */
  pointer-events: none;
  transform: translateY(-50%);
  /* the input carries a bottom margin; centre on the box, not the margin */
  margin-top: calc(var(--sc-space-3) / -2);
}

#gift-card .gc-cc-icons .fa {
  color: var(--sc-text);
  font-size: var(--sc-h4);
  line-height: 1;
  opacity: .22;
  transition: opacity var(--sc-transition), color var(--sc-transition);
}

#gift-card .gc-cc-icons .fa.is-active {
  color: var(--sc-light-blue);
  opacity: 1;
}

#gift-card .gc-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sc-space-3);
  align-items: end;
}

/* Month (select) and year/CVV (inputs) share padding globally but browsers size selects differently. */
#gift-card .gc-card-row input,
#gift-card .gc-card-row select {
  box-sizing: border-box;
  height: 2.5rem;
  min-height: 2.5rem;
  margin-bottom: 0;
  line-height: 1.25;
}

#gift-card .gc-recaptcha {
  margin-top: var(--sc-space-3);
}

/* ---------- 3: payment (unified panel) ---------- */

#gift-card [data-panel="3"] .gc-payment-panel {
  padding: var(--sc-space-5);
}

#gift-card [data-panel="3"] .gc-payment-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sc-space-5);
  align-items: start;
}

#gift-card [data-panel="3"] .gc-payment-card {
  padding-left: var(--sc-space-5);
  border-left: 1px solid var(--sc-border-soft);
}

#gift-card [data-panel="3"] .gc-payment-billing h2,
#gift-card [data-panel="3"] .gc-payment-card h2 {
  margin: 0 0 var(--sc-space-3);
}

#gift-card [data-panel="3"] .gc-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sc-space-3);
  margin-bottom: var(--sc-space-3);
}

#gift-card [data-panel="3"] .gc-field-cell {
  margin-bottom: var(--sc-space-3);
  min-width: 0;
}

#gift-card [data-panel="3"] .gc-field-row .gc-field-cell {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-field-cell--last {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-payment-billing .gc-field-cell:last-child,
#gift-card [data-panel="3"] .gc-payment-card .gc-recaptcha {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-fields input,
#gift-card [data-panel="3"] .gc-fields select {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-card-row {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-card-row > div {
  min-width: 0;
}

#gift-card [data-panel="3"] .gc-recaptcha {
  margin-top: var(--sc-space-2);
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-cc-field input {
  margin-bottom: 0;
}

#gift-card [data-panel="3"] .gc-cc-icons {
  margin-top: 0;
}

/* ---------- nav ---------- */

#gift-card .gc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sc-space-3);
  margin-top: 0;
}

#gift-card .gc-btn {
  padding: 11px var(--sc-space-6);
  border: 0;
  border-radius: var(--sc-radius);
  font-family: inherit;
  font-size: var(--sc-small);
  font-weight: var(--sc-weight-medium);
  cursor: pointer;
  transition: background-color var(--sc-transition);
}

#gift-card .gc-btn-next {
  background: var(--sc-red);
  color: var(--sc-on-brand);
}

#gift-card .gc-btn-next:hover {
  background: var(--sc-navy);
}

#gift-card .gc-btn-back {
  background: var(--sc-text-muted);
  color: var(--sc-on-brand);
}

#gift-card .gc-btn-back:hover {
  background: var(--sc-navy);
}

/* Final CTA is light blue, matching the alacarte wizard. */
#gift-card .gc-btn-submit {
  width: 100%;
  margin-top: var(--sc-space-4);
  background: var(--sc-light-blue);
  color: var(--sc-on-brand);
}

#gift-card .gc-btn-submit:hover {
  background: var(--sc-navy);
}

/* ---------- summary ---------- */

#gift-card .gc-aside {
  position: sticky;
  top: var(--sc-space-5);
}

#gift-card .gc-summary {
  overflow: hidden;
  border-radius: var(--sc-radius-lg);
  background: #fff;
  box-shadow: var(--sc-shadow-card);
}

/* Vertical padding is --sc-space-4 so this band is 50px tall -- 16 + the
   h2's 18px line box + 16 -- which is exactly the height of a .gc-step pill
   (28px badge + 10px padding + 1px borders). The two sit on the same row, so
   a shorter heading read as a misalignment. */
#gift-card .gc-summary-head {
  padding: var(--sc-space-4);
  background: var(--sc-navy);
}

#gift-card .gc-summary-head h2 {
  margin: 0;
  color: var(--sc-on-brand);
  font-family: var(--sc-font-heading);
  font-size: var(--sc-h6);
  font-weight: var(--sc-weight-medium);
}

#gift-card .gc-summary-body {
  padding: var(--sc-space-4);
}

#gift-card .gc-sum-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sc-space-3);
  margin-bottom: var(--sc-space-3);
  font-size: 13px;
}

#gift-card .gc-sum-row span:first-child {
  font-weight: var(--sc-weight-regular);
}

#gift-card .gc-sum-row span:last-child {
  color: var(--sc-navy);
  font-weight: var(--sc-weight-bold);
  white-space: nowrap;
}

#gift-card .gc-sum-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sc-space-3);
  padding-top: var(--sc-space-3);
  border-top: 1px solid var(--sc-border-soft);
  color: var(--sc-navy);
  font-size: var(--sc-h5);
  font-weight: var(--sc-weight-bold);
}

#gift-card .gc-sum-note {
  margin: var(--sc-space-3) 0 0;
  color: var(--sc-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- help band ---------- */

#gift-card .gc-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sc-space-5);
  margin-top: var(--sc-space-6);
  padding: var(--sc-space-5);
  border: 1px solid var(--sc-border-soft);
  border-radius: var(--sc-radius-lg);
  background: #fff;
  box-shadow: var(--sc-shadow-card);
  text-align: center;
}

#gift-card .gc-help h2 {
  margin: 0 0 4px;
  color: var(--sc-navy);
  font-family: var(--sc-font-heading);
  font-size: var(--sc-h5);
  font-weight: var(--sc-weight-medium);
}

#gift-card .gc-help p {
  margin: 0;
  font-size: 12px;
}

#gift-card .gc-help a {
  color: var(--sc-navy);
  text-decoration: underline;
}

/* ---------- responsive ---------- */

@media (max-width: 991px) {
  #gift-card .gc-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "steps"
      "body"
      "aside"
      "nav";
  }

  #gift-card .gc-aside {
    position: static;
  }
}

@media (max-width: 767px) {
  #gift-card [data-panel="3"] .gc-payment-split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sc-space-4);
  }

  #gift-card [data-panel="3"] .gc-payment-card {
    padding-left: 0;
    padding-top: var(--sc-space-4);
    border-left: 0;
    border-top: 1px solid var(--sc-border-soft);
  }

  #gift-card .gc-amount-card {
    grid-template-columns: minmax(0, 1fr);
  }

  #gift-card .gc-card-art {
    max-width: 260px;
    margin: 0 auto;
  }

  #gift-card .gc-amount-grid {
    max-width: none;
  }
}

@media (max-width: 575px) {
  #gift-card {
    padding: var(--sc-space-6) 0;
  }

  #gift-card .gc-grid,
  #gift-card .gc-help {
    grid-template-columns: minmax(0, 1fr);
  }

  #gift-card .gc-amount-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #gift-card .gc-steps {
    gap: 6px;
  }

  #gift-card .gc-step {
    padding: 9px 6px;
    font-size: 12px;
  }

  #gift-card .gc-nav .gc-btn {
    flex: 1 1 auto;
    padding: 11px var(--sc-space-4);
  }
}


/* The footer carries a 64px top margin, which is invisible on a white page but
   shows as a white stripe between this pale-blue section and the navy footer.
   The footer is a body-level sibling of this page, so it can be closed here
   without touching the footer component itself. */
#gift-card ~ .sc-footer {
  margin-top: 0;
}
