/* TITAN 0.3.0 · trgovina: podkategorije sa slikama, filteri (fasete) s brojevima, cijena s histogramom.
   Na mobitelu su filteri ploča preko cijelog ekrana s gumbom „Prikaži N artikala”. */

/* ---------- podkategorije sa slikama ---------- */
.subk { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 8px; margin-top: 22px; }
.subk[hidden] { display: none; }
.subk__t { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 8px 12px 8px 8px; background: #fff; border: 1px solid var(--m-line); transition: border-color .15s; }
.subk__t:hover { border-color: var(--m-ink); }
.subk__img { grid-row: 1 / 3; width: 56px; height: 56px; display: grid; place-items: center; background: var(--m-bg); overflow: hidden; }
.subk__img img { width: 50px; height: 50px; object-fit: contain; mix-blend-mode: multiply; transition: transform .4s var(--ease); }
.subk__t:hover .subk__img img { transform: scale(1.08); }
.subk__n { align-self: end; font-size: 14px; font-weight: 650; line-height: 1.25; }
.subk small { align-self: start; font-family: var(--mono); font-size: 11px; color: var(--m-mute); }
.subk__vise { min-height: 74px; border: 1px dashed var(--m-line-2); background: transparent; font-weight: 650; font-size: 14px; }
.subk__vise:hover { border-color: var(--m-ink); }

/* ---------- raspored ---------- */
.shop { grid-template-columns: 290px minmax(0, 1fr); gap: 28px; padding-top: 28px; }
.flt { display: flex; flex-direction: column; gap: 0; background: #fff; border: 1px solid var(--m-line); padding: 0; scrollbar-width: thin; top: calc(var(--hdr) + 16px); max-height: calc(100vh - var(--hdr) - 32px); }
.flt__head, .flt__foot { display: none; }
.fcs { display: grid; }

/* jedna faseta */
.fc { border-bottom: 1px solid var(--m-line); }
.fc[hidden] { display: none; }
.fc > summary { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 750; font-size: 14.5px; user-select: none; }
.fc > summary::-webkit-details-marker { display: none; }
.fc > summary::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.fc[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.fc > summary:hover { background: var(--m-bg); }
.fc__sel { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; background: var(--m-acc); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.fc__sel:empty { display: none; }
.fc__b { padding: 0 16px 14px; display: grid; gap: 1px; }

/* opcija s kvačicom */
.fo { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 36px; padding: 2px 6px; margin: 0 -6px; cursor: pointer; font-size: 14.5px; }
.fo:hover { background: var(--m-bg); }
.fo input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fo__box { width: 20px; height: 20px; border: 1.5px solid var(--m-ink-2); background: #fff; display: grid; place-items: center; transition: background .12s; }
.fo input:checked + .fo__box { background: var(--m-ink); border-color: var(--m-ink); }
.fo input[type="checkbox"]:checked + .fo__box::after { content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.fo input[type="radio"]:checked + .fo__box::after { content: ''; width: 8px; height: 8px; background: #fff; }
.fo input:focus-visible + .fo__box { outline: 2px solid var(--m-acc); outline-offset: 2px; }
.fo__t { line-height: 1.3; }
.fo input:checked ~ .fo__t { font-weight: 700; }
.fo__n { font-family: var(--mono); font-size: 11.5px; color: var(--m-mute); }
.fo.is-0 { opacity: .4; cursor: default; }
.fo.is-0:hover { background: transparent; }

/* kategorije: put gore i djeca */
.fk__trazi { position: relative; margin-bottom: 8px; }
.fk__trazi .ic { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--m-mute); }
.fk__trazi input { width: 100%; height: 38px; padding: 0 10px 0 34px; border: 1px solid var(--m-line-2); background: #fff; font-size: 14px; outline: none; border-radius: 0; }
.fk__trazi input:focus { border-color: var(--m-ink); }
.fk { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 5px 6px 5px calc(6px + var(--u, 0) * 12px); margin: 0 -6px; width: calc(100% + 12px); text-align: left; font-size: 14px; color: var(--m-ink-2); }
.fk:hover { background: var(--m-bg); color: var(--m-ink); }
.fk span { line-height: 1.3; }
.fk em { display: block; font-style: normal; font-size: 12px; color: var(--m-mute); }
.fk small { font-family: var(--mono); font-size: 11px; color: var(--m-mute); flex: none; }
.fk--up { color: var(--m-mute); font-size: 13.5px; }
.fk--up:not(.is-on) span::before { content: '‹ '; }
.fk.is-on { font-weight: 750; color: var(--m-ink); box-shadow: inset 3px 0 0 var(--m-acc); background: var(--m-bg); }
.fk__put { display: grid; }
.fk__nema { margin: 6px 0; font-size: 13.5px; color: var(--m-mute); }

/* cijena */
.cj__hist { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin: 4px 0 0; }
.cj__hist i { flex: 1; background: var(--m-line-2); min-height: 0; }
.cj__hist i.u { background: var(--m-ink-2); }
.cj__rng { position: relative; height: 28px; margin: 0 -2px; }
.cj__rng::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%);
  background: linear-gradient(90deg, var(--m-line-2) var(--lo, 0%), var(--m-ink) var(--lo, 0%), var(--m-ink) var(--hi, 100%), var(--m-line-2) var(--hi, 100%)); }
.cj__rng input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; -webkit-appearance: none; appearance: none; pointer-events: none; }
.cj__rng input::-webkit-slider-runnable-track { background: none; height: 28px; }
.cj__rng input::-moz-range-track { background: none; }
.cj__rng input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 3px; background: #fff; border: 2px solid var(--m-ink); cursor: grab; }
.cj__rng input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; background: #fff; border: 2px solid var(--m-ink); border-radius: 0; cursor: grab; }
.cj__rng input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--m-acc); outline-offset: 2px; }
.cj__rng input:focus-visible::-moz-range-thumb { outline: 2px solid var(--m-acc); outline-offset: 2px; }
.cj__in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; }
.cj__in label { position: relative; display: block; }
.cj__in label span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--m-mute); pointer-events: none; }
.cj__in input { width: 100%; height: 40px; padding: 0 22px 0 32px; border: 1px solid var(--m-line-2); background: #fff; font-family: var(--mono); font-size: 13px; outline: none; border-radius: 0; }
.cj__in input:focus { border-color: var(--m-ink); }
.cj__in i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12.5px; color: var(--m-mute); }
.cj__brzo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cj__brzo button { padding: 6px 9px; border: 1px solid var(--m-line-2); background: #fff; font-size: 12.5px; font-weight: 600; }
.cj__brzo button:hover { border-color: var(--m-ink); }
.cj__brzo button.sel { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }

/* ---------- traka iznad artikala ---------- */
.tbar { margin-bottom: 12px; }
.tbar__n { margin: 0; font-size: 15px; }
.sel-box select { border-radius: 0; height: 44px; background: #fff; border: 1px solid var(--m-line-2); color: var(--m-ink); }
.sel-box select:focus { border-color: var(--m-ink); }
.chipset { gap: 6px; margin-bottom: 16px; }
.chipset button { border-radius: 0; background: #fff; color: var(--m-ink); border: 1px solid var(--m-ink); padding: 6px 8px 6px 12px; font-size: 13px; }
.chipset button:hover { background: var(--m-ink); color: #fff; }
.chipset .chip--sve { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; padding-left: 8px; }
.chipset .chip--sve:hover { background: transparent; color: var(--m-acc); }
.nothing { border-radius: 0; border-color: var(--m-line-2); background: #fff; color: var(--m-mute); }
.nothing b { color: var(--m-ink); }
.more__bar { background: var(--m-line); border-radius: 0; }
.more__bar i { background: var(--m-ink); }
.more { color: var(--m-mute); }

/* ---------- mobitel i tablet ---------- */
@media (max-width: 960px) {
  .shop { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .subk { display: flex; overflow-x: auto; gap: 8px; margin: 18px calc(var(--gut) * -1) 0; padding: 0 var(--gut) 4px; scrollbar-width: none; }
  .subk::-webkit-scrollbar { display: none; }
  .subk__t { flex: none; width: 128px; grid-template-columns: 1fr; grid-template-rows: auto auto auto; padding: 8px; row-gap: 4px; }
  .subk__img { grid-row: auto; width: 100%; height: 76px; }
  .subk__img img { width: 66px; height: 66px; }
  .subk__n { font-size: 13px; }
  .subk__vise { flex: none; width: 128px; min-height: 0; }
  .tbar { position: sticky; top: var(--hdr); z-index: 20; margin: 0 calc(var(--gut) * -1) 12px; padding: 10px var(--gut); background: rgba(244, 244, 242, .96); border-bottom: 1px solid var(--m-line); }
  .tbar__r { flex: 1; justify-content: flex-end; }
  .flt-btn { display: inline-flex !important; border-radius: 0; height: 44px; background: var(--m-ink); color: #fff !important; border-color: var(--m-ink) !important; }
  .flt-btn b { border-radius: 0; background: var(--m-acc); }
  .flt { position: fixed; inset: 0; z-index: 110; max-height: none; border: 0; border-radius: 0; background: #fff; box-shadow: none; padding: 0; top: 0;
    transform: translateY(100%); transition: transform .35s var(--ease), visibility 0s linear .35s; visibility: hidden; }
  .flt.is-open { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
  .flt__head { display: flex; justify-content: space-between; align-items: center; padding: 10px var(--gut); border-bottom: 1px solid var(--m-line); }
  .flt__head h2 { margin: 0; font-size: 22px; font-weight: 850; outline: none; }
  .fcs { flex: 1; overflow: auto; overscroll-behavior: contain; }
  .fc > summary, .fc__b { padding-left: var(--gut); padding-right: var(--gut); }
  .fc > summary { min-height: 54px; font-size: 16px; }
  .fo { min-height: 44px; font-size: 15.5px; }
  .fk { min-height: 42px; font-size: 15px; }
  .flt__foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--m-line); background: #fff; }
  .flt__foot .btn { min-height: 50px; }
}
.crumbs [data-crumb] { display: contents; }
@media (max-width: 760px) {
  .tbar__n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbar__r { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .tbar__r .flt-btn { justify-content: center; }
  .sel-box select { width: 100%; max-width: none; }
  .sel-box select { padding: 0 34px 0 12px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .flt { transition: none !important; } }

/* na računalu podkategorije su lijevo u filteru, pa se pločice ne ponavljaju gore */
@media (min-width: 961px) { .subk { display: none !important; } }
.shop-top h1 small:empty { display: none; }
