/* The customer-facing storefront. No CDN, no framework, no dealer literal:
   the accent colour and the fonts are CSS custom properties a deployment can
   override from its own stylesheet or a per-client theme. */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #20242c;
  --muted: #687385;
  --line: #d9dee7;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --success: #1f7a3a;
  --danger: #b3261e;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --panel: #1c2027;
    --ink: #eef1f5;
    --muted: #9aa3b2;
    --line: #2c323c;
    --accent: #6f9bff;
    --accent-ink: #0d1220;
    --success: #6fd28c;
    --danger: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th.num, td.num { text-align: right; white-space: nowrap; }

.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }

/* header / footer */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; font-weight: 700; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-logo { height: 32px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { text-decoration: none; color: var(--ink); }
.site-nav a:hover, .site-nav a:focus { color: var(--accent); }
.lang-switch { font-weight: 600; }
.search-form { display: flex; gap: 6px; }
.search-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); min-width: 180px; }
.site-footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 4px 0; }
.powered { font-size: 0.8rem; }

/* buttons */
button, .button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
  color: var(--accent);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); }
button:hover, .button:hover { filter: brightness(1.05); }

/* headings and messages */
.page-heading { margin: 24px 0 8px; font-size: 1.8rem; }
.page-heading small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.breadcrumb { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }
.count { text-align: center; margin: 24px 0; font-size: 1.3rem; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.status-message { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: 0.85rem; }
.error-message { color: var(--danger); font-weight: 600; }
.success-message { color: var(--success); font-weight: 600; font-size: 1.1rem; }
.field-error { color: var(--danger); font-size: 0.85rem; }

/* banners */
.banners { margin-top: 16px; }
.banner-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.banner { margin: 0; flex: 0 0 100%; scroll-snap-align: start; }
.banner img { width: 100%; border-radius: var(--radius); }

/* price expiry */
.price-expiry { text-align: center; margin: 24px 0 8px; }
.expiry-line { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
.countdown { display: flex; justify-content: center; gap: 18px; }
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.countdown-value { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-photo { position: relative; display: block; background: var(--bg); aspect-ratio: 4 / 3; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.65); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { margin: 0; font-size: 1.1rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.specs, .prices { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 0.92rem; }
.specs dt, .prices dt { color: var(--muted); }
.specs dd, .prices dd { margin: 0; }
.prices .selling { font-weight: 700; color: var(--success); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); margin-right: 6px; vertical-align: middle; }
.payment-summary { font-size: 0.92rem; }
.payment-line { margin: 2px 0; }
.payment-note { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; }
.card-actions { margin-top: auto; }

/* pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0; }
.pagination a, .pagination .current { padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* VDP */
.vdp-ids { color: var(--muted); margin: 0 0 12px; }
.vdp-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .vdp-grid { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
.gallery-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery-track img { flex: 0 0 100%; scroll-snap-align: start; border-radius: 6px; }
.price-table tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }
.price-table tr.discount td { color: var(--success); }
.price-table tr.selling td { font-weight: 700; background: var(--success); color: #fff; }
.frequency-form fieldset { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.program-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.program-table h3 { margin: 0 0 8px; font-size: 1rem; }
.similar { margin-top: 24px; }
.disclaimer { margin-top: 32px; padding: 16px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; text-align: center; }

/* photo gallery page */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.photo-cell img { border-radius: 6px; width: 100%; }

/* landing pages */
.hero { text-align: center; padding: 32px 0 16px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; }
.hero > p { max-width: 720px; margin: 0 auto 20px; color: var(--muted); }
.lead-form { max-width: 820px; margin: 0 auto; text-align: left; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.85rem; color: var(--muted); }
.field input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; }
.lead-form button { margin-top: 8px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feature-row { text-align: center; margin-top: 32px; }
.features { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.feature { display: flex; flex-direction: column; align-items: center; max-width: 220px; gap: 4px; }
.feature .mark, .feature .step { font-size: 1.6rem; color: var(--accent); font-weight: 700; }
.about { text-align: center; max-width: 720px; margin: 32px auto 0; }

/* storefront access: the signed-in bar and the sign-in page (app/public/access.py) */
.signed-in-bar { background: var(--ink); color: var(--bg); font-size: 0.85rem; }
.signed-in-row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 4px 0; }
.signed-in-row form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; font-size: inherit; }
.account-panel { max-width: 420px; margin: 32px auto 0; }
.account-form { display: flex; flex-direction: column; gap: 12px; }
