/* Pivot topánok – MD MODA. Svetlý, čistý vzhľad; fotky sú hlavná vec. */
:root {
  --accent: #163a5f;          /* modrá MDmoda.sk */
  --accent-svetla: #e4ecf4;
  --cta: #f8a102;             /* oranžová MDmoda.sk */
  --pozadie: #fafaf8;
  --panel: #ffffff;
  --text: #23262a;
  --text-2: #6b7077;
  --ciara: #e7e6e2;
  --zelena: #2e8b57;
  --oranzova: #e08a1e;
  --seda: #c9cbcf;
  --tien: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --panel-sirka: 288px;
  --dotyk: 44px;              /* minimálna veľkosť dotykového cieľa */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--pozadie); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

#app { display: flex; height: 100%; }

/* ---------- Ľavý panel s fazetami ---------- */
#fazety {
  width: var(--panel-sirka); flex: 0 0 var(--panel-sirka);
  background: var(--panel); border-right: 1px solid var(--ciara);
  display: flex; flex-direction: column; min-height: 0;
}
.fazety-hlava { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.logo { font-weight: 700; letter-spacing: .2px; font-size: 17px; }
.logo::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
#fazety-obsah { overflow-y: auto; flex: 1; padding: 0 8px 24px; overscroll-behavior: contain; }

.fazeta { border-bottom: 1px solid var(--ciara); }
.fazeta-hlava {
  width: 100%; min-height: var(--dotyk); display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0 8px; text-align: left; font-weight: 600; font-size: 14px;
}
.fazeta-hlava .sipka { margin-left: auto; color: var(--text-2); transition: transform .2s ease-out; }
.fazeta.zbalena .sipka { transform: rotate(-90deg); }
.fazeta.zbalena .fazeta-telo { display: none; }
.fazeta-hlava .aktivne-pocet { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.fazeta-telo { padding: 0 4px 10px; }

.hodnota {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--dotyk);
  background: none; border: 0; border-radius: 8px; padding: 0 8px; text-align: left; font-size: 14px;
}
.hodnota:active { background: #f2f2ef; }
.hodnota .box {
  width: 22px; height: 22px; border: 2px solid #b9bcc1; border-radius: 6px; flex: none;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.hodnota.zvolena .box { background: var(--accent); border-color: var(--accent); }
.hodnota.zvolena .box::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }
.hodnota .pocet, .chip-pocet { margin-left: auto; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.nula { opacity: .38; }

/* veľkosti – mriežka tlačidiel */
.velkosti { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; padding: 2px 4px; }
.velkost {
  min-height: 40px; min-width: 0; padding: 3px 0; border: 1px solid var(--ciara); background: #fff; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-weight: 600; font-size: 15px;
}
.velkost small { font-size: 10px; font-weight: 400; color: var(--text-2); }
.velkost.zvolena { background: var(--accent); border-color: var(--accent); color: #fff; }
.velkost.zvolena small { color: rgba(255,255,255,.8); }

/* farby – bodky */
.farby { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 2px 4px; }
.farba {
  min-height: 60px; border: 0; background: none; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-2);
}
.farba .bodka { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: box-shadow .15s; }
.farba.zvolena .bodka { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.farba.zvolena { color: var(--text); font-weight: 600; }

/* cena – dvojitý posuvník s histogramom */
.cena { padding: 4px 10px 8px; }
.histogram { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.histogram span { flex: 1; background: var(--accent-svetla); border-radius: 2px 2px 0 0; min-height: 1px; transition: height .4s ease-out, background .2s; }
.histogram span.v { background: var(--accent); opacity: .55; }
.dvojity { position: relative; height: var(--dotyk); }
.dvojity .draha { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--ciara); border-radius: 2px; }
.dvojity .rozsah { position: absolute; top: 50%; height: 4px; margin-top: -2px; background: var(--accent); border-radius: 2px; }
.dvojity input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dvojity input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: var(--tien); cursor: grab; }
.dvojity input::-moz-range-thumb { pointer-events: auto; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: grab; }
.dvojity input::-webkit-slider-runnable-track { background: none; }
.cena-popis { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cena-popis b { color: var(--text); font-weight: 600; }

/* ---------- Hlavná časť ---------- */
#hlavna { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#lista { background: var(--panel); border-bottom: 1px solid var(--ciara); padding: 8px 12px; z-index: 5; }
.lista-riadok { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cipy-riadok { margin-top: 8px; }

#hladanie { position: relative; flex: 1 1 220px; min-width: 180px; }
#hladat {
  width: 100%; height: var(--dotyk); border: 1px solid var(--ciara); border-radius: 22px; padding: 0 16px 0 40px; background: #f6f6f3
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7077' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 14px center;
  outline: none; font-size: 15px;
}
#hladat:focus { border-color: var(--accent); background-color: #fff; }
#naseptavac {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: #fff;
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.14); z-index: 30; max-height: 60vh; overflow-y: auto;
}
#naseptavac li { min-height: var(--dotyk); display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
#naseptavac li.vybrany, #naseptavac li:active { background: var(--accent-svetla); }
#naseptavac li img { width: 36px; height: 36px; object-fit: contain; flex: none; }
#naseptavac li .druh { margin-left: auto; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
#naseptavac li .kod { color: var(--text-2); font-size: 12px; }
#naseptavac mark { background: none; color: var(--accent); font-weight: 700; }

#pocet { font-size: 14px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
#pocet b { color: var(--text); font-size: 17px; }

.prepinac { display: flex; background: #f0f0ec; border-radius: 22px; padding: 3px; }
.prepinac button { min-height: 38px; min-width: 84px; border: 0; background: none; border-radius: 19px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: background .2s, color .2s; }
.prepinac button.aktivny { background: #fff; color: var(--text); box-shadow: var(--tien); }

.vyber-skupina { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.vyber-skupina select { height: var(--dotyk); border: 1px solid var(--ciara); border-radius: 10px; background: #fff; padding: 0 8px; font-size: 14px; color: var(--text); }
#skupina-wrap[hidden] { display: none; }

.zoom { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.zoom input { width: 130px; height: var(--dotyk); accent-color: var(--accent); }
.zoom-ikona.mala { font-size: 10px; } .zoom-ikona.velka { font-size: 18px; }

#cipy { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.cip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 18px;
  background: var(--accent-svetla); color: var(--accent); font-size: 13px; font-weight: 600; border: 0;
}
.cip .x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.cip:active .x { background: rgba(0,0,0,.06); }
.cip .cip-fazeta { font-weight: 400; opacity: .8; }
.btn-text { background: none; border: 0; color: var(--accent); font-weight: 600; min-height: var(--dotyk); padding: 0 10px; font-size: 14px; }
.btn { min-height: var(--dotyk); border: 1px solid var(--ciara); background: #fff; border-radius: 10px; padding: 0 14px; font-weight: 600; }
.ikona-btn { width: var(--dotyk); height: var(--dotyk); border: 0; background: none; border-radius: 50%; font-size: 22px; line-height: 1; display: grid; place-items: center; }
.ikona-btn:active { background: #f0f0ec; }
.ikona-btn:disabled { opacity: .25; }

/* ---------- Plocha s dlaždicami ---------- */
#plocha { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#platno { position: absolute; left: 0; top: 0; pointer-events: none; }
#scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
#vyska { width: 1px; }
#prazdne { position: absolute; left: 0; right: 0; top: 30%; text-align: center; color: var(--text-2); font-size: 16px; }
#fps { position: absolute; right: 18px; bottom: 10px; font: 12px/1.4 ui-monospace, Consolas, monospace; background: rgba(0,0,0,.65); color: #fff; padding: 3px 8px; border-radius: 6px; pointer-events: none; }

/* ---------- Detail ---------- */
#detail-clona { position: fixed; inset: 0; background: rgba(30,32,36,.18); opacity: 0; pointer-events: none; transition: opacity .3s ease-out; z-index: 40; }
#detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 41;
  box-shadow: -12px 0 40px rgba(0,0,0,.12); transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; touch-action: pan-y;
}
body.detail-otvoreny #detail { transform: none; }
body.detail-otvoreny #detail-clona { opacity: 1; pointer-events: auto; }
.detail-hlava { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--ciara); }
.detail-hlava .medzera { flex: 1; }
#det-poradie { font-size: 13px; color: var(--text-2); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
#detail-obsah { overflow-y: auto; flex: 1; padding: 0 20px 28px; overscroll-behavior: contain; }
.det-foto { aspect-ratio: 4/3; display: grid; place-items: center; background: #fff; margin: 8px -20px 0; }
.det-foto img { max-width: 92%; max-height: 100%; object-fit: contain; }
.det-galeria { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.det-galeria button { width: 64px; height: 64px; flex: none; border: 2px solid var(--ciara); border-radius: 10px; background: #fff; padding: 2px; }
.det-galeria button.aktivny { border-color: var(--accent); }
.det-galeria img { width: 100%; height: 100%; object-fit: contain; }
.det-vyrobca { color: var(--text-2); font-size: 13px; text-transform: uppercase; letter-spacing: .6px; margin-top: 10px; }
.det-nazov { font-size: 24px; font-weight: 700; margin: 2px 0 6px; line-height: 1.2; }
.det-cena { font-size: 24px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.det-stitky { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.stitok { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; background: #f0f0ec; color: var(--text-2); }
.stitok.zel { background: #e5f3ea; color: var(--zelena); }
.stitok.ora { background: #fbeedc; color: #b56a0c; }
.stitok.acc { background: var(--accent-svetla); color: var(--accent); }
.det-nadpis { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin: 18px 0 8px; }
.det-velkosti { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.det-v { border-radius: 8px; padding: 6px 0; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.15; }
.det-v small { display: block; font-size: 11px; font-weight: 500; }
.det-v.skladom { background: #e5f3ea; color: var(--zelena); }
.det-v.posledny { background: #fbeedc; color: #b56a0c; }
.det-v.nie { background: #f2f2f0; color: #a7aab0; }
.det-v.hladana { outline: 2px solid var(--accent); outline-offset: 1px; }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.det-popis { line-height: 1.55; font-size: 15px; }
.det-vlastnosti { width: 100%; border-collapse: collapse; font-size: 14px; }
.det-vlastnosti th { text-align: left; font-weight: 400; color: var(--text-2); padding: 7px 0; width: 42%; border-bottom: 1px solid var(--ciara); }
.det-vlastnosti td { padding: 7px 0; border-bottom: 1px solid var(--ciara); font-weight: 600; }
.det-vlastnosti .bodka { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ---------- Mobil: filtre vo vysúvacom paneli ---------- */
.len-mobil { display: none; }
@media (max-width: 900px) {
  .len-mobil { display: inline-flex; }
  #fazety { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-105%); transition: transform .3s ease-out; box-shadow: 12px 0 40px rgba(0,0,0,.12); width: min(320px, 88vw); }
  body.filtre-otvorene #fazety { transform: none; }
  #fazety-clona { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(30,32,36,.18); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.filtre-otvorene #fazety-clona { opacity: 1; pointer-events: auto; }
  #hladanie { order: 10; flex-basis: 100%; }
  .zoom input { width: 90px; }
  #zoradenie-wrap span { display: none; }
}
@media (max-width: 560px) {
  .zoom { display: none; }
  .prepinac button { min-width: 70px; }
}

/* ---------- MDmoda: logo, dĺžka chodidla, náhľad ---------- */
.logo { text-decoration: none; color: var(--accent); font-size: 19px; }
.logo span { color: var(--cta); }
#aktualizacia { font-size: 11px; color: var(--text-2); padding: 8px 16px 12px; border-top: 1px solid var(--ciara); }
#noha-wrap { display: flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 22px; padding: 0 6px 0 14px; min-height: var(--dotyk); }
.noha-popis { font-weight: 700; font-size: 14px; white-space: nowrap; }
#noha { width: 78px; height: 34px; border: 0; border-radius: 17px; padding: 0 10px; font-size: 16px; font-weight: 700; text-align: center; color: var(--text); outline: none; }
#noha:focus { box-shadow: 0 0 0 3px var(--cta); }
#noha.zla { box-shadow: 0 0 0 3px #e24a3b; }
.noha-cm { font-size: 14px; }
.noha-ako { color: #fff; font-size: 12px; opacity: .85; padding: 0 8px; white-space: nowrap; }
.det-cena s { color: var(--text-2); font-size: 17px; font-weight: 400; margin-left: 6px; }
.det-cena .zlava { background: #d63a2f; color: #fff; font-size: 13px; border-radius: 10px; padding: 2px 8px; vertical-align: 3px; }
.stitok.mod { background: #e3edf9; color: #1d5fae; }
.det-rada { background: var(--accent-svetla); color: var(--accent); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.det-rada.slaba { background: #f6f1e6; color: #8a5a12; }
.det-nadpis-pozn { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.det-v { border: 2px solid transparent; position: relative; font: inherit; font-weight: 700; font-size: 16px; min-height: var(--dotyk); }
.det-v em { display: block; font-style: normal; font-size: 10px; font-weight: 400; opacity: .8; }
.det-v .odp { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font-style: normal; font-size: 9px; font-weight: 700; background: var(--accent); color: #fff; padding: 1px 5px; border-radius: 6px; white-space: nowrap; }
.det-v.objednavka { background: #e3edf9; color: #1d5fae; }
.det-v.zvolena { border-color: var(--accent); box-shadow: 0 2px 8px rgba(22,58,95,.25); }
.det-v:disabled { cursor: default; }
.det-velkosti { padding-top: 8px; }
.det-kupit { display: flex; align-items: center; justify-content: center; min-height: 52px; margin: 18px 0 4px; background: var(--cta); color: #fff; font-weight: 700; font-size: 17px; border-radius: 12px; text-decoration: none; box-shadow: 0 3px 10px rgba(248,161,2,.35); }
.det-kupit:active { transform: translateY(1px); }
.legenda { flex-wrap: wrap; }
@media (max-width: 900px) {
  #noha-wrap { flex: 1 1 auto; }
  .noha-ako { display: none; }
}
@media (max-width: 560px) {
  .noha-popis { font-size: 13px; }
  #noha { width: 66px; }
}
.det-farby { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.det-farba { flex: none; width: 76px; border: 2px solid var(--ciara); border-radius: 10px; background: #fff; padding: 3px 3px 4px; font-size: 11px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.det-farba img { width: 100%; height: 52px; object-fit: contain; }
.det-farba span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det-farba.aktivna { border-color: var(--accent); color: var(--text); font-weight: 600; }
.det-farba.mimo { opacity: .45; }

/* ---- jazyky ---- */
.jazyky { display: flex; gap: 2px; margin-left: auto; margin-right: 6px; }
.jazyk { font-size: 12px; font-weight: 600; color: #6b7280; text-decoration: none; padding: 3px 6px; border-radius: 6px; }
.jazyk:hover { background: #eef2f6; }
.jazyk.aktivny { background: var(--accent); color: #fff; }

/* ---- náhľad v strede plochy ---- */
#nahlad { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 30, 45, .28); padding: 16px; }
#nahlad[hidden] { display: none; }
.nah-karta { position: relative; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.28); padding: 12px;
  cursor: pointer; transform-origin: center; display: flex; max-width: 100%; max-height: 100%; }
.nah-karta img { display: block; width: min(560px, 80vw); height: min(560px, 70vh); object-fit: contain; }
@media (max-width: 640px) {
  #nahlad { position: fixed; z-index: 50; }
  .nah-karta img { width: 86vw; height: 60vh; }
}

.nah-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 17px; cursor: pointer; color: #333; }
.nah-sip { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 26px; line-height: 1; cursor: pointer; color: #333; }
.nah-sip.vl { left: 8px; } .nah-sip.vp { right: 8px; }
.nah-body { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.nah-body i { width: 7px; height: 7px; border-radius: 50%; background: #c9ced6; }
.nah-body i.akt { background: var(--accent); }
.nah-detail { position: absolute; right: 10px; bottom: 8px; border: 0; border-radius: 8px; padding: 6px 11px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
