/* Kodumarket Julge — base components.
   Depends on tokens.css (loaded first).
   These are starter styles — discover, extend, split into page-level CSS as needed. */

/* --- Root / body --- */
body {
  font-family: "Geist", ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--km-ink);
  background: var(--km-surface);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }

/* --- Typography helpers --- */
.km-mono  { font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.km-serif { font-family: "Instrument Serif", "Times New Roman", serif; font-style: italic; font-weight: 400; }

.km-meta { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--km-ink-4); }
.km-meta-sm { font-size: 10px; letter-spacing: .1em; }

.km-h1       { font-size: clamp(56px, 10vw, 128px); font-weight: 800; letter-spacing: -0.05em; line-height: .85; text-wrap: balance; }
.km-h2       { font-size: 48px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.km-h2-index { font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.km-h3       { font-size: 30px; font-weight: 500; letter-spacing: -0.025em; }
.km-title    { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; text-wrap: pretty; }

/* --- Buttons --- */
.km-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--km-r-md);
  border: 1px solid transparent;
  font: 600 14px/1 "Geist", sans-serif; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s, color .15s;
}
.km-btn:active { transform: translateY(1px); }
.km-btn--primary { background: var(--km-ink); color: #fff; border-radius: 999px; height: 54px; padding: 0 26px; }
.km-btn--primary:hover { background: #000; }
.km-btn--accent  { background: var(--km-green-600); color: #fff; border-radius: 999px; height: 54px; padding: 0 26px; }
.km-btn--accent:hover { background: var(--km-green-700); box-shadow: var(--km-shadow-green); }
.km-btn--julge   { background: #10B981; color: #0A1628; border-radius: 999px; height: 54px; padding: 0 26px; font-weight: 700; }
.km-btn--ghost   { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; height: 54px; padding: 0 26px; }
.km-btn--light   { background: #fff; color: var(--km-ink); border-radius: 999px; height: 48px; padding: 0 22px; }

/* --- Chips / pills --- */
.km-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: transparent; border: 1px solid var(--km-line);
  font-size: 12px; font-weight: 500;
}
.km-chip--active { background: var(--km-ink); color: #fff; border-color: var(--km-ink); }
.km-chip--sale   { background: #FEE2E2; color: #B91C1C; border: none; font-family: "Geist Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: .04em; }

/* --- Round icon button --- */
.km-round {
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--km-ink); color: #fff;
  transition: transform .12s ease;
}
.km-round:hover { transform: scale(1.08); }
.km-round--sm { width: 36px; height: 36px; }

/* --- Qty stepper --- */
.km-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--km-line); border-radius: var(--km-r-md);
  height: 48px; overflow: hidden;
}
.km-qty button {
  width: 44px; height: 100%; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
  color: var(--km-ink);
}
.km-qty input {
  width: 40px; height: 100%; border: 0; text-align: center;
  font: 700 14px "Geist Mono", monospace; background: transparent;
  -moz-appearance: textfield;
}
.km-qty input::-webkit-outer-spin-button,
.km-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Breadcrumb (Julge) --- */
.km-breadcrumb ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  font: 500 11px/1 "Geist Mono", monospace;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--km-ink-4);
}
.km-breadcrumb li { display: inline-flex; align-items: center; gap: 6px; counter-increment: km-crumb; }
.km-breadcrumb li::before { content: counter(km-crumb, decimal-leading-zero) " "; color: var(--km-ink-4); }
.km-breadcrumb li:last-child { color: var(--km-ink); }
.km-breadcrumb li:not(:last-child)::after { content: "·"; padding-left: 4px; color: var(--km-ink-4); }
.km-breadcrumb ol { counter-reset: km-crumb; }

/* --- Product card --- */
.km-pcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--km-line-soft); border-radius: var(--km-r-lg);
  padding: 18px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.km-pcard:hover { transform: translateY(-2px); box-shadow: var(--km-shadow-md); }
.km-pcard__meta {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
  font: 500 10px/1 "Geist Mono", monospace;
  letter-spacing: .08em; color: var(--km-ink-4); text-transform: uppercase;
}
.km-pcard__img {
  aspect-ratio: 1 / 1; background: var(--km-surface-2); border-radius: 14px;
  padding: 20px; position: relative; margin-bottom: 14px;
  display: grid; place-items: center;
}
.km-pcard__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.km-pcard__badge {
  position: absolute; bottom: 10px; left: 10px;
  background: var(--km-ink); color: #fff;
  font: 700 10px/1 "Geist Mono", monospace; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px;
}
.km-pcard__title { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 4px; text-wrap: pretty; }
.km-pcard__size  { font: 500 11px "Geist Mono", monospace; color: var(--km-ink-4); margin-bottom: 14px; }
.km-pcard__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--km-line-soft);
  display: flex; align-items: baseline; justify-content: space-between;
}
.km-pcard__price { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.km-pcard__old   { font-size: 11px; color: var(--km-ink-4); text-decoration: line-through; }

.km-pcard--dark {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: #fff;
}
.km-pcard--dark .km-pcard__img   { background: rgba(255,255,255,.03); }
.km-pcard--dark .km-pcard__badge { background: #10B981; color: var(--km-ink); }
.km-pcard--dark .km-pcard__foot  { border-top-color: rgba(255,255,255,.08); }
.km-pcard--dark .km-round        { background: #10B981; color: var(--km-ink); }

/* --- Section index row (category editorial list) --- */
.km-indexrow {
  display: grid; grid-template-columns: 50px 1fr 1fr 80px 32px;
  gap: 16px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--km-line);
  cursor: pointer; text-decoration: none; color: inherit;
}
.km-indexrow__n    { font: 500 12px "Geist Mono", monospace; color: var(--km-ink-4); }
.km-indexrow__name { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.km-indexrow__sub  { font-size: 13px; color: var(--km-ink-3); }
.km-indexrow__cnt  { font: 500 11px "Geist Mono", monospace; color: var(--km-ink-4); text-align: right; text-transform: uppercase; }
.km-indexrow:hover { background: var(--km-surface-2); }

/* --- Overlap seam (dark hero → white body) --- */
.km-body-overlap { border-top-left-radius: 32px; border-top-right-radius: 32px; margin-top: -24px; position: relative; z-index: 2; background: #fff; }

/* --- Dark footer --- */
.km-footer { background: #050E1C; color: rgba(255,255,255,.6); padding: 56px 48px 32px; }
.km-footer a { color: inherit; text-decoration: none; }
.km-footer a:hover { color: #fff; }

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
  .km-indexrow { grid-template-columns: 30px 1fr 40px 24px; }
  .km-indexrow__sub { display: none; }
  .km-footer { padding: 40px 16px 24px; }
}
