/* =============================================================================
   demo-highlights-kids — Order confirmation
   Brand tokens lifted from shop.highlights.com:
     red    #E02619    (logo, CTA)
     beige  #f9f7f1    (page warm bg, subtle accent)
     green  #5BA94C    (success check)
     green-dark #2E7D32 (success heading text — readable on white)
     ink    #2c2c2c    (body text)
     line   #e6e6e6    (rules, table borders)
   Body font: Open Sans (Highlights serves arboria via Typekit; we use the
   documented fallback so the demo loads without a paid font).
   Display: Georgia/serif fallback for aurea-ultra.
   ============================================================================= */

:root {
  --hl-red: #e02619;
  --hl-red-hover: #b71d12;
  --hl-beige: #f9f7f1;
  --hl-green: #5ba94c;
  --hl-green-dark: #2e7d32;
  --hl-ink: #2c2c2c;
  --hl-ink-soft: #555;
  --hl-line: #e6e6e6;
  --hl-line-strong: #d0d0d0;
  --hl-info-bg: #f0f7fa;
  --hl-info-border: #b8d8e3;

  --container-max: 1280px;
  --gutter: 24px;

  --font-body: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--hl-ink);
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   TOP NAV
   ============================================================================= */

.site-header {
  position: relative;
  background: #fff;
  z-index: 10;
}

.site-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo img {
  height: 56px;
  width: auto;
  display: block;
}

.site-nav-primary {
  display: flex;
  gap: 32px;
  flex: 1;
}

.nav-link {
  font-size: 17px;
  font-weight: 600;
  color: var(--hl-ink);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--hl-red);
}

.nav-link-active {
  color: var(--hl-red);
}

.nav-link-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 4px;
  background: var(--hl-red);
  border-radius: 2px;
}

.site-header-utility {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.utility-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hl-ink);
  text-decoration: none;
  font-size: 16px;
}

.utility-account:hover {
  color: var(--hl-red);
}

.utility-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hl-red);
  color: #fff;
}

.utility-icon svg {
  width: 18px;
  height: 18px;
}

.utility-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  border-left: 1px solid var(--hl-line-strong);
  height: 28px;
}

.utility-cart svg {
  width: 26px;
  height: 26px;
}

.site-header-rule {
  height: 2px;
  background: var(--hl-red);
}

/* secondary nav */

.site-subnav {
  background: #fff;
  border-bottom: 1px solid var(--hl-line);
}

.site-subnav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 36px;
}

.subnav-link {
  background: none;
  border: 0;
  padding: 6px 0;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--hl-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.subnav-link:hover {
  color: var(--hl-red);
}

.subnav-caret {
  font-size: 11px;
  position: relative;
  top: 1px;
}

.subnav-search {
  margin-left: auto;
  background: var(--hl-red);
  color: #fff;
  border: 0;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subnav-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #c41f14;
}

.subnav-search-icon svg {
  width: 16px;
  height: 16px;
}

/* =============================================================================
   PAGE
   ============================================================================= */

.page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px var(--gutter) 64px;
}

.section-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--hl-ink);
  margin: 0 0 16px;
}

/* =============================================================================
   CONFIRMATION HERO
   ============================================================================= */

.confirm-hero {
  text-align: center;
  padding: 16px 0 56px;
}

.confirm-check {
  display: inline-flex;
  margin: 0 auto 16px;
}

.confirm-check svg {
  width: 88px;
  height: 88px;
}

.confirm-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.1;
  color: var(--hl-green-dark);
  margin: 0 0 36px;
  letter-spacing: -0.5px;
}

.confirm-order-number,
.confirm-receipt {
  font-size: 18px;
  color: var(--hl-ink);
  margin: 12px 0;
}

.confirm-receipt {
  margin-bottom: 36px;
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hl-red);
  color: #fff;
  border: 0;
  padding: 16px 40px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s ease;
}

.btn-continue:hover {
  background: var(--hl-red-hover);
}

.btn-continue:focus-visible {
  outline: 3px solid #ffb3ad;
  outline-offset: 2px;
}

/* =============================================================================
   ORDER SUMMARY TABLE
   ============================================================================= */

.order-summary {
  margin-top: 32px;
}

.summary-table {
  border: 1px solid var(--hl-info-border);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  display: block;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) 1fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 18px 24px;
  align-items: center;
}

.summary-head {
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--hl-info-border);
  background: #fff;
}

.summary-item .col-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.item-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--hl-beige);
  flex-shrink: 0;
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-title {
  color: var(--hl-ink);
  font-weight: 400;
  font-size: 15px;
}

.item-delivery {
  color: #2c7da0;
  font-size: 14px;
  text-decoration: none;
}

.item-delivery:hover {
  text-decoration: underline;
}

.col-sku,
.col-price,
.col-qty {
  font-size: 15px;
  color: var(--hl-ink);
}

.col-subtotal {
  font-size: 15px;
  color: var(--hl-ink);
  text-align: right;
}

.summary-head .col-subtotal {
  text-align: right;
}

/* totals (shaded blue panel below the table) */

.summary-totals {
  background: var(--hl-info-bg);
  border: 1px solid var(--hl-info-border);
  border-top: 0;
  padding: 4px 24px;
}

.totals-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 56px;
  padding: 16px 0;
  border-bottom: 1px solid #cfe1e8;
  font-size: 16px;
}

.totals-row:last-child {
  border-bottom: 0;
}

.totals-row span {
  font-weight: 700;
}

.totals-row strong {
  font-weight: 700;
  min-width: 80px;
  text-align: right;
}

.totals-row-grand {
  font-size: 18px;
}

.totals-tax-note {
  text-align: right;
  font-size: 13px;
  color: var(--hl-ink-soft);
  margin: 12px 0 0;
}

/* =============================================================================
   ORDER INFORMATION
   ============================================================================= */

.order-info {
  margin-top: 56px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.info-card {
  border: 1px solid var(--hl-info-border);
  border-radius: 4px;
  padding: 24px;
  background: #fff;
}

.info-card-highlight {
  background: var(--hl-info-bg);
}

.info-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--hl-ink);
}

.info-card-body {
  font-style: normal;
  font-size: 15px;
  color: var(--hl-ink);
  line-height: 1.6;
}

.info-card-body p {
  margin: 0 0 8px;
}

.info-card-subhead {
  font-weight: 700;
}

/* =============================================================================
   FOOTER
   ============================================================================= */

.site-footer {
  border-top: 1px solid var(--hl-line);
  padding: 24px var(--gutter);
  text-align: center;
  color: var(--hl-ink-soft);
  font-size: 13px;
  background: var(--hl-beige);
  margin-top: 48px;
}

/* =============================================================================
   MOMENTSCIENCE EMBED — mobile presentation surface.
   Renders inline between the confirmation hero and the order summary.
   Reuses the same .ms-card child styles (hero/pill/h3/desc/ctas/dots/powered)
   so a single render path can swap surfaces without duplicating chrome.
   Hidden by default; only shown when JS picks the embed surface (mobile).
   ============================================================================= */

.ms-embed {
  display: block;
  max-width: 540px;
  margin: 0 auto 32px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-align: center;
  position: relative;
  font-family: inherit;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.ms-embed.active {
  opacity: 1;
  transform: translateY(0);
}

/* Re-use the .ms-card child rules by mirroring them onto .ms-embed */
.ms-embed .ms-hero {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.ms-embed .ms-body {
  padding: 0 28px 28px;
}
.ms-embed .ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 40px;
  padding: 6px 16px 6px 6px;
  margin: -18px auto 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ms-embed .ms-pill img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.ms-embed .ms-pill span {
  font-size: 12px;
  color: var(--hl-ink);
  font-weight: 700;
}
.ms-embed h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--hl-ink);
  margin: 0 0 6px;
  line-height: 1.3;
}
.ms-embed .ms-desc {
  font-size: 13px;
  color: rgba(44, 44, 44, 0.7);
  line-height: 1.5;
  margin: 0 0 20px;
}
.ms-embed .ms-ctas {
  display: flex;
  gap: 10px;
  flex-direction: column;
}
.ms-embed .ms-cta-yes {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  background: var(--hl-red);
  border: none;
  color: #fff;
  cursor: pointer;
  flex: 1;
  font-family: inherit;
}
.ms-embed .ms-cta-yes:hover {
  background: var(--hl-red-hover);
}
.ms-embed .ms-cta-no {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 2px solid rgba(44, 44, 44, 0.2);
  color: rgba(44, 44, 44, 0.6);
  cursor: pointer;
  flex: 1;
  font-family: inherit;
}
.ms-embed .ms-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 12px;
}
.ms-embed .ms-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(44, 44, 44, 0.15);
}
.ms-embed .ms-dots span.active {
  background: var(--hl-red);
}
.ms-embed .ms-powered {
  font-size: 10px;
  color: rgba(44, 44, 44, 0.35);
  margin-top: 14px;
}

/* =============================================================================
   MOMENTSCIENCE MODAL — gofan-style: stacked backdrop + glass card
   Ported from demo-gofan/styles.css with brand recolor (red/green-dark/ink).
   ============================================================================= */

.ms-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.ms-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.ms-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transform: scale(0.95) translateY(12px);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.ms-modal-wrap.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.ms-card {
  width: 100%;
  max-width: 540px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow:
    0 12px 40px rgba(224, 38, 25, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  font-family: inherit;
  text-align: center;
  position: relative;
}

.ms-card .ms-hero {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.ms-card .ms-body {
  padding: 0 28px 28px;
}

.ms-card .ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 40px;
  padding: 6px 16px 6px 6px;
  margin: -18px auto 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.ms-card .ms-pill img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.ms-card .ms-pill span {
  font-size: 12px;
  color: var(--hl-ink);
  font-weight: 700;
}

.ms-card .ms-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  color: var(--hl-ink);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.ms-card .ms-close:hover {
  background: #fff;
}

.ms-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--hl-ink);
  margin: 0 0 6px;
  line-height: 1.3;
}

.ms-card .ms-desc {
  font-size: 13px;
  color: rgba(44, 44, 44, 0.7);
  line-height: 1.5;
  margin: 0 0 20px;
}

.ms-card .ms-ctas {
  display: flex;
  gap: 10px;
}

.ms-card .ms-cta-yes {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  background: var(--hl-red);
  border: none;
  color: #fff;
  cursor: pointer;
  flex: 1;
  transition: background 0.2s;
  font-family: inherit;
  text-align: center;
}
.ms-card .ms-cta-yes:hover {
  background: var(--hl-red-hover);
}

.ms-card .ms-cta-no {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 2px solid rgba(44, 44, 44, 0.2);
  color: rgba(44, 44, 44, 0.6);
  cursor: pointer;
  flex: 1;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}
.ms-card .ms-cta-no:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(44, 44, 44, 0.3);
  color: var(--hl-ink);
}

.ms-card .ms-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 12px;
}
.ms-card .ms-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(44, 44, 44, 0.15);
}
.ms-card .ms-dots span.active {
  background: var(--hl-red);
}

.ms-card .ms-powered {
  font-size: 10px;
  color: rgba(44, 44, 44, 0.35);
  margin-top: 14px;
}

@media (max-width: 768px) {
  .ms-modal-wrap {
    padding: 16px;
  }
  .ms-card {
    max-width: 100%;
  }
  .ms-card .ms-ctas {
    flex-direction: column;
  }
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 960px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .summary-row {
    grid-template-columns: minmax(0, 2fr) 1fr 1fr;
  }

  .summary-head .col-price,
  .summary-row .col-price,
  .summary-head .col-qty,
  .summary-row .col-qty {
    display: none;
  }

  .confirm-title {
    font-size: 40px;
  }
}

@media (max-width: 720px) {
  /* iOS Safari: keep negative-margin / breakout patterns from overflowing.
     overflow-x:hidden on the flex/grid parent prevents the horizontal scroll
     bug that doesn't reproduce in Chrome DevTools mobile emulation. */
  .page,
  .site-header-inner,
  .site-subnav-inner {
    overflow-x: hidden;
  }

  .site-header-inner {
    gap: 16px;
    flex-wrap: wrap;
  }

  .site-nav-primary {
    order: 3;
    width: 100%;
    justify-content: space-around;
    gap: 16px;
  }

  .site-subnav-inner {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .summary-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-head {
    display: none;
  }

  .summary-item .col-sku::before {
    content: "SKU: ";
    font-weight: 700;
  }

  .summary-item .col-subtotal {
    text-align: left;
  }

  .summary-item .col-subtotal::before {
    content: "Subtotal: ";
    font-weight: 700;
  }

  .totals-row {
    gap: 24px;
  }

  .confirm-title {
    font-size: 32px;
  }

  .item-thumb {
    width: 56px;
    height: 56px;
  }
}
