/* SFA Headless Checkout — cyan / blue brand (matches Signs FA app) */
:root {
  /* Match Signs FA light mode: muted blue-greys (not pure white) */
  --hc-bg: #d0dbe6;
  --hc-ink: #0f172a;
  --hc-muted: #4f6070;
  --hc-border: #b9c9d8;
  --hc-accent: #0891b2;
  --hc-accent-bright: #06b6d4;
  --hc-cta: #0ea5e9;
  --hc-cta-hover: #0284c7;
  --hc-soft: #d5e8f0;
  --hc-soft-mid: #c5dce8;
  --hc-card: #dde7f0;
  --hc-surface: #d5e0ea;
  --hc-radius: 16px;
  --hc-shadow: 0 10px 28px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.05);
  --hc-font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --sfa-theme-dur: 0.8s;
  /* Chrome density — raised on standard-DPI desktops + touch devices */
  --hc-ui: 1;
}

/* Smooth light↔dark handoff (~0.5s) — shared with Signs FA app / editor */
html.sfa-theme-animating,
html.sfa-theme-animating body {
  transition:
    background-color var(--sfa-theme-dur) ease,
    background var(--sfa-theme-dur) ease,
    color var(--sfa-theme-dur) ease,
    border-color var(--sfa-theme-dur) ease,
    box-shadow var(--sfa-theme-dur) ease !important;
}
html.sfa-theme-animating body *:not(canvas):not(img):not(video):not(iframe):not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon) {
  transition:
    background-color var(--sfa-theme-dur) ease,
    background var(--sfa-theme-dur) ease,
    color var(--sfa-theme-dur) ease,
    border-color var(--sfa-theme-dur) ease,
    box-shadow var(--sfa-theme-dur) ease,
    outline-color var(--sfa-theme-dur) ease,
    filter var(--sfa-theme-dur) ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.sfa-theme-animating,
  html.sfa-theme-animating body,
  html.sfa-theme-animating body * {
    transition: none !important;
  }
}

* { box-sizing: border-box; }
body.sfa-hc-body {
  margin: 0;
  font-family: var(--hc-font);
  color: var(--hc-ink);
  background: linear-gradient(180deg, #c8dce8 0%, var(--hc-bg) 180px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#sfa-hc-app { min-height: 100vh; display: flex; flex-direction: column; }

.hc-top {
  background: linear-gradient(135deg, #0c4a6e 0%, #0f172a 55%, #164e63 100%);
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.2);
}
.hc-top__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
}
.hc-top__brand img { height: 38px; width: auto; display: block; }
.hc-top__brand span { /* only when no logo */ }

/* Header actions: Dark switch + Account + Cart (same pattern as app home) */
.hc-top__actions {
  display: flex;
  align-items: flex-end;
  gap: 2px 6px;
  flex-wrap: nowrap;
}
.hc-top .sf-nav-icon-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  min-width: 52px;
  max-width: 68px;
  padding: 4px 5px 2px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #e0f2fe;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.1;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, color 0.15s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.hc-top .sf-nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(165, 243, 252, 0.35);
  color: #fff;
  transform: translateY(-1px);
}
.hc-top .sf-nav-icon-btn__icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(165, 243, 252, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 5px;
  box-sizing: border-box;
}
.hc-top .sf-nav-icon-btn__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* monoline icons → light on dark header */
  filter: brightness(0) invert(1);
}
.hc-top .sf-nav-icon-btn__glyph {
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
}
.hc-top .sf-nav-icon-btn__name {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

/* Sliding dark-mode switch (on dark header + general) */
.sf-theme-switch {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 52px;
  max-width: 72px;
  padding: 4px 6px 2px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #e0f2fe;
  font: inherit;
  cursor: pointer;
  line-height: 1.1;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.sf-theme-switch:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(165, 243, 252, 0.35);
  transform: translateY(-1px);
}
.sf-theme-switch__track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  border: 1px solid rgba(226, 232, 240, 0.45);
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.sf-theme-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hc-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
  will-change: transform;
}
.sf-theme-switch.is-on .sf-theme-switch__track,
.sf-theme-switch[aria-checked="true"] .sf-theme-switch__track {
  background: #0ea5e9;
  border-color: #7dd3fc;
}
.sf-theme-switch.is-on .sf-theme-switch__thumb,
.sf-theme-switch[aria-checked="true"] .sf-theme-switch__thumb {
  transform: translateX(20px);
}
.sf-theme-switch__label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: inherit;
}

/* Legacy text links (if any remain) */
.hc-top__links { display: flex; gap: 10px; flex-wrap: wrap; }
.hc-top__links a {
  color: #a5f3fc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}
.hc-top__links a:hover { color: #fff; }

@media (max-width: 720px) {
  .hc-top .sf-nav-icon-btn,
  .sf-theme-switch {
    min-width: 44px;
    max-width: 52px;
    padding: 2px 3px;
  }
  .hc-top .sf-nav-icon-btn__icon {
    width: 32px;
    height: 32px;
    padding: 4px;
  }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label {
    font-size: 0.52rem;
  }
  .sf-theme-switch__track {
    width: 40px;
    height: 22px;
  }
  .sf-theme-switch__thumb {
    width: 16px;
    height: 16px;
  }
  .sf-theme-switch.is-on .sf-theme-switch__thumb,
  .sf-theme-switch[aria-checked="true"] .sf-theme-switch__thumb {
    transform: translateX(18px);
  }
}

.hc-wrap {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.hc-hero { text-align: center; margin-bottom: 18px; }
.hc-hero h1 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 900; color: #0c4a6e; }
.hc-hero p { margin: 0 0 14px; color: var(--hc-muted); }

.hc-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.hc-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hc-card);
  border: 1px solid var(--hc-border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hc-muted);
}
.hc-step__n {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hc-border); font-size: 0.72rem; font-weight: 900;
  color: #334155;
}
.hc-step.is-active {
  border-color: var(--hc-accent-bright);
  background: var(--hc-soft);
  color: #0e7490;
}
.hc-step.is-active .hc-step__n { background: var(--hc-cta); color: #fff; }
.hc-step.is-done { border-color: #67e8f9; color: #0e7490; }
.hc-step.is-done .hc-step__n { background: var(--hc-accent); color: #fff; }
.hc-step__join { width: 16px; height: 2px; background: #bae6fd; }

.hc-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}
@media (max-width: 840px) {
  .hc-layout { grid-template-columns: 1fr; }
  .hc-aside { order: -1; position: static !important; }
}

.hc-card {
  background: var(--hc-card);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius);
  padding: 20px 18px;
  box-shadow: var(--hc-shadow);
}
.hc-card h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0c4a6e;
}
.hc-card .hc-lead {
  margin: 0 0 16px;
  color: var(--hc-muted);
  font-size: 0.9rem;
}

.hc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hc-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .hc-grid { grid-template-columns: 1fr; }
  .hc-grid .span2 { grid-column: auto; }
}

.hc-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #334155;
}
.hc-field .req { color: #dc2626; margin-left: 2px; }
.hc-field input,
.hc-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--hc-border);
  border-radius: 10px;
  font-size: 16px; /* prevent iOS zoom */
  background: var(--hc-card);
  color: var(--hc-ink);
}
.hc-field input:focus,
.hc-field select:focus {
  outline: 2px solid var(--hc-accent-bright);
  border-color: var(--hc-accent);
}

.hc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  background: var(--hc-surface);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 12px 0;
  color: var(--hc-ink);
}
.hc-check:hover { border-color: #7dd3fc; background: var(--hc-soft); }

.hc-tile {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 2px solid var(--hc-border);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--hc-surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  color: var(--hc-ink);
}
.hc-tile:hover { border-color: #7dd3fc; background: var(--hc-card); }
.hc-tile.is-on {
  border-color: var(--hc-accent);
  background: var(--hc-soft);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}
.hc-tile input { margin-top: 3px; accent-color: var(--hc-cta); }
.hc-tile__body { flex: 1; min-width: 0; }
.hc-tile__body strong { display: block; font-size: 0.98rem; color: var(--hc-ink); }
.hc-tile__body em {
  font-style: normal;
  font-weight: 800;
  color: #0e7490;
  float: right;
}
.hc-tile__hint { display: block; margin-top: 4px; font-size: 0.82rem; color: var(--hc-muted); line-height: 1.35; }

.hc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e0f2fe;
}
.hc-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}
.hc-btn:disabled { opacity: 0.6; cursor: wait; }
.hc-btn--primary {
  background: linear-gradient(180deg, var(--hc-cta) 0%, var(--hc-cta-hover) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.28);
}
.hc-btn--primary:hover { filter: brightness(1.05); }
.hc-btn--ghost {
  background: var(--hc-card);
  color: var(--hc-ink);
  border: 1px solid var(--hc-border);
}
.hc-btn--ghost:hover { border-color: #7dd3fc; color: #0e7490; }
.hc-btn--block { width: 100%; }
.hc-nav .hc-btn--primary { margin-left: auto; }

.hc-msg {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}
.hc-msg--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.hc-msg--ok { background: var(--hc-soft); color: #0e7490; border: 1px solid #a5f3fc; }

.hc-aside {
  position: sticky;
  top: 16px;
}
.hc-aside h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 900;
  color: #0c4a6e;
}
.hc-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e0f2fe;
  font-size: 0.9rem;
  align-items: center;
}
.hc-line__main { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.hc-line__thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  flex-shrink: 0;
}
.hc-line__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #0e7490;
  letter-spacing: 0.04em;
}
.hc-line strong { display: block; color: var(--hc-ink); }
.hc-line span { color: var(--hc-muted); font-size: 0.78rem; }
.hc-line__price { font-weight: 800; color: #0c4a6e; white-space: nowrap; }
.hc-tot { margin-top: 8px; }
.hc-tot-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #e0f2fe;
  color: #334155;
}
.hc-tot-row--grand {
  border: 0;
  font-size: 1.08rem;
  font-weight: 900;
  margin-top: 6px;
  color: #0c4a6e;
  padding-top: 10px;
  border-top: 2px solid #a5f3fc;
}

.hc-review {
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--hc-surface);
}
.hc-review h3 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0e7490;
  font-weight: 800;
}
.hc-review p { margin: 0; font-size: 0.9rem; line-height: 1.45; color: #334155; }

.hc-approve {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  background: var(--hc-card);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--hc-ink);
  cursor: pointer;
  line-height: 1.4;
}
.hc-approve input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--hc-accent);
}
.hc-approve.is-error {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 1px #fecaca;
}

.hc-secure {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--hc-muted);
  font-weight: 600;
}
.hc-secure span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--hc-card);
  border: 1px solid #e0f2fe;
  border-radius: 999px;
  padding: 4px 10px;
}
.hc-secure strong { color: #0e7490; }

/* ========== Dark theme (shared cookie sfa_ui_theme) ========== */
html[data-sc-theme="dark"],
html.sfa-hc-theme-dark {
  --hc-bg: #1a2332;
  --hc-ink: #e8eef6;
  --hc-muted: #9aa8bc;
  --hc-border: #364557;
  --hc-accent: #38bdf8;
  --hc-accent-bright: #7dd3fc;
  --hc-cta: #0ea5e9;
  --hc-cta-hover: #0284c7;
  --hc-soft: rgba(56, 189, 248, 0.12);
  --hc-soft-mid: rgba(56, 189, 248, 0.2);
  --hc-card: #222c3d;
  --hc-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
html[data-sc-theme="dark"] body.sfa-hc-body,
html.sfa-hc-theme-dark body.sfa-hc-body,
body.sfa-hc-body[data-sc-theme="dark"] {
  background: linear-gradient(180deg, #1a2332 0%, #151c28 180px) !important;
  color: #e8eef6 !important;
}
html[data-sc-theme="dark"] .hc-hero h1,
html.sfa-hc-theme-dark .hc-hero h1 { color: #7dd3fc !important; }
html[data-sc-theme="dark"] .hc-hero p,
html.sfa-hc-theme-dark .hc-hero p { color: #9aa8bc !important; }
html[data-sc-theme="dark"] .hc-step,
html.sfa-hc-theme-dark .hc-step {
  background: #222c3d !important;
  border-color: #3d4b5f !important;
  color: #9aa8bc !important;
}
html[data-sc-theme="dark"] .hc-step__n,
html.sfa-hc-theme-dark .hc-step__n {
  background: #2a3648 !important;
  color: #cbd5e1 !important;
}
html[data-sc-theme="dark"] .hc-step.is-active,
html.sfa-hc-theme-dark .hc-step.is-active {
  background: rgba(56, 189, 248, 0.14) !important;
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
}
html[data-sc-theme="dark"] .hc-card,
html[data-sc-theme="dark"] .hc-aside .hc-card,
html.sfa-hc-theme-dark .hc-card {
  background: #222c3d !important;
  border-color: #364557 !important;
  color: #e8eef6 !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35) !important;
}
html[data-sc-theme="dark"] .hc-card h2,
html[data-sc-theme="dark"] .hc-aside h2,
html.sfa-hc-theme-dark .hc-card h2 {
  color: #7dd3fc !important;
}
html[data-sc-theme="dark"] .hc-lead,
html.sfa-hc-theme-dark .hc-lead { color: #9aa8bc !important; }
html[data-sc-theme="dark"] .hc-field label,
html.sfa-hc-theme-dark .hc-field label { color: #9aa8bc !important; }
html[data-sc-theme="dark"] .hc-field input,
html[data-sc-theme="dark"] .hc-field select,
html[data-sc-theme="dark"] .hc-field textarea,
html.sfa-hc-theme-dark .hc-field input,
html.sfa-hc-theme-dark .hc-field select,
html.sfa-hc-theme-dark .hc-field textarea {
  background: #1a2332 !important;
  border-color: #3d4b5f !important;
  color: #e8eef6 !important;
}
html[data-sc-theme="dark"] .hc-check,
html[data-sc-theme="dark"] .hc-tile,
html[data-sc-theme="dark"] .hc-review,
html[data-sc-theme="dark"] .hc-approve,
html.sfa-hc-theme-dark .hc-check,
html.sfa-hc-theme-dark .hc-tile,
html.sfa-hc-theme-dark .hc-review,
html.sfa-hc-theme-dark .hc-approve {
  background: #1e2838 !important;
  border-color: #3d4b5f !important;
  color: var(--hc-border) !important;
}
html[data-sc-theme="dark"] .hc-tile:hover,
html[data-sc-theme="dark"] .hc-check:hover,
html.sfa-hc-theme-dark .hc-tile:hover {
  border-color: #38bdf8 !important;
  background: #243041 !important;
}
html[data-sc-theme="dark"] .hc-tile.is-on,
html.sfa-hc-theme-dark .hc-tile.is-on {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
}
html[data-sc-theme="dark"] .hc-tile__body strong,
html[data-sc-theme="dark"] .hc-line strong,
html.sfa-hc-theme-dark .hc-tile__body strong {
  color: var(--hc-bg) !important;
}
html[data-sc-theme="dark"] .hc-tile__body em,
html[data-sc-theme="dark"] .hc-line__price,
html[data-sc-theme="dark"] .hc-tot-row--grand,
html.sfa-hc-theme-dark .hc-line__price {
  color: #7dd3fc !important;
}
html[data-sc-theme="dark"] .hc-btn--ghost,
html.sfa-hc-theme-dark .hc-btn--ghost {
  background: #243041 !important;
  border-color: #46566c !important;
  color: var(--hc-border) !important;
}
html[data-sc-theme="dark"] .hc-nav,
html[data-sc-theme="dark"] .hc-line,
html[data-sc-theme="dark"] .hc-tot-row,
html.sfa-hc-theme-dark .hc-nav,
html.sfa-hc-theme-dark .hc-line {
  border-color: #364557 !important;
}
html[data-sc-theme="dark"] .hc-tot-row,
html[data-sc-theme="dark"] .hc-review p,
html.sfa-hc-theme-dark .hc-tot-row {
  color: #d0d9e6 !important;
}
html[data-sc-theme="dark"] .hc-line__thumb,
html.sfa-hc-theme-dark .hc-line__thumb {
  background: #1a2332 !important;
  border-color: #3d4b5f !important;
}
html[data-sc-theme="dark"] .hc-tot-row--grand,
html.sfa-hc-theme-dark .hc-tot-row--grand {
  border-top-color: #38bdf8 !important;
}
/* WooPayments / payment iframe host areas */
html[data-sc-theme="dark"] .woocommerce-checkout,
html[data-sc-theme="dark"] #payment,
html[data-sc-theme="dark"] .wc-block-components,
html[data-sc-theme="dark"] .payment_box,
html[data-sc-theme="dark"] .wc_payment_method,
html[data-sc-theme="dark"] .woocommerce-checkout-payment,
html.sfa-hc-theme-dark #payment,
html.sfa-hc-theme-dark .payment_box {
  background: #1e2838 !important;
  color: #e8eef6 !important;
  border-color: #364557 !important;
}
html[data-sc-theme="dark"] #payment .payment_methods,
html[data-sc-theme="dark"] #payment .payment_method,
html.sfa-hc-theme-dark #payment .payment_methods {
  background: #1e2838 !important;
  color: var(--hc-border) !important;
}
html[data-sc-theme="dark"] #payment input[type="text"],
html[data-sc-theme="dark"] #payment input[type="tel"],
html[data-sc-theme="dark"] #payment input[type="email"],
html[data-sc-theme="dark"] #place_order,
html.sfa-hc-theme-dark #payment input[type="text"] {
  background: #1a2332 !important;
  border-color: #3d4b5f !important;
  color: #e8eef6 !important;
}
html[data-sc-theme="dark"] #place_order,
html.sfa-hc-theme-dark #place_order {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #fff !important;
  border: 0 !important;
}
html[data-sc-theme="dark"] .woocommerce-info,
html[data-sc-theme="dark"] .woocommerce-message,
html.sfa-hc-theme-dark .woocommerce-info {
  background: #1e2838 !important;
  border-color: #364557 !important;
  color: var(--hc-border) !important;
}
/* Stripe Elements often force light iframes � darken the chrome around them */
html[data-sc-theme="dark"] .wc-stripe-elements-field,
html[data-sc-theme="dark"] .StripeElement,
html[data-sc-theme="dark"] .wcpay-card-mounted,
html.sfa-hc-theme-dark .StripeElement {
  background: #1a2332 !important;
  border: 1px solid #3d4b5f !important;
  border-radius: 8px !important;
  padding: 8px !important;
}

/* App-matching footer on headless checkout + order-pay */
.sf-footer,
.hc-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  background: var(--hc-card);
  border-top: 1px solid var(--hc-border);
  margin-top: auto;
  flex-shrink: 0;
}
.sf-footer__copy { font-weight: 600; }
.sf-footer__legal a,
.hc-footer a {
  color: #64748b;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sf-footer__legal a:hover,
.hc-footer a:hover {
  color: #0891b2;
  border-bottom-color: #06b6d4;
}
.sf-footer__manage-cookies {
  appearance: none;
  border: none;
  background: transparent;
  color: #0891b2;
  font: inherit;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sf-footer__manage-cookies:hover { color: #0284c7; }
html[data-sc-theme="dark"] .sf-footer,
html[data-sc-theme="dark"] .hc-footer,
html.sfa-hc-theme-dark .sf-footer,
html.sfa-hc-theme-dark .hc-footer,
body.sfa-hc-pay html[data-sc-theme="dark"] .hc-footer {
  background: #1a2332 !important;
  border-top-color: #364557 !important;
  color: #9aa8bc !important;
}
html[data-sc-theme="dark"] .sf-footer__legal a,
html[data-sc-theme="dark"] .hc-footer a,
html.sfa-hc-theme-dark .sf-footer__legal a {
  color: #9aa8bc !important;
}
html[data-sc-theme="dark"] .sf-footer__legal a:hover,
html.sfa-hc-theme-dark .sf-footer__legal a:hover {
  color: #5eead4 !important;
}
html[data-sc-theme="dark"] .sf-footer__manage-cookies,
html.sfa-hc-theme-dark .sf-footer__manage-cookies {
  color: #5eead4 !important;
}
/* Leave room above sticky pay bar on order-pay */
body.sfa-hc-pay .hc2 { min-height: 100vh; display: flex; flex-direction: column; }
body.sfa-hc-pay .hc2-body { flex: 1; padding-bottom: 140px; }
body.sfa-hc-pay .hc-footer { margin-bottom: 0; padding-bottom: 100px; }

/* ==========================================================================
   UI density — standard-DPI desktop + tablet + mobile (checkout)
   ========================================================================== */

/* —— Desktop standard-DPI —— */
@media screen and (max-resolution: 1.49dppx) and (min-width: 900px) {
  :root { --hc-ui: 1.14; }
  html { font-size: 114%; }

  .hc-top { padding: 14px 20px; gap: 14px; }
  .hc-top__brand img { height: 44px; }
  .hc-top .sf-nav-icon-btn,
  .sf-theme-switch {
    min-width: 60px;
    max-width: 76px;
    padding: 6px 6px 4px;
  }
  .hc-top .sf-nav-icon-btn__icon {
    width: 42px;
    height: 42px;
    padding: 6px;
  }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label {
    font-size: 0.64rem;
    max-width: 72px;
  }
  .sf-theme-switch__track { width: 48px; height: 26px; }
  .sf-theme-switch__thumb { width: 20px; height: 20px; }
  .sf-theme-switch.is-on .sf-theme-switch__thumb,
  .sf-theme-switch[aria-checked="true"] .sf-theme-switch__thumb {
    transform: translateX(22px);
  }
  .hc-card { padding: 22px 20px; border-radius: 18px; }
  .hc-card h2 { font-size: 1.25rem; }
  .hc-card .hc-lead { font-size: 0.98rem; }
  .hc-field label { font-size: 0.9rem; }
  .hc-field input,
  .hc-field select { padding: 13px 14px; }
  .hc-tile { padding: 16px; gap: 14px; }
  .hc-tile__body strong { font-size: 1.05rem; }
  .hc-check { padding: 14px 16px; font-size: 0.98rem; min-height: 52px; }
  .hc-hero h1 { font-size: 1.65rem; }
}

/* —— Classic FHD @ 100% —— */
@media screen and (max-resolution: 1.1dppx) and (min-width: 1500px) and (max-width: 2100px) and (min-height: 900px) and (max-height: 1150px) {
  :root { --hc-ui: 1.2; }
  html { font-size: 120%; }
  .hc-top .sf-nav-icon-btn__icon { width: 44px; height: 44px; }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label { font-size: 0.68rem; }
  .hc-card h2 { font-size: 1.3rem; }
}

/* —— Tablet —— */
@media screen and (min-width: 600px) and (max-width: 1023px) {
  :root { --hc-ui: 1.08; }
  html { font-size: 106%; }

  .hc-top { padding: 12px 16px; }
  .hc-top .sf-nav-icon-btn,
  .sf-theme-switch {
    min-width: 56px;
    max-width: 70px;
    min-height: 56px;
    padding: 6px 5px 4px;
  }
  .hc-top .sf-nav-icon-btn__icon {
    width: 42px;
    height: 42px;
  }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label {
    font-size: 0.62rem;
  }
  /* Override earlier shrink rules that made labels tiny */
  .sf-theme-switch__track { width: 46px; height: 26px; }
  .sf-theme-switch__thumb { width: 20px; height: 20px; }
  .hc-card { padding: 18px 16px; }
  .hc-field input,
  .hc-field select {
    padding: 13px 14px;
    min-height: 48px;
  }
  .hc-tile {
    padding: 16px;
    min-height: 64px;
  }
  .hc-check {
    min-height: 52px;
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}

/* —— Phone —— */
@media screen and (max-width: 599px) {
  :root { --hc-ui: 1.05; }
  html { font-size: 100%; }

  .hc-top { padding: 10px 12px; gap: 8px; }
  .hc-top__brand img { height: 34px; }
  /* Larger than the old 720px shrink (0.52rem / 32px icons) */
  .hc-top .sf-nav-icon-btn,
  .sf-theme-switch {
    min-width: 48px;
    max-width: 58px;
    min-height: 52px;
    padding: 4px 4px 3px;
  }
  .hc-top .sf-nav-icon-btn__icon {
    width: 40px;
    height: 40px;
    padding: 6px;
  }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label {
    font-size: 0.58rem;
    max-width: 54px;
  }
  .sf-theme-switch__track { width: 42px; height: 24px; }
  .sf-theme-switch__thumb { width: 18px; height: 18px; }
  .sf-theme-switch.is-on .sf-theme-switch__thumb,
  .sf-theme-switch[aria-checked="true"] .sf-theme-switch__thumb {
    transform: translateX(18px);
  }
  .hc-card { padding: 16px 14px; border-radius: 14px; }
  .hc-card h2 { font-size: 1.12rem; }
  .hc-card .hc-lead { font-size: 0.92rem; }
  .hc-field label { font-size: 0.88rem; }
  .hc-field input,
  .hc-field select {
    padding: 13px 14px;
    min-height: 48px;
    font-size: 16px;
  }
  .hc-tile {
    padding: 14px;
    gap: 12px;
    min-height: 60px;
  }
  .hc-tile__body strong { font-size: 1rem; }
  .hc-check {
    min-height: 52px;
    padding: 14px 14px;
    font-size: 0.95rem;
  }
  .hc-hero h1 { font-size: 1.35rem; }
}

@media screen and (max-width: 380px) {
  .hc-top .sf-nav-icon-btn,
  .sf-theme-switch {
    min-width: 44px;
    max-width: 50px;
  }
  .hc-top .sf-nav-icon-btn__name,
  .sf-theme-switch__label { font-size: 0.52rem; }
}
