/* Kaubasadam — töökojatarvikute pood.
 *
 * Disainisuund: mõõteriist. Töökojatööriista oma keel on täpsus ja loetavus —
 * stantsitud numbrid, kõrge kontrast, nihiku skaala. Konkurendid kuvavad
 * tarnija feedi toorelt; meie eelis on loetavus, seega värvi ja kaunistust
 * kasutatakse ainult siis, kui see midagi TÄHENDAB:
 *
 *   punane  = hind ja ostutegevus, mitte midagi muud
 *   roheline = saadavus
 *   mono    = tootekood, EAN, mõõt
 */

:root {
  --ink: #16191d;
  --ink-soft: #3b424b;
  --steel: #5a636e;
  --rule: #dde1e6;
  --rule-soft: #eceef1;
  --paper: #f7f8f9;
  --card: #ffffff;
  --signal: #c8102e;
  --signal-dark: #9d0c24;
  --stock: #1f7a3d;
  --warn: #9a6700;

  --shadow-card: 0 1px 2px rgba(22, 25, 29, 0.06);
  --shadow-lift: 0 6px 20px rgba(22, 25, 29, 0.1);

  --step: 0.25rem;
  --radius: 3px;

  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Alus ──────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .h-display {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem); }
h2 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem); }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--signal); }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Silt: väike, jäme, harvendatud. Kasutatakse rubriigina, mitte kaunistusena. */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ── Signatuur: joonlaua skaala ────────────────────────────────────── */
/* Esineb ainult kahes kohas — lehe pealkirja all ja tootelehel hinna all.
 * Kodeerib seda, et pood käib mõõtude ümber. Rohkem kordusi teeks temast
 * mustri ja kaotaks mõtte. */

.rule-scale {
  height: 9px;
  border-top: 1.5px solid var(--ink);
  background-image: repeating-linear-gradient(
    to right,
    var(--ink) 0 1px,
    transparent 1px 8px
  );
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: top left;
  opacity: 0.85;
}

.rule-scale--signal {
  border-top-color: var(--signal);
  background-image: repeating-linear-gradient(
    to right,
    var(--signal) 0 1px,
    transparent 1px 8px
  );
}

/* ── Päis ──────────────────────────────────────────────────────────── */
/* Mobiil esimesena: kaks rida (bränd + korv, siis otsing + kategooriad),
 * lauaarvutis üks rida. 13 peakategooriat ritta ei mahu, seega ripploend. */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.header-bar {
  display: grid;
  grid-template-areas:
    "brand cart"
    "search search"
    "cats cats";
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.brand-mark { grid-area: brand; }
.header-search { grid-area: search; }
.cat-menu { grid-area: cats; }
.cart-pill { grid-area: cart; justify-self: end; }

@media (min-width: 768px) {
  .header-bar {
    grid-template-areas: "brand cats search cart";
    grid-template-columns: auto auto 1fr auto;
    gap: 0.85rem;
  }
}

.brand-mark {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-mark:hover { color: var(--ink); }
.brand-mark span { color: var(--signal); }

.header-search input {
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  font-size: 16px;               /* alla 16px zoomib iOS vormi avades */
  width: 100%;
  min-height: 44px;              /* puutesihiku miinimum */
}
.header-search input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 25, 29, 0.08);
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.cart-pill:hover { border-color: var(--ink); color: var(--ink); }
.cart-pill .count {
  background: var(--signal);
  color: #fff;
  border-radius: 2px;
  padding: 0 0.35rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* ── Kategooriate ripploend ────────────────────────────────────────── */

.cat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.cat-toggle:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
@media (min-width: 768px) { .cat-toggle { width: auto; } }

.cat-toggle__icon { display: inline-flex; flex-direction: column; gap: 3px; }
.cat-toggle__icon span {
  display: block;
  width: 15px;
  height: 2px;
  background: currentColor;
}

.cat-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1rem;
  margin-top: 0.4rem;
  /* Mobiilis peaaegu ekraanilaiune ja keritav, mitte ekraanist välja. */
  width: calc(100vw - 1.5rem);
  max-width: 100%;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
  .cat-panel { width: min(92vw, 860px); max-width: 92vw; }
}

.cat-columns { columns: 1; column-gap: 1.75rem; }
@media (min-width: 576px) { .cat-columns { columns: 2; } }
@media (min-width: 992px) { .cat-columns { columns: 3; } }

.cat-column {
  break-inside: avoid;
  margin-bottom: 1rem;
}
.cat-top {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 0.3rem;
}
.cat-top:hover { color: var(--signal); }

.cat-subs { list-style: none; margin: 0; padding: 0; }
.cat-subs a {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding: 0.32rem 0;     /* puutesihik ~30px, loendis piisav */
  line-height: 1.3;
}
.cat-subs a:hover { color: var(--signal); }
.cat-more { color: var(--steel) !important; font-size: 0.8rem !important; }

/* ── Avalehe kangelane: otsing on toode ────────────────────────────── */

.hero {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  padding: clamp(2rem, 1rem + 5vw, 4rem) 0;
}

.hero-title {
  font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  max-width: 16ch;
}

.hero-search {
  display: flex;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.hero-search input {
  flex: 1;
  border: 0;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  min-width: 0;
}
.hero-search input:focus { outline: none; }
.hero-search:focus-within { box-shadow: 0 0 0 4px rgba(22, 25, 29, 0.1); }
.hero-search button {
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 0 1.4rem;
  white-space: nowrap;
}
.hero-search button:hover { background: var(--signal); }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--steel);
}
.hero-facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.hero-examples { margin-top: 0.6rem; font-size: 0.85rem; color: var(--steel); }
.hero-examples a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-bottom: 1px dotted var(--rule);
}
.hero-examples a:hover { color: var(--signal); border-bottom-color: var(--signal); }

/* ── Tootekaart ────────────────────────────────────────────────────── */
/* Kõik kaardid on ühekõrgused ja pildikast on alati ruut.
 *
 * Miks pilt on absoluutselt positsioneeritud: `aspect-ratio: 1` üksi ei pea,
 * sest `max-height: 100%` pildil viitab vanema kõrgusele, mis omakorda
 * tuleneb sisust — ringtee, mille tulemusena kõrge pilt venitab kasti.
 * Absoluutne pilt on paigutusest lahti ja kast jääb ruuduks.
 *
 * Miks tekstiosal on fikseeritud kõrgus: pealkirjad on 1–3 rida ja bränd
 * puudub osal toodetest. Ilma reserveeritud kõrguseta hüppab hinnarida
 * kaardilt kaardile ja võre näeb katki välja. */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.product-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.product-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.product-card .thumb {
  position: relative;
  aspect-ratio: 1;
  flex: none;
  background: #fff;
  border-bottom: 1px solid var(--rule-soft);
}
.product-card .thumb img {
  position: absolute;
  inset: 0.7rem;
  width: calc(100% - 1.4rem);
  height: calc(100% - 1.4rem);
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}

.product-card .body {
  padding: 0.55rem 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Bränd: alati üks rida, ka kui bränd puudub — muidu nihkub kõik allpool. */
.product-card .brand {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--steel);
  line-height: 1.3;
  height: 1.3em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Pealkiri: täpselt kaks rida. Kolm rida tegi kaardid liiga kõrgeks ja
 * pikad nimed nagu "K2 tapis tekstiilipuhastusvaht 600 ml/AE" ei mahtunud
 * niikuinii täies pikkuses ära. */
.product-card .title {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.32;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.64em;
  margin: 0.15rem 0 0;
}

.product-card .foot {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.price {
  font-weight: 700;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.price-lg { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1; }
.price-sm { font-size: 1rem; }

.stock {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.stock::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ── Filtrid ───────────────────────────────────────────────────────── */

.filter-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
}
.filter-group + .filter-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
}
.filter-group h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.55rem;
}
.filter-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.filter-list a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.15rem 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.filter-list a:hover { color: var(--signal); }
.filter-list a.active { color: var(--signal); font-weight: 600; }
.filter-list a.active::after { content: "×"; font-weight: 700; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.12rem 0.6rem;
  font-size: 0.8rem;
  background: var(--card);
}
.chip:hover { border-color: var(--signal); color: var(--signal); }

/* ── Tootelehe spetsifikatsioon ────────────────────────────────────── */

.gallery-main {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 58px;
  height: 58px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
  cursor: pointer;
}
.gallery-thumbs button[aria-current="true"] { border-color: var(--ink); border-width: 2px; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }

/* Spetsitabel: mõõt ja kood on siin peategelased, seega mono ja tabular. */
.spec-table { width: 100%; font-size: 0.88rem; }
.spec-table th {
  text-align: left;
  font-weight: 500;
  color: var(--steel);
  padding: 0.4rem 1rem 0.4rem 0;
  white-space: nowrap;
  width: 1%;
  vertical-align: top;
}
.spec-table td {
  padding: 0.4rem 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink);
  word-break: break-word;
}
.spec-table tr + tr th,
.spec-table tr + tr td { border-top: 1px solid var(--rule-soft); }

.buy-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.btn-buy {
  background: var(--signal);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  width: 100%;
}
.btn-buy:hover { background: var(--signal-dark); color: #fff; }
.btn-buy:disabled { background: var(--steel); cursor: not-allowed; }

.qty {
  display: inline-flex;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty button {
  border: 0;
  background: var(--paper);
  width: 34px;
  font-weight: 700;
  color: var(--ink);
}
.qty button:hover { background: var(--rule-soft); }
.qty input {
  border: 0;
  width: 46px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.qty input:focus { outline: none; }

.notice {
  border-left: 3px solid var(--rule);
  padding: 0.5rem 0 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.notice-stock { border-left-color: var(--stock); }
.notice-warn { border-left-color: var(--warn); }

/* ── Korv ──────────────────────────────────────────────────────────── */

.cart-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 0.9rem;
  align-items: start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.cart-row .thumb-sm {
  width: 76px; height: 76px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  display: flex; align-items: center; justify-content: center; padding: 6px;
}
.cart-row .thumb-sm img { max-width: 100%; max-height: 100%; object-fit: contain; }

.summary {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; margin: 0; }
.summary dt { font-weight: 400; color: var(--steel); font-size: 0.9rem; }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.summary .total dt, .summary .total dd { font-size: 1.05rem; font-weight: 700; color: var(--ink); }

.shipping-bar {
  height: 5px;
  background: var(--rule-soft);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.shipping-bar span { display: block; height: 100%; background: var(--stock); }

/* ── Jalus ─────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--card);
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 2rem 0 1.5rem;
  font-size: 0.87rem;
  color: var(--ink-soft);
}
.site-footer h4 {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.site-footer a { color: var(--ink-soft); display: block; padding: 0.15rem 0; }
.site-footer a:hover { color: var(--signal); }

/* ── Muu ───────────────────────────────────────────────────────────── */

.breadcrumb-bar {
  font-size: 0.82rem;
  color: var(--steel);
  padding: 0.75rem 0;
}
.breadcrumb-bar a { color: var(--steel); }
.breadcrumb-bar a:hover { color: var(--signal); }

.pagination .page-link {
  color: var(--ink);
  border-color: var(--rule);
  border-radius: var(--radius) !important;
  margin: 0 2px;
  font-variant-numeric: tabular-nums;
}
.pagination .active .page-link { background: var(--ink); border-color: var(--ink); color: #fff; }

.empty-state {
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--steel);
}

.card-plain {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2rem; margin-bottom: 0.6rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose table { width: 100%; font-size: 0.9rem; margin: 1rem 0; }
.prose td, .prose th { padding: 0.35rem 0.75rem 0.35rem 0; border-bottom: 1px solid var(--rule-soft); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .product-card:hover { transform: none; }
}

@media (max-width: 575.98px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 0.6rem; }
  .cart-row { grid-template-columns: 58px 1fr; }
  .cart-row .thumb-sm { width: 58px; height: 58px; }
}

/* ── Võrdlushind ───────────────────────────────────────────────────── */
/* Läbikriipsutatud hind on ALATI märgistatud selle järgi, mis ta on:
 * tarnija soovituslik jaehind või meie enda 30 päeva madalaim hind.
 * Märgistamata "vana hind", mida pole kunagi küsitud, on eksitav reklaam. */

.price-block { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }

.price-was {
  color: var(--steel);
  font-size: 0.82rem;
  text-decoration-thickness: 1px;
  font-variant-numeric: tabular-nums;
}

.price-note {
  font-size: 0.78rem;
  color: var(--steel);
}

.save-badge {
  display: inline-block;
  background: var(--signal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

.card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
}
.product-card { position: relative; }

/* Kohatäitepilt hoiab sama ruudu, et võre ei hüppaks. */
.thumb img[src$=".svg"] { opacity: 0.9; }

/* ── Pildi suurendus ───────────────────────────────────────────────── */

.gallery-main {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: zoom-in;
}
.gallery-main > .gallery-frame {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  width: 100%;
}
.gallery-main:hover > .gallery-frame { border-color: var(--ink); }

/* Suurendusvihje. Ilma selleta ei tea keegi, et pilti saab avada. */
.zoom-hint {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.15rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--steel);
  pointer-events: none;
}
.gallery-main:hover .zoom-hint { color: var(--ink); border-color: var(--ink); }

.lightbox .modal-content {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.lightbox .modal-header,
.lightbox .modal-footer { border-color: var(--rule-soft); }

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46vh;
  padding: 1rem;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.lightbox-nav:hover { border-color: var(--ink); }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 0.6rem; }
.lightbox-next { right: 0.6rem; }

.lightbox-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--steel);
}

/* ── Personali paneel ──────────────────────────────────────────────── */
/* Nähtav ainult sisseloginud personalile. Meelega teistsuguse ilmega kui
 * pood — see ei tohi kunagi kliendi vaatega segi minna. */

.staff-panel {
  margin: 2rem 0;
  border: 1.5px dashed var(--steel);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 1rem 1.1rem 1.2rem;
}

.staff-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.staff-badge {
  display: inline-block;
  background: var(--steel);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 2px;
}
.staff-badge--muted { background: var(--rule); color: var(--ink-soft); }

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
}
.staff-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}
.staff-card--wide { grid-column: 1 / -1; }
.staff-card h3 {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.5rem;
}

.staff-table { width: 100%; font-size: 0.8rem; }
.staff-table th {
  text-align: left;
  font-weight: 400;
  color: var(--steel);
  padding: 0.16rem 0.7rem 0.16rem 0;
  white-space: nowrap;
}
.staff-table td {
  padding: 0.16rem 0.5rem 0.16rem 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.staff-table td.muted { color: var(--steel); font-family: var(--font-ui); }
.staff-table thead th { font-weight: 600; color: var(--ink); }
.staff-table--rows tr + tr td { border-top: 1px solid var(--rule-soft); }
.staff-total th, .staff-total td {
  border-top: 1.5px solid var(--ink);
  padding-top: 0.3rem;
  font-weight: 700;
  color: var(--ink);
}

.staff-note { font-size: 0.76rem; color: var(--steel); margin: 0.5rem 0 0; }
.staff-flag {
  font-size: 0.76rem;
  margin: 0.5rem 0 0;
  padding: 0.35rem 0.5rem;
  border-radius: 2px;
  background: #fdf6e3;
  color: var(--warn);
  font-weight: 600;
}
.staff-stale { color: var(--warn); font-weight: 700; }
.staff-better { color: var(--stock); }
.staff-worse { color: var(--signal); }
.staff-unconfirmed { opacity: 0.55; }
.staff-won th, .staff-won td { color: var(--ink); font-weight: 600; }
.staff-flag--ok { background: #eef7f0; color: var(--stock); }

/* ── Telefonisõbralikkus üle poe ───────────────────────────────────── */
/* Reeglid, mis peavad kehtima kõikjal, mitte komponendi kaupa. */

@media (max-width: 767.98px) {
  /* Vormiväli alla 16px paneb iOS-i lehe sisse zoomima. */
  input, select, textarea { font-size: 16px !important; }

  /* Puutesihik: nupud ja lingid loenditest peavad olema haaratavad. */
  .btn, .btn-buy, .qty button, .lightbox-nav, .cart-pill, .cat-toggle {
    min-height: 44px;
  }
  .qty button { width: 44px; }
  .qty input { width: 56px; }

  /* Tootelehe ostukast tuleb sisu järele, mitte ei kuku alla ekraani. */
  .buy-box { padding: 0.9rem; }

  /* Pildimodaal võtab mobiilis kogu ekraani — servad raiskavad ruumi. */
  .lightbox .modal-dialog { margin: 0.4rem; }
  .lightbox-stage { min-height: 40vh; padding: 0.5rem; }
  .lightbox-stage img { max-height: 62vh; }
  .lightbox-nav { width: 38px; height: 38px; }

  /* Personali paneel: veerud üksteise alla, tabelid keritavad. */
  .staff-grid { grid-template-columns: 1fr; }
  .staff-card--wide { grid-column: auto; }
  .staff-card { overflow-x: auto; }
  .staff-table { min-width: 0; }
  .staff-table--rows { min-width: 460px; }

  /* Spetsitabel ei tohi lehte horisontaalselt kerima panna. */
  .spec-table { display: block; overflow-x: auto; }

  /* Filtripaneel kokkuvolditult ei tohi kogu ekraani täita. */
  .filter-list { max-height: 210px; }
}

/* Lai sisu kerib omaenda kastis, mitte ei lükka lehte laiaks. */
.prose table { display: block; overflow-x: auto; }
img { max-width: 100%; height: auto; }

/* ── Reklaamipesa (avalehe karussell) ──────────────────────────────── */
/* Näeb meelega välja nagu vaateaken, mitte nagu tootekaart — see koht
 * on mõeldud müügiks ja peab tunduma väärtuslikuna. */

.promo {
  background: var(--card);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0 1.75rem;
}

.promo-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.promo-title { font-size: 1.15rem; margin: 0; }
.promo-sub { font-size: 0.88rem; color: var(--steel); margin: 0.15rem 0 0; }

/* Tasuline paigutus peab olema tarbijale äratuntav. */
.promo-ad-label {
  display: inline-block;
  border: 1px solid var(--steel);
  border-radius: 2px;
  padding: 0 0.35rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.3rem;
}
.promo-sponsor { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }

.promo-carousel { position: relative; }

.promo-slide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.25rem 0 2.25rem;   /* ruum punktidele */
}
@media (min-width: 768px) {
  .promo-slide {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 2rem;
    padding: 0.25rem 3rem 2.25rem;  /* ruum nooltele */
  }
}

.promo-slide__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.promo-slide__media img {
  position: absolute;
  inset: 0.9rem;
  width: calc(100% - 1.8rem);
  height: calc(100% - 1.8rem);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.promo-slide__body { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }

.promo-slide__title {
  font-size: clamp(1.05rem, 0.9rem + 0.9vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-slide__prices { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }

.promo-cta {
  align-self: flex-start;
  margin-top: 0.35rem;
  background: var(--signal);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.promo-slide:hover .promo-cta { background: var(--signal-dark); }

.promo-nav {
  width: 2.5rem;
  opacity: 1;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}
.promo-nav:hover { color: var(--signal); }
/* Mobiilis nooled ära — seal pühitakse. */
@media (max-width: 767.98px) { .promo-nav { display: none; } }

.promo-dots { margin-bottom: 0; }
.promo-dots button {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50%;
  background: var(--rule) !important;
  border: 0 !important;
  opacity: 1 !important;
  margin: 0 4px !important;
}
.promo-dots .active { background: var(--signal) !important; }

@media (prefers-reduced-motion: reduce) {
  .promo-carousel .carousel-item { transition: none !important; }
}

/* ── Personali kiirnupp ────────────────────────────────────────────── */
/* Nähtav ainult sisseloginud personalile. Fikseeritud, sest seda vajad
 * suvalisel lehel — ja üleval paremal, kus ta kliendi vaadet ei sega. */

.staff-fab {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-bottom-left-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(22, 25, 29, 0.25);
}
.staff-fab:hover { background: var(--signal); color: #fff; }
.staff-fab__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex: none;
}

/* Mobiilis alla paremale — üleval on päis ja sealt segaks. */
@media (max-width: 767.98px) {
  .staff-fab {
    top: auto;
    bottom: 0.75rem;
    right: 0.75rem;
    border-radius: 100px;
    padding: 0.5rem 0.85rem;
    min-height: 40px;
  }
}
