/* / note: Keep the storefront brand-led and self-contained; payment state and form behavior stay in app.js. */
@font-face {
  font-family: "Outfit";
  src: url("/Outfit-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink, #17233b);
  background: var(--surface, #FFFFFF);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --brand: #2563eb;
  --accent: #1d4ed8;
  --surface: #FFFFFF;
  --ink: #17233b;
  --muted: #64718a;
  --line: #e2e7ef;
  --radius: 16px;
  --control-radius: 11px;
  --shell-width: 1120px;
  --section-gap: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  /* / note: Flex the page column so the merchant footer rests at the viewport bottom on short pages. */
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}
/* / note: Let the storefront take remaining height while closed-store and checkout states remain natural. */
body > main { flex: 1 0 auto; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.topbar {
  min-height: 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: color-mix(in srgb, var(--surface) 94%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.brand {
  min-width: 0;
  max-width: min(600px, calc(100% - 72px));
  flex: 0 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}
.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: white;
  background: var(--brand);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}
.merchant-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.brand-copy { min-width: 0; max-width: 100%; flex: 1 1 0; display: grid; justify-items: start; gap: 3px; text-align: left; }
#brand-name {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(21px, 4vw, 27px);
  font-weight: 790;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.15;
}
.merchant-tagline {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.storefront-shell { width: min(100% - 40px, 820px); margin: 35px auto 58px; }
.store-intro { margin: 0 0 24px; }
.intro-kicker { margin: 0 0 8px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.store-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}
.hero-description {
  max-width: 600px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
/* / note: The saved merchant rate is the lead offer; the discount is calculated from that same rate. */
.selling-rate-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 3px 12px;
  margin-top: 18px;
  color: var(--brand);
}
.selling-rate-label { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.selling-rate-hero strong { font-size: clamp(42px, 7vw, 72px); line-height: .98; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.selling-rate-hero > span:last-child { color: var(--ink); font-size: clamp(16px, 2vw, 22px); font-weight: 700; }
.store-section { min-width: 0; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.11em;
}
.section-heading h2,
.order-intro h2,
.receipt-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.rate-note { color: var(--muted); font-size: 12px; text-align: right; }
/* / note: Keep the opt-in balance quiet beside the selling rate and easy to scan. */
.store-float-balance { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.availability-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  margin: 16px 0;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 76%, white);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--ink) 6%, transparent);
}
.availability-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--brand);
}
.availability-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 16px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, white);
  font-size: 23px;
  font-weight: 650;
}
.availability-copy { min-width: 0; }
.availability-copy .eyebrow { margin-bottom: 5px; }
.availability-copy h2 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.2; letter-spacing: -.025em; }
.availability-copy > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.availability-paused { border-color: #e8d5b7; }
.availability-paused::before { background: #a87536; }
.availability-paused .availability-icon { color: #96652c; background: #f8f1e6; border-color: #ead7ba; }
.availability-preparing .availability-icon { border-radius: 50% 50% 50% 12px; }
.availability-unavailable { border-color: #ead4c7; }
.availability-unavailable::before { background: #a66c43; }
.availability-unavailable .availability-icon { color: #965f3a; background: #f8f1eb; border-color: #ead4c7; }
.availability-error { border-color: #ebc9c7; }
.availability-error::before { background: #af4f46; }
.availability-error .availability-icon { color: #a1463f; background: #fbefed; border-color: #ebc9c7; }
.availability-retry { min-width: 116px; }

.order-panel, .receipt-panel {
  margin-top: 15px;
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, white);
  box-shadow: 0 12px 38px color-mix(in srgb, var(--ink) 6%, transparent);
}
.order-intro { margin-bottom: 18px; }
.order-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
#checkout-form { max-width: 560px; }
.checkout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 18px; }
.checkout-field { min-width: 0; }
.checkout-field label { display: block; margin: 17px 0 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.checkout-field label span { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 450; }
.order-panel label:not(.same-phone) {
  display: block;
  margin: 17px 0 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.order-panel label span { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 450; }
.phone-input {
  height: 49px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 58%, white);
}
/* / note: A focused phone field changes only its single outer border, avoiding a second inner outline. */
.phone-input:focus-within {
  border-color: var(--brand);
  outline: 0;
}
.phone-input > span { min-width: 22px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.phone-input input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.phone-input input::placeholder { color: color-mix(in srgb, var(--muted) 60%, white); }
/* / note: Keep one clear outer field boundary so the input itself does not look double outlined. */
.quick-amounts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.quick-amounts button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 9px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.quick-amounts button[aria-pressed="true"] { color: white; background: var(--brand); }
.quick-amounts button:disabled { opacity: .38; cursor: not-allowed; }
.same-phone {
  display: flex;
  align-items: center;
  gap: 9px;
  grid-column: 1 / -1;
  margin: 1px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.same-phone input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.same-phone input:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; }
.airtime-limits { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin: 12px 0 7px; color: var(--muted); font-size: 12px; }
.airtime-limits strong { color: var(--ink); font-weight: 750; }
.price-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
}
.price-preview p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.price-preview strong { display: block; margin-top: 5px; color: var(--ink); font-size: 17px; font-weight: 740; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}
.button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.04); }
.button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 3px; }
/* / note: Text inputs use one visible focus ring on their wrapper, never an extra inner rectangle. */
.phone-input input:focus-visible { outline: 0; box-shadow: none; }
.button-primary { width: 100%; margin-top: 8px; background: var(--brand); color: #fff; }
.button-primary:disabled { background: color-mix(in srgb, var(--brand) 38%, #9aa5b7); color: #fff; cursor: not-allowed; }
.button-secondary { min-width: 135px; margin: 4px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.button-secondary:disabled { opacity: .62; cursor: wait; }
.form-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
/* / note: Help is a page-level section, outside the checkout card; support always precedes its two separate cards. */
.customer-help { display: grid; gap: 18px; margin: 26px 0 0; }
.help-cards { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; }
.help-card { min-width: 0; padding: 24px; border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--surface) 55%, white); box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 4%, transparent); }
.help-card .eyebrow, .merchant-support .eyebrow { margin: 0 0 8px; color: var(--brand); }
.help-card h2 { margin: 0 0 20px; font-size: 20px; letter-spacing: -.025em; line-height: 1.25; }
/* / note: Ordered steps retain their meaning for assistive technology while small number badges make them easy to scan. */
.help-steps { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: help-step; }
.help-steps li { position: relative; padding-left: 41px; counter-increment: help-step; }
.help-steps li::before { content: counter(help-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--brand); font-size: 12px; font-weight: 800; }
.help-steps strong { display: block; margin-bottom: 4px; font-size: 13px; }
.help-steps span, .help-faq details p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.help-faq details { padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent); }
.help-faq details:last-child { padding-bottom: 0; border-bottom: 0; }
.help-faq summary { color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.5; cursor: pointer; }
.help-faq summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 3px; }
.help-faq details p { margin: 9px 0 0; }
/* / note: The public support number is a direct call action; long business contacts wrap without squeezing the help cards. */
.merchant-support { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--line)); border-radius: 18px; background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.merchant-support h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.merchant-support p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.merchant-support a { flex: 0 0 auto; padding: 12px 16px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 750; text-decoration: none; }

.receipt-panel { text-align: center; }
.receipt-dialog {
  width: min(100% - 28px, 600px);
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 90px color-mix(in srgb, #0b1730 35%, transparent);
}
.receipt-dialog::backdrop { background: color-mix(in srgb, #101a2d 50%, transparent); backdrop-filter: blur(3px); }
.receipt-dialog .receipt-panel { margin: 0; border: 0; box-shadow: none; }
.new-purchase-confirmation { display: grid; gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--brand) 32%, #dba642); border-radius: 14px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.new-purchase-confirmation p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.5; }
.new-purchase-confirmation .button { width: 100%; }
.earlier-payment { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.earlier-payment-copy { min-width: 0; }
.earlier-payment-copy h2 { margin: 0 0 4px; font-size: 15px; }
.earlier-payment-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.earlier-payment-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.earlier-payment-actions .button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
/* / note: The pre-response checkout state uses the same restrained spinner as the saved-order pending state. */
.receipt-icon-spinner { border: 3px solid color-mix(in srgb, var(--brand) 18%, transparent); border-top-color: var(--brand); border-radius: 50%; animation: receipt-spin 0.8s linear infinite; }
@keyframes receipt-spin { to { transform: rotate(360deg); } }
.receipt-icon-idle { border: 3px solid color-mix(in srgb, var(--brand) 18%, var(--line)); border-radius: 50%; animation: none !important; }
.view-order-status { display: flex; margin: 16px auto; }
.receipt-panel .eyebrow { margin-bottom: 8px; }
.receipt-panel h2 { font-size: 23px; }
.receipt-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  color: var(--brand);
  font-size: 20px;
}
.receipt-icon-pending { border: 3px solid color-mix(in srgb, var(--brand) 16%, var(--line)); border-top-color: var(--brand); background: transparent; animation: receipt-spin 850ms linear infinite; }
@keyframes receipt-spin { to { transform: rotate(360deg); } }
.receipt-panel { animation: receipt-enter 240ms ease-out both; }
@keyframes receipt-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.receipt-icon-confirmed { background: color-mix(in srgb, #208454 10%, var(--surface)); color: #208454; }
.receipt-icon-error { background: color-mix(in srgb, #b43e32 10%, var(--surface)); color: #a83228; }
.receipt-message { max-width: 500px; margin: 9px auto 17px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.delivery-waiting { max-width: 500px; margin: 0 auto 16px; color: var(--brand); font-size: 12px; font-weight: 700; }
.delivery-delay-note {
  max-width: 500px;
  margin: 0 auto 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  font-size: 12px;
  line-height: 1.55;
}
.receipt-details { max-width: 500px; margin: 0 auto 16px; border-top: 1px solid var(--line); text-align: left; }
.receipt-details div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.receipt-details dt { color: var(--muted); font-size: 11px; }
.receipt-details dd { max-width: 62%; margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; text-align: right; }

/* / note: Keep the credit band full width and aligned to the page bottom. */
.footer {
  width: 100%;
  min-height: 72px;
  margin-top: auto;
  padding: 19px 20px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  background: color-mix(in srgb, var(--surface) 86%, var(--brand) 4%);
  color: var(--muted);
  text-align: center;
}
.footer-line { margin: 0; font-size: 13px; line-height: 1.55; text-wrap: pretty; }
.footer-divider { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.lyco-credit { color: var(--brand); font-size: inherit; font-weight: 800; text-decoration: none; }
.lyco-credit:hover { color: var(--brand); text-decoration: underline; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 5;
  max-width: calc(100vw - 30px);
  padding: 12px 16px;
  transform: translateX(-50%);
  border-radius: 11px;
  color: #fff;
  background: #17233b;
  box-shadow: 0 10px 30px #101e3d40;
  font-size: 12px;
  text-align: center;
}

/* / note: Preserve the compact friendly failure page used by the Worker route. */
.not-found { max-width: 560px; margin: 15vh auto; padding: 28px; text-align: center; }
.not-found-title { font-size: 27px; letter-spacing: -0.04em; }
.not-found .button-primary { text-decoration: none; }

/* / note: Templates rearrange the same semantic page; they never alter checkout inputs or payment-state behavior. */
body {
  --panel-radius: var(--radius);
  --small-radius: var(--control-radius);
  --space: 22px;
}
body[data-corners="ROUNDED"] { --radius: 24px; --control-radius: 16px; }
body[data-corners="SOFT"], body:not([data-corners]) { --radius: 16px; --control-radius: 11px; }
body[data-corners="SHARP"] { --radius: 5px; --control-radius: 4px; }
body[data-density="COMPACT"] { --space: 14px; }
body[data-density="COMFORTABLE"], body:not([data-density]) { --space: 22px; }
body[data-typography="FRIENDLY"] { font-family: "Trebuchet MS", "Outfit", ui-sans-serif, sans-serif; }
body[data-typography="EDITORIAL"] { font-family: Georgia, "Times New Roman", serif; }
body[data-typography="EDITORIAL"] :is(input, button, .eyebrow, .intro-kicker, .selling-rate-label) { font-family: "Outfit", ui-sans-serif, sans-serif; }

/* / note: Three horizontal dots wave only for optional pending delivery; reduced motion keeps them still. */
.delivery-dots { display: inline-flex; gap: 4px; margin-left: 9px; vertical-align: middle; }
.delivery-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: delivery-wave 1.2s ease-in-out infinite; }
.delivery-dots i:nth-child(2) { animation-delay: .15s; }
.delivery-dots i:nth-child(3) { animation-delay: .3s; }
.delivery-dots[hidden] { display: none; }
@keyframes delivery-wave { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .delivery-dots i { animation: none; } }
