/* ==========================================================================
   Storefront theme — classic marketplace (light, blue + orange).
   Class prefix: km-. The legacy generic classes at the bottom keep the
   admin pages readable.
   ========================================================================== */

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  --primary: #1f5bd8;
  --primary-hover: #1848b0;
  --primary-soft: #eaf1ff;
  --cart: #ff7a1a;
  --cart-hover: #ec6a0b;
  --sale: #e5383b;
  --green: #12a150;
  --green-soft: #e7f7ee;
  --warn: #b54708;
  --warn-soft: #fff4e5;

  --navy: #0e1a33;
  --navy-2: #16264a;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* aliases used by the admin templates */
  --fg: var(--text);
  --fg-muted: var(--muted);
  --fg-dim: var(--muted);
  --line: var(--border);
  --bg-border: var(--border);
  --secondary: var(--primary);
  --pink: var(--cart);
  --font-head: var(--font);
  --font-mono: var(--mono);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
code { font-family: var(--mono); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.km-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .km-wrap { padding: 0 24px; } }
.km-main { flex: 1; padding-bottom: 48px; }
.km-page { padding-top: 24px; }
.km-narrow { max-width: 760px; }
.km-muted { color: var(--muted); }
.km-small { font-size: 13px; }
.km-green { color: var(--green); font-weight: 600; }
.km-link { color: var(--primary); font-weight: 600; }
.km-link:hover { text-decoration: underline; }
.km-h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.km-h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.km-lead { margin-bottom: 20px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- buttons ---------- */
.km-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.km-btn:focus-visible { outline: 3px solid rgba(31, 91, 216, .35); outline-offset: 2px; }
.km-btn:disabled { opacity: .55; cursor: not-allowed; background: var(--border); color: var(--muted); }
.km-btn-primary { background: var(--primary); color: #fff; }
.km-btn-primary:hover { background: var(--primary-hover); }
.km-btn-cart { background: var(--cart); color: #fff; }
.km-btn-cart:hover { background: var(--cart-hover); }
.km-btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.km-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.km-btn-link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; }
.km-btn-link:hover { text-decoration: underline; }
.km-btn-block { width: 100%; }
.km-btn-lg { height: 50px; font-size: 16px; }
.km-btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.km-btn-xs { height: 30px; padding: 0 12px; font-size: 13px; }
.km-btn svg { flex-shrink: 0; }
.km-btn-sm svg { width: 18px; height: 18px; }

/* ---------- forms ---------- */
.km-input {
  width: 100%; height: 44px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea.km-input { height: auto; padding: 10px 12px; }
select.km-input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.km-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 91, 216, .15); }
.km-input[readonly] { background: var(--surface-2); color: var(--muted); }
.km-form { display: flex; flex-direction: column; gap: 16px; }
.km-field { display: flex; flex-direction: column; gap: 6px; }
.km-field > label, .km-field > legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 0; }
fieldset.km-field > legend { margin-bottom: 6px; }
.km-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
legend .km-hint { margin-left: 6px; }
.km-form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) {
  .km-form-row { grid-template-columns: 1fr 1fr; }
  .km-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.km-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.km-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.km-input-pair { display: flex; align-items: center; gap: 8px; }
.km-input-pair .km-input { height: 38px; }

.km-alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.km-alert-err { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.km-alert-ok { background: var(--green-soft); border-color: #abefc6; color: #067647; }
.km-alert-warn { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }
.km-alert-info { background: var(--primary-soft); border-color: #c7d7fe; color: var(--primary-hover); }

/* ---------- panels ---------- */
.km-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
@media (min-width: 768px) { .km-panel { padding: 24px; } }
.km-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.km-panel-head .km-h2 { margin: 0; }
.km-stack { display: flex; flex-direction: column; gap: 20px; }
.km-empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.km-empty-big { text-align: center; padding: 56px 20px; }
.km-empty-big h2 { font-size: 22px; margin: 12px 0 6px; }
.km-empty-big .km-btn { margin-top: 12px; }
.km-empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }

/* ---------- top bar & header ---------- */
.km-topbar { background: var(--navy); color: #c8d1e5; font-size: 13px; }
.km-topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 36px; gap: 16px; }
.km-topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; align-items: center; }
.km-topbar-perks li { display: flex; align-items: center; gap: 6px; }
.km-topbar-perks svg { width: 15px; height: 15px; color: #8fb0ff; }
.km-topbar-links a:hover { color: #fff; }
.km-age { border: 1px solid #44557d; border-radius: 4px; padding: 0 6px; font-weight: 700; font-size: 12px; }
@media (max-width: 900px) { .km-topbar-perks li:not(:first-child) { display: none; } }
@media (max-width: 560px) { .km-topbar-links li:nth-child(2) { display: none; } }

.km-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.km-header-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.km-logo { display: inline-flex; align-items: center; gap: 10px; }
.km-logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #4f8bff); color: #fff; }
.km-logo-name { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.km-search { position: relative; display: flex; max-width: 680px; width: 100%; justify-self: center; }
.km-search-input {
  flex: 1; height: 46px; padding: 0 16px; border: 2px solid var(--primary); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--surface); min-width: 0;
}
.km-search-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(31, 91, 216, .15); }
.km-search-btn { width: 56px; border: 0; border-radius: 0 10px 10px 0; background: var(--primary); color: #fff; cursor: pointer; display: grid; place-items: center; }
.km-search-btn:hover { background: var(--primary-hover); }
.km-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 440px; overflow-y: auto; padding: 6px;
}
.km-search-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); }
.km-search-row:hover { background: var(--surface-2); }
.km-search-thumb { width: 80px; aspect-ratio: 460 / 215; border-radius: 6px; overflow: hidden; background: var(--bg); flex-shrink: 0; }
.km-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.km-search-thumb-empty { display: block; width: 100%; height: 100%; }
.km-search-meta { display: flex; flex-direction: column; min-width: 0; }
.km-search-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-search-price { font-size: 13px; color: var(--primary); font-weight: 700; }
.km-search-empty, .km-search-loading { padding: 14px; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.km-spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: km-spin .7s linear infinite; }
@keyframes km-spin { to { transform: rotate(360deg); } }

.km-header-actions { display: flex; gap: 6px; align-items: center; }
.km-hdr-action { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); }
.km-hdr-action:hover, .km-hdr-action.is-active { background: var(--surface-2); }
.km-hdr-label { display: flex; flex-direction: column; line-height: 1.15; font-weight: 700; font-size: 14px; }
.km-hdr-label small { font-weight: 400; color: var(--muted); font-size: 12px; }
.km-hdr-icon { position: relative; display: inline-flex; }
.km-cart-badge {
  position: absolute; top: -7px; right: -9px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--cart); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

.km-catnav { border-top: 1px solid var(--border); }
.km-catnav-inner { display: flex; align-items: center; gap: 4px; height: 46px; overflow-x: auto; scrollbar-width: none; }
.km-catnav-inner::-webkit-scrollbar { display: none; }
.km-catnav a { padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; color: #344054; }
.km-catnav a:hover { background: var(--surface-2); color: var(--primary); }
.km-catnav-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700 !important; background: var(--primary-soft); color: var(--primary) !important; }
.km-catnav-all.is-active, .km-catnav-all:hover { background: var(--primary) !important; color: #fff !important; }
.km-catnav-spacer { flex: 1; min-width: 12px; }
.km-catnav-hl { color: var(--cart) !important; font-weight: 700 !important; }

@media (max-width: 900px) {
  .km-header-inner { grid-template-columns: 1fr auto; gap: 12px; }
  .km-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .km-hdr-label { display: none; }
  .km-hdr-action { padding: 8px; }
  .km-header { position: static; }
}

/* ---------- breadcrumbs, chips, tags ---------- */
.km-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); padding: 16px 0 12px; }
.km-crumbs a:hover { color: var(--primary); }
.km-crumbs span:last-child { color: var(--text); font-weight: 500; }
.km-page > .km-crumbs { padding-top: 0; }
.km-chip-platform { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: #1b2838; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.km-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 500; }
.km-tag:hover { border-color: var(--primary); color: var(--primary); }
.km-badge-sale { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--sale); color: #fff; font-size: 13px; font-weight: 800; }

/* ---------- prices ---------- */
.km-price { display: flex; flex-direction: column; line-height: 1.15; }
.km-price-now { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.km-price-was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.km-price-soon { font-size: 13px; color: var(--muted); }

/* ---------- product cards ---------- */
.km-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.km-grid-catalog { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 480px) { .km-grid, .km-grid-catalog { grid-template-columns: 1fr 1fr; gap: 10px; } }
.km-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.km-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.km-card-cover { position: relative; display: block; aspect-ratio: 460 / 215; background: #e9edf3; }
.km-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.km-card-cover .km-badge-sale { position: absolute; top: 8px; left: 8px; }
.km-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
.km-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.km-card-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.km-card-title a:hover { color: var(--primary); }
.km-card-sub { font-size: 12px; color: var(--muted); }
.km-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.km-card-add { margin: 0; }
@media (max-width: 480px) {
  .km-card-body { padding: 10px; }
  .km-card-title { font-size: 14px; }
  .km-price-now { font-size: 17px; }
  .km-card-foot .km-btn span { display: none; }
  .km-card-foot .km-btn { width: 36px; padding: 0; }
}

/* ---------- home ---------- */
.km-hero-row { display: grid; grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
@media (min-width: 900px) { .km-hero-row { grid-template-columns: 2fr 1fr; } }
.km-hero {
  position: relative; display: flex; align-items: flex-end; min-height: 320px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff;
}
.km-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.km-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 18, 38, .92) 0%, rgba(10, 18, 38, .55) 55%, rgba(10, 18, 38, .1) 100%); }
.km-hero-plain::after { display: none; }
.km-hero-body { position: relative; z-index: 1; padding: 28px; max-width: 520px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.km-hero-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #ffb27a; }
.km-hero-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.km-hero-price { display: flex; align-items: center; gap: 10px; }
.km-hero-price .km-price-now { font-size: 28px; }
.km-hero-price .km-price-was { color: #b6c2dc; font-size: 15px; }
.km-promo-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .km-promo-col { grid-template-columns: 1fr; } }
.km-promo { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 20px; border-radius: 16px; min-height: 140px; color: #fff; transition: transform .2s; }
.km-promo:hover { transform: translateY(-2px); }
.km-promo strong { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.km-promo-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.km-promo-link { font-size: 14px; font-weight: 600; opacity: .9; }
.km-promo-blue { background: linear-gradient(135deg, #1f5bd8, #4f8bff); }
.km-promo-orange { background: linear-gradient(135deg, #f0590e, #ff9a3d); }

.km-section { padding-top: 36px; }
.km-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.km-section-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.km-cat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.km-cat-tile {
  display: flex; align-items: center; justify-content: center; height: 64px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); font-weight: 700; transition: border-color .15s, color .15s, background .15s;
}
.km-cat-tile:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.km-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.km-how li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.km-how-n { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.km-how strong { display: block; margin-bottom: 4px; }
.km-how p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- catalog ---------- */
.km-catalog { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 960px) { .km-catalog { grid-template-columns: 260px 1fr; } }
.km-filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 960px) { .km-filters { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; } }
.km-filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.km-filters-head h2 { font-size: 17px; font-weight: 800; }
.km-filters-head .km-link { font-size: 13px; }
.km-filter-group { padding: 14px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.km-filter-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #344054; padding: 0; }
.km-filters .km-input { height: 38px; font-size: 14px; }
.km-checklist { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.km-checklist .km-check { font-size: 14px; }
.km-filters .km-btn { margin-top: 10px; }

.km-range { position: relative; height: 24px; }
.km-range-track, .km-range-fill { position: absolute; top: 10px; height: 4px; border-radius: 2px; }
.km-range-track { left: 0; right: 0; background: var(--border); }
.km-range-fill { left: var(--fill-left, 0%); right: var(--fill-right, 0%); background: var(--primary); }
.km-range input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.km-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; box-shadow: var(--shadow); }
.km-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; }
.km-range input[type=range]::-moz-range-track { background: none; }
.km-range-readout { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }

.km-results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.km-results-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.km-results-head p { margin: 2px 0 0; font-size: 14px; }
.km-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.km-sort .km-input { height: 38px; width: auto; min-width: 190px; color: var(--text); font-size: 14px; }
.km-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.km-chip { display: inline-flex; gap: 6px; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; }
.km-chip:hover { background: var(--primary); color: #fff; }

.km-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.km-pager-btn, .km-pager-num { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; }
.km-pager a:hover { border-color: var(--primary); color: var(--primary); }
.km-pager .is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.km-pager .is-disabled { color: var(--border-strong); }
.km-pager-gap { align-self: center; color: var(--muted); padding: 0 4px; }

/* ---------- product page ---------- */
.km-pdp { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .km-pdp { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .km-pdp { grid-template-columns: 1.25fr 1fr 340px; } }
.km-pdp-media { border-radius: var(--radius); overflow: hidden; background: #e9edf3; border: 1px solid var(--border); }
.km-pdp-media img { width: 100%; aspect-ratio: 460 / 215; object-fit: contain; background: #0e1a33; }
.km-pdp-noimg { aspect-ratio: 460 / 215; display: grid; place-items: center; padding: 20px; text-align: center; font-weight: 800; font-size: 20px; color: var(--muted); }
.km-pdp-info h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.km-pdp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.km-facts { margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.km-facts > div { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.km-facts > div:nth-child(odd) { border-right: 1px solid var(--border); }
.km-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.km-facts dt { font-size: 12px; color: var(--muted); }
.km-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.km-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #344054; background: var(--primary-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.km-note svg { color: var(--primary); margin-top: 2px; flex-shrink: 0; }

.km-buybox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 760px) and (max-width: 1099px) { .km-buybox { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .km-buybox { position: sticky; top: 140px; } }
.km-buybox form { margin: 0; }
.km-buybox-price { display: flex; align-items: baseline; gap: 10px; }
.km-buybox-price .km-price-now { font-size: 34px; }
.km-buybox-price .km-price-was { font-size: 16px; }
.km-buybox-save { color: var(--sale); font-weight: 700; font-size: 14px; margin-top: -6px; }
.km-stock { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.km-buybox-hint { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.km-assure { list-style: none; margin: 8px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: #344054; }
.km-assure li { display: flex; align-items: center; gap: 8px; }
.km-assure svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.km-pdp-desc { margin-top: 24px; }
.km-pdp-desc h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.km-pdp-desc p { color: #344054; max-width: 860px; line-height: 1.65; }

/* ---------- checkout steps ---------- */
.km-steps { list-style: none; display: flex; gap: 0; margin: 0 0 20px; padding: 0; max-width: 520px; }
.km-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); position: relative; }
.km-steps li:last-child { flex: 0 0 auto; }
.km-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); margin: 0 10px; }
.km-steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: 13px; background: var(--surface); flex-shrink: 0; }
.km-steps .is-active { color: var(--text); }
.km-steps .is-active span { border-color: var(--primary); background: var(--primary); color: #fff; }
.km-steps .is-done { color: var(--green); }
.km-steps .is-done span { border-color: var(--green); background: var(--green); color: #fff; }
.km-steps .is-done::after { background: var(--green) !important; }

/* ---------- cart & summary ---------- */
.km-two-col { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 960px) { .km-two-col { grid-template-columns: 1fr 360px; } }
@media (min-width: 960px) { .km-two-col-even { grid-template-columns: 1fr 1fr; } }
.km-two-col + .km-panel { margin-top: 20px; }
.km-cart { padding: 0; overflow: hidden; }
.km-cart-head { display: none; }
@media (min-width: 640px) {
  .km-cart-head { display: grid; grid-template-columns: 1fr 90px 100px; gap: 16px; padding: 12px 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
}
.km-cart-line { display: grid; grid-template-columns: 96px 1fr; gap: 12px 14px; padding: 16px; border-bottom: 1px solid var(--border); align-items: center; }
.km-cart-line:last-child { border-bottom: 0; }
@media (min-width: 640px) {
  .km-cart-line { grid-template-columns: 120px 1fr 90px 100px; gap: 16px; padding: 16px 20px; }
}
.km-cart-line.is-unavailable { background: #fffaf5; }
.km-cart-thumb { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 460 / 215; background: #e9edf3; }
.km-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.km-cart-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.km-cart-info form { margin: 0; }
.km-cart-title { font-weight: 700; }
.km-cart-title:hover { color: var(--primary); }
.km-cart-warn { color: var(--warn); font-size: 13px; font-weight: 600; }
.km-cart-qty form { margin: 0; }
.km-cart-qty .km-input { height: 38px; width: 80px; }
.km-cart-price { font-weight: 800; font-size: 17px; }
@media (max-width: 639px) {
  .km-cart-qty { grid-column: 2; }
  .km-cart-price { grid-column: 2; text-align: left; margin-top: -8px; }
}

.km-summary { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 960px) { .km-summary { position: sticky; top: 140px; } }
.km-summary h2 { font-size: 18px; font-weight: 800; }
.km-summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.km-summary-total { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; font-size: 18px; font-weight: 800; }
.km-summary-back { text-align: center; font-size: 14px; }
.km-summary-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.km-summary-items li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.km-summary-items img { width: 64px; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 4px; }
.km-summary-items li:not(:has(img)) { grid-template-columns: 1fr auto; }
.km-summary-name { font-weight: 600; line-height: 1.3; }
.km-summary-name em { font-style: normal; color: var(--muted); }
.km-summary-items li > span:last-child { font-weight: 700; white-space: nowrap; }
.km-billing { font-size: 13px; line-height: 1.6; color: var(--muted); padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); overflow-wrap: anywhere; }
.km-billing-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-weight: 600; color: var(--text); }
.km-pay { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.km-pay-terms { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.km-secure { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.km-secure svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--green); }

/* ---------- confirmation & order ---------- */
.km-confirm { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.km-confirm .km-table-wrap, .km-confirm .km-summary-row { width: 100%; text-align: left; }
.km-confirm-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.km-confirm-icon svg { width: 28px; height: 28px; }
.km-confirm-icon.is-wait { background: var(--warn-soft); color: var(--warn); }
.km-confirm-icon.is-info { background: var(--primary-soft); color: var(--primary); }
.km-confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0 4px; }
.km-confirm-actions form { margin: 0; }

.km-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.km-order-head .km-h1 { margin: 4px 0 0; font-size: 24px; }
.km-order-sum { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.km-order-sum span { color: var(--muted); }
.km-order-sum strong { font-size: 22px; font-weight: 800; }
.km-order-sum .km-link { margin-left: auto; }
.km-order form { margin: 0 0 16px; }
.km-key { border: 2px dashed var(--green); background: var(--green-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.km-key-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #067647; }
.km-key-code { font-size: clamp(16px, 3vw, 22px); font-weight: 700; letter-spacing: .06em; word-break: break-all; }
.km-key p { margin: 0; }

.km-status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.km-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.km-status-done { background: var(--green-soft); color: #067647; }
.km-status-awaiting-payment { background: var(--warn-soft); color: var(--warn); }
.km-status-in-progress { background: var(--primary-soft); color: var(--primary); }
.km-status-needs-review { background: #fef3f2; color: #b42318; }

/* ---------- tables ---------- */
.km-table-wrap { overflow-x: auto; margin: 0 -4px; }
.km-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.km-table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--border); }
.km-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.km-table tr:last-child td { border-bottom: 0; }
.km-table td a:not(.km-btn):hover { color: var(--primary); }
.km-table .act { text-align: right; }
.km-table .act form { margin: 0; }
.km-table th.num { text-align: right; }

/* ---------- account ---------- */
.km-acct-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.km-acct-head .km-crumbs { padding: 0 0 6px; }
.km-acct-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.km-acct-head p { margin: 2px 0 0; }
.km-acct-head form { margin: 0; }
.km-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.km-tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.km-tabs a:hover { color: var(--text); }
.km-tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.km-acct-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.km-stat { display: flex; flex-direction: column; gap: 2px; transition: border-color .15s; }
.km-stat:hover { border-color: var(--primary); }
.km-stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.km-stat strong { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.km-stat strong.km-stat-date { font-size: 22px; padding: 5px 0; }
.km-stat small { font-size: 13px; color: var(--primary); font-weight: 600; }
.km-dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.km-dl dt { color: var(--muted); }
.km-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.km-form-panel { max-width: 520px; }
.km-form-panel-wide { max-width: 760px; }
.km-form-panel .km-form { margin-top: 8px; }
.km-form-panel .km-btn { align-self: flex-start; }

/* ---------- auth ---------- */
.km-auth { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 940px; margin: 12px auto 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
@media (min-width: 820px) { .km-auth { grid-template-columns: 1.15fr 1fr; } }
.km-auth-main { border-radius: 0; border: 0; padding: 32px; }
.km-auth-main .km-form { margin-top: 16px; }
.km-auth-alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.km-auth-aside { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #d6def0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.km-auth-aside h2 { color: #fff; font-size: 22px; font-weight: 800; }
.km-auth-aside ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.km-auth-aside li { display: flex; gap: 12px; }
.km-auth-aside li svg { color: #ffb27a; flex-shrink: 0; margin-top: 2px; }
.km-auth-aside strong { display: block; color: #fff; }
.km-auth-aside span { font-size: 14px; }
.km-auth-aside p { margin-top: auto; opacity: .7; }
@media (max-width: 819px) { .km-auth-aside { display: none; } .km-auth { box-shadow: none; } .km-auth-main { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; } }

/* ---------- policies ---------- */
.km-policy { padding: 24px 16px 0; }
.km-policy-inner { max-width: 860px; margin: 0 auto; padding: 28px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
@media (min-width: 768px) { .km-policy-inner { padding: 48px 56px; } }
.km-policy-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 8px; }
.km-policy-title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.02em; }
.km-policy-title .accent { color: var(--primary); }
.km-policy-meta { color: var(--muted); font-size: 14px; margin-top: 8px; }
.km-policy-body { margin-top: 24px; color: #344054; line-height: 1.7; }
.km-policy-h2 { font-size: 19px; font-weight: 700; color: var(--text); margin: 28px 0 10px; scroll-margin-top: 150px; }
.km-policy-body a { color: var(--primary); font-weight: 600; }
.km-policy-list { padding-left: 20px; }
.km-policy-contact { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; font-size: 14px; }

/* ---------- footer ---------- */
.km-footer { background: var(--navy); color: #aab6cf; font-size: 14px; }
.km-footer a:hover { color: #fff; }
.km-footer-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; padding: 28px 0; border-bottom: 1px solid #22335a; }
.km-footer-perks > div { display: flex; gap: 12px; align-items: flex-start; }
.km-footer-perks svg { color: #ffb27a; flex-shrink: 0; margin-top: 2px; }
.km-footer-perks strong { display: block; color: #fff; }
.km-footer-perks span { font-size: 13px; word-break: break-word; }
.km-footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
@media (min-width: 720px) { .km-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.km-footer .km-logo-name { color: #fff; }
.km-footer-brand p { margin: 12px 0; }
.km-footer address { font-style: normal; font-size: 13px; line-height: 1.7; }
.km-footer address a { color: #8fb0ff; }
.km-footer h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.km-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.km-footer-disclaimer { font-size: 12px; line-height: 1.6; color: #8592ad; padding: 18px 0; border-top: 1px solid #22335a; margin: 0; }
.km-footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0 24px; border-top: 1px solid #22335a; font-size: 13px; }
.km-footer-pay { display: flex; gap: 8px; }
.km-pay-badge { display: grid; place-items: center; width: 52px; height: 34px; background: #fff; border-radius: 6px; }

/* ---------- cookie banner & modal ---------- */
.km-cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(16, 24, 40, .1); }
.km-cookie-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.km-cookie p { margin: 0; font-size: 14px; flex: 1 1 420px; }
.km-cookie p a { color: var(--primary); font-weight: 600; }
.km-cookie-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.km-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.km-modal[hidden], .km-cookie[hidden] { display: none; }
.km-modal-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .5); }
.km-modal-panel { position: relative; background: var(--surface); border-radius: 16px; padding: 24px; max-width: 520px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.km-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.km-modal-head h2 { font-size: 20px; font-weight: 800; }
.km-modal-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.km-cookie-cat { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.km-cookie-cat p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.km-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.km-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.km-switch input { opacity: 0; width: 0; height: 0; }
.km-switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background .2s; }
.km-switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow); }
.km-switch input:checked + span { background: var(--primary); }
.km-switch input:checked + span::before { transform: translateX(20px); }
.km-switch input:disabled + span { opacity: .6; cursor: not-allowed; }

/* ==========================================================================
   Legacy generic classes (admin pages)
   ========================================================================== */
.section { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
.section-narrow { max-width: 560px; margin: 0 auto; padding: 32px 16px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.section-label, .form-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 6px; }
.section-title { font-size: 26px; font-weight: 800; }
.view-all { color: var(--primary); font-weight: 600; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field input, .form-field textarea, .form-field select { height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.form-field textarea { height: auto; padding: 10px 12px; }
.form-error { color: #b42318; }
.form-notice { color: #067647; }
.alert { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert-ok { background: var(--green-soft); border-color: #abefc6; color: #067647; }
.btn-hero, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.btn-hero { background: var(--primary); color: #fff; border: 0; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); }
.orders-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.orders-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--border); }
.orders-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.price-now { font-weight: 800; }
.status-pill { display: inline-flex; height: 24px; align-items: center; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); }

.km-hdr-cart .km-hdr-icon { margin-right: 8px; }
.km-filter-group > legend { float: left; width: 100%; margin-bottom: 10px; }
.km-filter-group > legend + * { clear: both; }
