/* Kidsmania catalogue — styles. Driven by CSS vars from themes.js */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root { color-scheme: light; }
button { font-family: inherit; cursor: pointer; }
.km-display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-spacing); }

/* ---------- App shell ---------- */
.km-app { min-height: 100vh; display: flex; flex-direction: column; }
.km-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.km-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); color: var(--header-ink);
  border-bottom: 1px solid color-mix(in srgb, var(--header-ink) 12%, transparent);
}
.km-header-inner { display: flex; align-items: center; gap: 18px; height: 76px; }
.km-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-shrink: 0; }
.km-logo-img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; display: block; }
.km-logo-text { font-size: 25px; line-height: 1; }
.km-logo-text small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; letter-spacing: .18em; opacity: .72; margin-top: 4px; }
.km-header-search { flex: 1; max-width: 460px; }
.km-header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.km-iconbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: var(--pill);
  border: 1.5px solid color-mix(in srgb, var(--header-ink) 28%, transparent);
  background: transparent; color: inherit; font-size: 14.5px; font-weight: 500;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.km-iconbtn:hover { background: color-mix(in srgb, var(--header-ink) 12%, transparent); }
.km-iconbtn:active { transform: scale(.97); }
.km-iconbtn.solid {
  background: color-mix(in srgb, var(--header-ink) 100%, transparent);
  color: var(--header-bg); border-color: transparent;
}
.km-iconbtn.brand { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.km-user-chip { display:flex; align-items:center; gap:9px; height:44px; padding:0 6px 0 14px; border-radius: var(--pill);
  background: color-mix(in srgb, var(--header-ink) 12%, transparent); font-size:14px; font-weight:500; }
.km-user-chip .av { width:32px; height:32px; border-radius:50%; background: var(--brand); color: var(--brand-ink); display:grid; place-items:center; font-weight:600; font-size:14px; }

/* ---------- Search input ---------- */
.km-search { position: relative; display: flex; align-items: center; }
.km-search svg { position: absolute; left: 16px; opacity: .55; pointer-events: none; }
.km-search input {
  width: 100%; height: 46px; padding: 0 16px 0 44px;
  border-radius: var(--pill); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.km-search.on-dark input { background: color-mix(in srgb, var(--header-ink) 14%, transparent); border-color: transparent; color: var(--header-ink); }
.km-search.on-dark svg { color: var(--header-ink); }
.km-search.on-dark input::placeholder { color: color-mix(in srgb, var(--header-ink) 60%, transparent); }
.km-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- Hero strip / mode toggle ---------- */
.km-subbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 76px; z-index: 35; }
.km-subbar-inner { display: flex; align-items: center; gap: 18px; height: 64px; flex-wrap: nowrap; }

.km-mode {
  display: inline-flex; padding: 5px; gap: 4px; border-radius: var(--pill);
  background: var(--surface-2); border: 1.5px solid var(--line);
}
.km-mode button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px; border: none; border-radius: var(--pill);
  background: transparent; color: var(--ink-soft); font-size: 15px; font-weight: 600; font-family: var(--font-display);
  letter-spacing: var(--display-spacing); transition: all .16s ease; white-space: nowrap;
}
.km-mode button.active { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-soft); }
.km-mode button .lk { display: inline-flex; opacity: .8; }

.km-count { font-size: 14px; color: var(--ink-soft); margin-left: 4px; }
.km-count b { color: var(--ink); font-weight: 700; }
.km-sort { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.km-select { height: 42px; padding: 0 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-family: inherit; outline: none; }
.km-select:focus { border-color: var(--brand); }

/* ---------- Category rail ---------- */
.km-cats { display: flex; gap: 10px; flex-wrap: wrap; padding: 22px 0 6px; }
.km-cat {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 18px; border-radius: var(--pill);
  border: var(--card-border); background: var(--surface); color: var(--ink-soft);
  font-size: 14.5px; font-weight: 600; transition: all .15s ease;
}
.km-cat .dot { width: 9px; height: 9px; border-radius: 50%; }
.km-cat:hover { color: var(--ink); transform: translateY(-1px); }
.km-cat.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.km-cat.active .dot { box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Product grid ---------- */
.km-grid { display: grid; gap: 20px; padding: 22px 0 60px;
  grid-template-columns: repeat(3, 1fr); }
.km-grid.density-comfy { grid-template-columns: repeat(2, 1fr); gap: 26px; }
.km-grid.density-compact { grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1080px) { .km-grid, .km-grid.density-compact, .km-grid.density-comfy { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .km-grid, .km-grid.density-compact, .km-grid.density-comfy { grid-template-columns: repeat(2, 1fr); } }

.km-card {
  position: relative;
  background: var(--surface); border: var(--card-border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.km-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.km-thumb { position: relative; aspect-ratio: 1 / 1.08; overflow: hidden; }
.km-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 2px, transparent 2px 11px),
    var(--ph-bg);
}
.km-ph span { font-family: ui-monospace, monospace; font-size: 11px; color: rgba(0,0,0,.40); text-align: center; line-height: 1.5; letter-spacing: .02em; }
.km-ph .code { display:block; font-size: 10px; opacity: .7; margin-top: 2px; }

.km-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.km-badge { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: var(--pill); color: #fff; letter-spacing: .02em; font-family: var(--font-body); white-space: nowrap; }
.km-fav { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(4px); display: grid; place-items: center; color: var(--ink-soft); transition: all .15s ease; }
.km-fav:hover { color: var(--accent-4); transform: scale(1.08); }
.km-fav.on { color: var(--badge-sale); }

.km-chan-tag { position: absolute; bottom: 12px; left: 12px; font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: var(--pill); background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(4px); color: var(--ink); display: flex; align-items: center; gap: 6px; }
.km-chan-tag .d { width: 7px; height: 7px; border-radius: 50%; }

.km-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.km-name { font-size: 16px; font-weight: 600; line-height: 1.35; font-family: var(--font-display); letter-spacing: var(--display-spacing); }
.km-code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--ink-soft); }
.km-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.km-chip { font-size: 11.5px; color: var(--ink-soft); background: var(--surface-2); border-radius: var(--pill); padding: 4px 9px; white-space: nowrap; }
.km-swatches { display:flex; gap:5px; align-items:center; }
.km-sw { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); }

.km-price-row { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.km-price { font-family: var(--font-display); font-weight: 700; }
.km-price .cur { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-right: 2px; }
.km-price .amt { font-size: 24px; }
.km-price .strike { font-size: 13px; color: var(--ink-soft); text-decoration: line-through; margin-left: 6px; font-weight: 500; }
.km-price .unit { font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-left: 3px; }

.km-w-block { background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.km-w-top { display: flex; align-items: baseline; justify-content: space-between; }
.km-moq { font-size: 11.5px; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); padding: 3px 9px; border-radius: var(--pill); white-space: nowrap; }
.km-w-top { gap: 8px; flex-wrap: wrap; }
.km-tiers { display: flex; flex-direction: column; gap: 4px; }
.km-tier { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.km-tier b { color: var(--ink); font-weight: 700; }

.km-locked { display:flex; flex-direction:column; align-items:flex-start; gap:8px; margin-top:auto; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1.5px dashed var(--line); }
.km-locked .ln { display:flex; align-items:center; gap:8px; font-size:13px; color: var(--ink-soft); font-weight:600; }
.km-locked button { font-size: 13px; font-weight: 700; color: var(--brand); background: none; border: none; padding: 0; text-decoration: underline; }

.km-add { height: 38px; padding: 0 14px; border-radius: var(--pill); border: none; background: var(--ink); color: var(--surface);
  font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; transition: all .14s ease; }
.km-add:hover { background: var(--brand); }
.km-add:active { transform: scale(.96); }
.km-add-ws { width: 100%; justify-content: center; margin-top: 2px; background: var(--brand); color: var(--brand-ink); }
.km-add-ws:hover { background: var(--ink); color: var(--surface); }

/* ---------- Product detail modal ---------- */
.km-pd { width: 100%; max-width: 960px; max-height: 92vh; background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; box-shadow: 0 30px 80px -30px rgba(0,0,0,.55);
  animation: kmPop .22s cubic-bezier(.2,.9,.3,1.2); position: relative; }
@media (max-width: 760px) { .km-pd { grid-template-columns: 1fr; max-height: 94vh; overflow-y: auto; } }
.km-pd-x { position: absolute; top: 14px; right: 14px; z-index: 5; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(4px); }
.km-pd-gallery { background: var(--surface-2); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.km-pd-main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.km-pd-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-pd-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: none; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-soft); transition: all .15s ease; }
.km-pd-arrow:hover { background: var(--surface); }
.km-pd-arrow.left { left: 10px; } .km-pd-arrow.left svg { transform: rotate(90deg); }
.km-pd-arrow.right { right: 10px; } .km-pd-arrow.right svg { transform: rotate(-90deg); }
.km-pd-counter { position: absolute; bottom: 10px; right: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--pill); }
.km-pd-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.km-pd-thumbs::-webkit-scrollbar { height: 6px; } .km-pd-thumbs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.km-pd-thumb { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: none; cursor: pointer; transition: border-color .15s ease; }
.km-pd-thumb.on { border-color: var(--brand); }
.km-pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-pd-info { padding: 30px 30px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.km-pd-code { font-family: ui-monospace, monospace; font-size: 12px; color: var(--ink-soft); }
.km-pd-info h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 21px; line-height: 1.4; margin: 0; letter-spacing: var(--display-spacing); }
.km-pd-price { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--brand); }
.km-pd-price .cur { font-size: 18px; }
.km-pd-price .unit { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.km-pd-price .km-moq { font-size: 12px; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); padding: 3px 10px; border-radius: var(--pill); align-self: center; }
.km-pd-row { display: flex; flex-direction: column; gap: 7px; }
.km-pd-row .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.km-pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.km-pd-row .req { color: var(--badge-sale); font-style: normal; font-weight: 800; }
.km-opt { font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  padding: 8px 15px; border-radius: var(--pill); cursor: pointer; transition: all .14s ease; font-family: inherit; line-height: 1; }
.km-opt:hover { border-color: var(--brand); color: var(--brand); }
.km-opt.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.km-pd-err { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--badge-sale);
  background: color-mix(in srgb, var(--badge-sale) 10%, transparent); border: 1.5px solid color-mix(in srgb, var(--badge-sale) 28%, transparent);
  padding: 10px 13px; border-radius: var(--radius-sm); }
.km-pd-added { background: var(--badge-new) !important; }
.km-cart-info .opts { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.km-cart-info .opts .opt { font-size: 11.5px; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--pill); }
.km-pd-desc { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); margin: 0; white-space: pre-wrap; max-height: 220px; overflow-y: auto; }
.km-pd-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; }
.km-pd-actions .km-btn-lg { width: 100%; justify-content: center; text-decoration: none; }

/* ---------- Login gate (wholesale, not logged in) ---------- */
.km-gate { padding: 56px 24px 90px; text-align: center; max-width: 560px; margin: 0 auto; }
.km-gate .ic { width: 84px; height: 84px; border-radius: 26px; background: color-mix(in srgb, var(--brand) 14%, transparent); display:grid; place-items:center; margin: 0 auto 22px; color: var(--brand); }
.km-gate h2 { font-family: var(--font-display); font-weight: 600; font-size: 28px; margin: 0 0 10px; letter-spacing: var(--display-spacing); }
.km-gate p { color: var(--ink-soft); font-size: 16px; line-height: 1.6; margin: 0 0 26px; }
.km-gate .acts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.km-btn-lg { height: 52px; padding: 0 28px; border-radius: var(--pill); border: none; font-size: 16px; font-weight: 700; font-family: var(--font-display);
  display: inline-flex; align-items: center; gap: 9px; transition: all .15s ease; }
.km-btn-lg.primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.km-btn-lg.ghost { background: var(--surface); color: var(--ink); border: var(--card-border); }
.km-btn-lg:hover { transform: translateY(-2px); }
.km-btn-lg:active { transform: translateY(0) scale(.98); }

/* ---------- Empty state ---------- */
.km-empty { text-align:center; padding: 70px 20px 100px; color: var(--ink-soft); }
.km-empty .ic { width:64px; height:64px; border-radius: 20px; background: var(--surface-2); display:grid; place-items:center; margin:0 auto 16px; }
.km-empty h3 { font-family: var(--font-display); color: var(--ink); font-size: 20px; margin: 0 0 6px; }

/* ---------- Modal ---------- */
.km-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(20,16,30,.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; animation: kmFade .18s ease; }
@keyframes kmFade { from { opacity: 0; } to { opacity: 1; } }
.km-modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.55); animation: kmPop .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes kmPop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.km-modal-head { padding: 24px 26px 0; position: relative; }
.km-modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 23px; margin: 0 0 6px; letter-spacing: var(--display-spacing); }
.km-modal-head p { color: var(--ink-soft); font-size: 14px; margin: 0; line-height: 1.5; }
.km-x { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; }
.km-x:hover { color: var(--ink); }
.km-modal-body { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 14px; }
.km-field { display: flex; flex-direction: column; gap: 7px; }
.km-field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.km-field input { height: 48px; padding: 0 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit; outline: none; }
.km-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.km-note { font-size: 12.5px; color: var(--ink-soft); background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 13px; line-height: 1.55; display:flex; gap:9px; }
.km-note svg { flex-shrink: 0; margin-top: 1px; color: var(--brand); }
.km-modal-foot { display: flex; flex-direction: column; gap: 10px; }
.km-modal-foot .alt { text-align: center; font-size: 13px; color: var(--ink-soft); }
.km-modal-foot .alt button { color: var(--brand); font-weight: 700; background: none; border: none; }
.km-seg { display:flex; gap:8px; }
.km-seg button { flex:1; height:42px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight:600; font-size:14px; }
.km-seg button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }

/* pending banner */
.km-pending { background: color-mix(in srgb, var(--badge-hot) 14%, transparent); color: color-mix(in srgb, var(--badge-hot) 75%, var(--ink));
  border: 1.5px solid color-mix(in srgb, var(--badge-hot) 35%, transparent); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; display:flex; gap:10px; align-items:flex-start; }
.km-pending svg { flex-shrink:0; margin-top:1px; }
.km-err { background: color-mix(in srgb, #E5484D 12%, transparent); color: color-mix(in srgb, #E5484D 80%, var(--ink));
  border: 1.5px solid color-mix(in srgb, #E5484D 32%, transparent); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; display:flex; gap:9px; align-items:flex-start; }
.km-err svg { flex-shrink:0; margin-top:1px; }

/* ---------- Cart drawer ---------- */
.km-cart-overlay { justify-content: flex-end; padding: 0; }
.km-cart { width: 100%; max-width: 440px; height: 100vh; background: var(--surface); display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(0,0,0,.5); animation: kmSlideIn .26s cubic-bezier(.2,.9,.3,1); }
@keyframes kmSlideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.km-cart-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.km-cart-head h3 { margin: 0; font-size: 21px; font-family: var(--font-display); }
.km-cart-head .km-x { position: static; }
.km-cart-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.km-cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--ink-soft); padding: 40px; }
.km-cart-empty .ic { width: 70px; height: 70px; border-radius: 22px; background: var(--surface-2); display: grid; place-items: center; }

.km-cart-item { display: flex; gap: 13px; }
.km-cart-thumb { position: relative; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--surface-2); }
.km-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.km-cart-thumb .ph { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 9px); }
.km-cart-thumb .ws { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; background: var(--accent-4); color: #fff; padding: 2px 6px; border-radius: var(--pill); }
.km-cart-info { flex: 1; min-width: 0; }
.km-cart-info .nm { font-size: 14.5px; font-weight: 600; line-height: 1.35; font-family: var(--font-display); }
.km-cart-info .cd { font-size: 12px; color: var(--ink-soft); margin: 3px 0 8px; font-family: ui-monospace, monospace; }
.km-qty { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: var(--pill); overflow: hidden; }
.km-qty button { width: 30px; height: 30px; border: none; background: var(--surface-2); color: var(--ink); font-size: 16px; font-weight: 700; display: grid; place-items: center; }
.km-qty button:hover { background: var(--brand); color: var(--brand-ink); }
.km-qty span { min-width: 34px; text-align: center; font-size: 14px; font-weight: 700; }
.km-qty .moq { margin-left: 8px; font-size: 11px; color: var(--brand); font-style: normal; font-weight: 600; }
.km-cart-right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.km-cart-right .lt { font-size: 15px; font-weight: 700; font-family: var(--font-display); }
.km-cart-right .rm { font-size: 12px; color: var(--ink-soft); background: none; border: none; padding: 0; }
.km-cart-right .rm:hover { color: var(--badge-sale); }

.km-cart-foot { border-top: 1px solid var(--line); padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.km-cart-total { display: flex; align-items: baseline; justify-content: space-between; }
.km-cart-total span { font-size: 15px; color: var(--ink-soft); }
.km-cart-total b { font-size: 26px; font-family: var(--font-display); }
.km-cart-clear { background: none; border: none; color: var(--ink-soft); font-size: 13px; text-decoration: underline; padding: 0; }
.km-cart-clear:hover { color: var(--badge-sale); }
.km-cart-back { background: none; border: none; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; padding: 0 0 4px; display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; }
.km-cart-back svg { transform: rotate(90deg); }
.km-cart-back:hover { color: var(--brand); }
.km-cart .km-field textarea { padding: 12px 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit; outline: none; resize: vertical; line-height: 1.5; }
.km-cart .km-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }

.km-cart-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 40px; }
.km-cart-done .ic { width: 82px; height: 82px; border-radius: 50%; background: color-mix(in srgb, var(--badge-new) 16%, transparent); color: var(--badge-new); display: grid; place-items: center; }
.km-cart-done h4 { margin: 0; font-size: 24px; font-family: var(--font-display); }
.km-cart-done p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
@media (max-width: 480px) { .km-cart { max-width: 100%; } }

/* ---------- Contact footer ---------- */
.km-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; }
.km-footer-inner { padding: 44px 0 40px; }
.km-footer h4 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 4px; letter-spacing: var(--display-spacing); }
.km-footer .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }
.km-contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .km-contacts { grid-template-columns: 1fr; } }
.km-contact { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: var(--radius-md); border: var(--card-border); background: var(--surface); text-decoration: none; color: var(--ink); transition: all .15s ease; }
.km-contact:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.km-contact .ci { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; font-family: var(--font-display); }
.km-contact .ct b { display: block; font-size: 14.5px; font-weight: 700; }
.km-contact .ct span { font-size: 12.5px; color: var(--ink-soft); }
.km-footer-bottom { border-top: 1px solid var(--line); padding: 18px 0; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; color: var(--ink-soft); font-size: 13px; }

/* cart toast */
.km-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); z-index: 90;
  background: var(--ink); color: var(--surface); padding: 13px 22px; border-radius: var(--pill); font-size: 14.5px; font-weight: 600;
  display:flex; align-items:center; gap:10px; box-shadow: 0 20px 40px -16px rgba(0,0,0,.5); opacity: 0; transition: all .3s cubic-bezier(.2,.9,.3,1.2); }
.km-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============ NEW SECTIONS ============ */

/* ---------- Hero carousel ---------- */
.km-hero { position: relative; margin-top: 24px; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 5 / 2; background: var(--surface-2); box-shadow: var(--shadow-soft); }
.km-hero-track { display: flex; height: 100%; transition: transform .55s cubic-bezier(.5,.05,.2,1); }
.km-hero-slide { flex: 0 0 100%; height: 100%; padding: 0; border: none; background: none; cursor: pointer; display: block; }
.km-hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: none; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(6px); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-soft); transition: all .15s ease; opacity: .9; z-index: 3; }
.km-hero:hover .km-hero-arrow { opacity: 1; }
.km-hero-arrow:hover { background: var(--surface); transform: translateY(-50%) scale(1.08); }
.km-hero-arrow.left { left: 16px; }
.km-hero-arrow.left svg { transform: rotate(90deg); }
.km-hero-arrow.right { right: 16px; }
.km-hero-arrow.right svg { transform: rotate(-90deg); }
.km-hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.km-hero-dot { width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: color-mix(in srgb, #fff 55%, transparent); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: all .2s ease; }
.km-hero-dot.on { width: 26px; border-radius: 999px; background: #fff; }
@media (hover: none) { .km-hero-arrow { opacity: 1; } }
@media (max-width: 760px) { .km-hero { aspect-ratio: 3 / 2; } .km-hero-arrow { width: 38px; height: 38px; } }

/* ---------- Feature video / image banner ---------- */
.km-feature { position: relative; margin-top: 36px; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 5 / 2; background: var(--surface-2); box-shadow: var(--shadow-soft); }
.km-feature-media { position: absolute; inset: 0; }
.km-feature-media video, .km-feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-feature-ph { position: absolute; inset: 0; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--brand) 8%, transparent) 0 2px, transparent 2px 13px), var(--bg-tint); }
.km-feature-ph span { font-family: ui-monospace, monospace; font-size: 14px; color: var(--ink-soft); text-align: center; line-height: 1.6; }
.km-feature-ph .dim { display: block; font-size: 11.5px; opacity: .75; margin-top: 6px; }
.km-feature-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 40px 34px;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,.18) 60%, transparent);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.km-feature-overlay h3 { color: #fff; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(22px, 3vw, 36px); margin: 0; letter-spacing: var(--display-spacing); text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.km-feature-overlay p { color: rgba(255,255,255,.9); font-size: clamp(13px, 1.4vw, 16px); margin: 0 0 8px; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.km-feature-cta { pointer-events: auto; height: 44px; padding: 0 26px; border-radius: var(--pill); border: none;
  background: var(--brand); color: var(--brand-ink); font-size: 14.5px; font-weight: 700; font-family: var(--font-display);
  display: inline-flex; align-items: center; box-shadow: var(--shadow); transition: all .15s ease; }
.km-feature-cta:hover { transform: translateY(-2px); filter: brightness(1.05); }
.km-feature-cta:active { transform: scale(.97); }
@media (max-width: 760px) { .km-feature { aspect-ratio: 4 / 3; } .km-feature-overlay { padding: 26px 22px 22px; } }

/* ---------- Hot Sale rail ---------- */
.km-hotsale { padding: 36px 0 8px; }
.km-hs-head { text-align: center; margin-bottom: 6px; }
.km-hs-head h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 26px; margin: 0;
  color: var(--ink); letter-spacing: var(--display-spacing); display: inline-flex; align-items: center; gap: 10px; }
.km-hs-head .fl { font-size: 22px; }
.km-hs-more { display: inline-block; margin: 8px auto 0; background: none; border: none; color: var(--ink-soft);
  font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.km-hs-more:hover { color: var(--brand); }
.km-hs-wrap { position: relative; margin-top: 18px; }
.km-hs-rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; scrollbar-width: none; }
.km-hs-rail::-webkit-scrollbar { display: none; }
.km-hs-card { flex: 0 0 calc((100% - 54px) / 4); min-width: 200px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; }
@media (max-width: 980px) { .km-hs-card { flex-basis: calc((100% - 36px) / 3); } }
@media (max-width: 680px) { .km-hs-card { flex-basis: calc((100% - 18px) / 2); } }
.km-hs-thumb { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden;
  border: var(--card-border); background: var(--surface); transition: transform .18s ease, box-shadow .18s ease; }
.km-hs-card:hover .km-hs-thumb { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.km-hs-thumb .km-thumb { aspect-ratio: 1 / 1; position: absolute; inset: 0; }
.km-hs-badge { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--badge-sale); color: #fff;
  font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: var(--pill); }
.km-hs-badge.hot { background: var(--badge-hot); }
.km-hs-name { margin-top: 14px; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink);
  font-family: var(--font-display); max-width: 92%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.km-hs-price { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; justify-content: center; }
.km-hs-price .now { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--badge-sale); }
.km-hs-price .was { font-size: 13px; color: var(--ink-soft); text-decoration: line-through; }
.km-hs-price .unit { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.km-hs-rate { margin-top: 7px; }
.km-hs-locked { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1.5px dashed var(--line);
  color: var(--ink-soft); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: var(--pill); }
.km-hs-locked:hover { color: var(--brand); border-color: var(--brand); }
.km-hs-arrow { position: absolute; top: calc(50% - 40px); transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: var(--card-border); background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow-soft); z-index: 4; transition: all .15s ease; }
.km-hs-arrow:hover { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.km-hs-arrow.left { left: -14px; }
.km-hs-arrow.left svg { transform: rotate(90deg); }
.km-hs-arrow.right { right: -14px; }
.km-hs-arrow.right svg { transform: rotate(-90deg); }
@media (max-width: 760px) { .km-hs-arrow { display: none; } }

/* ---------- Promo bar (top marquee) ---------- */
.km-promo { background: var(--ink); color: var(--surface); overflow: hidden; }
.km-promo-track { display: flex; align-items: center; gap: 44px; height: 38px; white-space: nowrap;
  animation: kmMarquee 22s linear infinite; }
@keyframes kmMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.km-promo-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; opacity: .92; }
.km-promo-item svg { color: var(--accent-2); }
@media (prefers-reduced-motion: reduce) { .km-promo-track { animation: none; justify-content: center; } }

/* ---------- Stars ---------- */
.km-stars { display: inline-flex; align-items: center; gap: 6px; }
.km-stars .sgroup { display: inline-flex; gap: 1px; }
.km-stars .st { color: var(--line); display: inline-flex; }
.km-stars .st.on { color: var(--accent-2); }
.km-stars .rv { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.km-stars .rvn { font-weight: 500; opacity: .8; }
.km-stars.compact .rv { font-size: 11.5px; }

.km-codeline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* ---------- Quick buy (hover overlay) ---------- */
.km-quick { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 40px; border: none; border-radius: var(--pill);
  background: var(--ink); color: var(--surface); font-size: 13.5px; font-weight: 700; font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(8px); transition: all .2s ease; z-index: 3; }
.km-card:hover .km-quick { opacity: 1; transform: translateY(0); }
.km-quick:hover { background: var(--brand); }
.km-quick:active { transform: scale(.97); }
@media (hover: none) { .km-quick { opacity: 1; transform: none; } }

/* ---------- Trust bar ---------- */
.km-trust { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.km-trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 26px 0; }
.km-trust-item { display: flex; align-items: center; gap: 13px; }
.km-trust-item .ti { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.km-trust-item b { display: block; font-size: 14.5px; font-weight: 700; font-family: var(--font-display); line-height: 1.3; margin-bottom: 2px; }
.km-trust-item span { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
@media (max-width: 760px) { .km-trust-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }

/* ---------- Shop by Collection (3-col grid) ---------- */
.km-collections { padding: 30px 0 8px; }
.km-sec-head { margin-bottom: 18px; }
.km-sec-head.center { text-align: center; }
.km-sec-head h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 26px; margin: 0 0 4px; letter-spacing: var(--display-spacing); }
.km-sec-head p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }
.km-coll-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 24px; }
@media (max-width: 760px) { .km-coll-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 460px) { .km-coll-grid { grid-template-columns: 1fr; } }
.km-coll { border: none; padding: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.km-coll-img { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-soft); transition: transform .18s ease, box-shadow .18s ease; }
.km-coll:hover .km-coll-img { transform: translateY(-4px); box-shadow: var(--shadow); }
.km-coll-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.km-coll-ph { width: 100%; height: 100%; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 2px, transparent 2px 11px), var(--coll-bg); }
.km-coll-ph .lbl { font-family: ui-monospace, monospace; font-size: 11px; color: rgba(0,0,0,.42); text-align: center; line-height: 1.5; }
.km-coll-cap { margin-top: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink); font-family: var(--font-display);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); transition: color .15s ease; }
.km-coll:hover .km-coll-cap { color: var(--brand); text-decoration-color: var(--brand); }

/* ---------- Shop layout: filter sidebar + grid ---------- */
.km-shop { display: grid; grid-template-columns: 236px 1fr; gap: 26px; align-items: start; }
.km-shop-main { min-width: 0; }
@media (max-width: 900px) { .km-shop { grid-template-columns: 1fr; } }

.km-filters { position: sticky; top: 152px; background: var(--surface); border: var(--card-border); border-radius: var(--radius-md);
  padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.km-filt-head { display: flex; align-items: center; justify-content: space-between; }
.km-filt-head .km-display { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: var(--display-weight); white-space: nowrap; }
.km-clear { font-size: 12.5px; font-weight: 700; color: var(--brand); background: none; border: none; }
.km-filt-group { display: flex; flex-direction: column; gap: 11px; }
.km-filt-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.km-filt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.km-fchip { height: 34px; padding: 0 13px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-size: 13px; font-weight: 600; transition: all .14s ease; }
.km-fchip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.km-filt-list { display: flex; flex-direction: column; gap: 4px; }
.km-fradio { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); cursor: pointer; padding: 5px 0; }
.km-fradio input { display: none; }
.km-fradio .dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line); transition: all .14s ease; flex-shrink: 0; }
.km-fradio.on .dot { border-color: var(--brand); background: radial-gradient(circle at center, var(--brand) 0 4px, transparent 5px); }
.km-fradio.on { font-weight: 700; }
.km-filt-sw { display: flex; flex-wrap: wrap; gap: 9px; }
.km-fsw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line);
  display: grid; place-items: center; color: #fff; cursor: pointer; transition: transform .14s ease; }
.km-fsw:hover { transform: scale(1.1); }
.km-fsw.on { box-shadow: 0 0 0 2.5px var(--brand); }
.km-ftoggle { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.km-ftoggle input { display: none; }
.km-ftoggle .sw { width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; transition: background .16s ease; flex-shrink: 0; }
.km-ftoggle .sw::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .16s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.km-ftoggle.on .sw { background: var(--brand); }
.km-ftoggle.on .sw::after { transform: translateX(17px); }

.km-filt-btn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.km-filt-btn:hover { border-color: var(--brand); }
.km-filt-scrim { display: none; }

/* mobile: filter becomes a drawer */
@media (max-width: 900px) {
  .km-filters { position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 84vw; z-index: 85; border-radius: 0;
    transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto; box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .km-shop.filt-open .km-filters { transform: translateX(0); }
  .km-shop.filt-open .km-filt-scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(20,16,30,.45); }
}
@media (min-width: 901px) { .km-filt-btn { display: none; } }
