/* Shop listing: grid, cards, facet sidebar, pager. */
.shop-wrap { padding-top: 24px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.shop-head h1 { margin: 0; }

/* active-filter chips, left-aligned between the title and the count/sort tools */
.active-filters { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.af-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 12px;
  background: #E6F6F9; border: 1px solid #b8e2ea; border-radius: 999px;
  font-size: .86em; font-weight: 600; color: var(--navy); text-decoration: none; }
.af-chip b { font-weight: 400; font-size: 1.15em; line-height: 1; color: #009FBF; }
.af-chip:hover { background: #d4eff5; }
.af-chip:hover b { color: #c0392b; }
.af-chip .fswatch { width: 13px; height: 13px; }
.af-clear { font-size: .86em; white-space: nowrap; }
.shop-filter-btn .fcount { background: #009FBF; color: #fff; border-radius: 999px; font-size: .78em;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; margin-left: 6px; }
/* count is a .shop-head child (phones pair it with the h1); margin-left:auto keeps
   it beside the tools on desktop instead of floating mid-row */
.shop-count { margin-left: auto; }
.shop-tools { display: flex; align-items: center; gap: 14px; }
.shop-sort select { width: auto; padding: .4em 1.8em .4em .7em; }
.shop-filter-btn { display: none; }

.shop-cols { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }

.facets { position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 14px; background: #fff;
  scrollbar-width: thin; scrollbar-color: #009FBF transparent; }
.facets::-webkit-scrollbar { width: 8px; }
.facets::-webkit-scrollbar-thumb { background: #009FBF; border-radius: 999px; }
.facets::-webkit-scrollbar-track { background: transparent; }
.facets-head { display: none; }
.facet-clear { display: block; font-size: .88em; margin: 8px 0 2px; }
.facet { border-bottom: 1px solid var(--line); padding: 4px 0; }
.facet:last-of-type { border-bottom: 0; }
.facet summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 8px 0; font-size: .95em;
  list-style: none; display: flex; align-items: center; justify-content: space-between; }
.facet summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.facet[open] summary::after { content: "–"; }
/* summary is space-between (name … +/-), which parked the count in the middle;
   margin-right:auto hugs it to the name and leaves the +/- at the far edge */
.facet-n { background: var(--teal); color: #fff; border-radius: 999px; font-size: .72em;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  margin-left: 7px; margin-right: auto; }
.facet-vals { padding: 2px 0 10px; }
/* Firefox draws an overlay scrollbar ON TOP of the row content (Chrome puts
   it in its own gutter), covering the product counts at the right edge —
   reserve space for it and brand-colour the thumb in both engines. */
.facet-scroll { max-height: 230px; overflow-y: auto; padding-right: 10px;
  scrollbar-width: thin; scrollbar-color: #009FBF transparent; }
.facet-scroll::-webkit-scrollbar { width: 8px; }
.facet-scroll::-webkit-scrollbar-thumb { background: #009FBF; border-radius: 999px; }
.facet-scroll::-webkit-scrollbar-track { background: transparent; }
.facet-val { display: flex; align-items: center; gap: 8px; padding: 3.5px 0; font-weight: 400; font-size: .92em; cursor: pointer; }
.facet-val input { accent-color: var(--teal); width: 15px; height: 15px; flex: none; }
.facet-val span { flex: 1; }
.facet-val em { font-style: normal; color: var(--muted); font-size: .85em; }
.fswatch { width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1px solid rgba(15, 40, 70, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }

/* cards */
.pgrid { display: grid; gap: 22px; }
.pgrid-3 { grid-template-columns: repeat(3, 1fr); }
.pgrid-4 { grid-template-columns: repeat(4, 1fr); }
.pcard { display: flex; flex-direction: column; gap: 3px; color: inherit; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; background: #fff; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { text-decoration: none; border-color: var(--teal); box-shadow: var(--shadow); }
.pcard-img { position: relative; aspect-ratio: 1; background: #fff; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
/* direct children only — the badge <img>s live in .pcard-badges inside this box
   and must not inherit the fill-the-card sizing */
.pcard-img > img { width: 100%; height: 100%; object-fit: contain; transition: opacity .18s ease; }
/* Cross-fade to the second shot on hover. Both are object-fit:contain, so unless
   the first is faded out too it stays visible around a differently-proportioned
   second image. Gated on .pcard-swap (present only when a second image exists)
   and on pointer:fine, so a tap never leaves a phone stuck on the alternate. */
.pcard-img2 { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .pcard-swap:hover .pcard-img2 { opacity: 1; }
  .pcard-swap:hover .pcard-img > img:not(.pcard-img2) { opacity: 0; }
}
.pcard-ph { color: var(--line); }
.pcard-ph .ico { width: 3em; height: 3em; }
.pcard-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pcard-brand { font-size: .78em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pcard-name { font-weight: 600; color: var(--navy); font-size: .95em; line-height: 1.3; }
/* swatches left, price right, on one row */
.pcard-meta { margin-top: auto; padding-top: 6px; font-size: .95em; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-sw { display: flex; align-items: center; gap: 3px; min-width: 0; }
.pcard-sw .sw-dot { width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 1px solid rgba(0,0,0,.18); display: inline-block; }
.pcard-more { font-size: .78em; color: var(--muted); white-space: nowrap; margin-left: 2px; }
.pcard-more-sm { display: none; }          /* phone-sized count, see the query below */
.pcard-price { margin-left: auto; white-space: nowrap; }

/* pager */
.pager { display: flex; gap: 6px; justify-content: center; margin: 30px 0 10px; flex-wrap: wrap; }
.pager a { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--navy); font-weight: 600; }
.pager a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager a:hover { text-decoration: none; border-color: var(--teal); }
.pg-dots { align-self: center; color: var(--muted); }

@media (max-width: 1000px) {
  .pgrid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .shop-cols { grid-template-columns: 1fr; }
  .shop-filter-btn { display: inline-flex; }

  /* head stacks: title row -> swipeable chips strip -> count/filter/sort row.
     Applied filters follow the mobile e-commerce standard: ONE horizontally
     scrollable line of removable chips (never a tall stack), "clear all"
     pinned first, scrollbar hidden, right-edge fade as the swipe hint, and
     an applied-count badge on the Filtri button so state stays visible. */
  /* title and product count share the first row: title left, count hard right.
     The count follows the chips in the DOM (which desktop needs), so reorder it
     ahead of them here or the full-width chip strip pushes it to a third row. */
  .shop-head h1 { order: 1; flex: 1 1 auto; font-size: 1.45rem; }
  .shop-count { order: 2; flex: none; margin-left: auto; }
  .active-filters { order: 3; }
  .shop-tools { order: 4; }
  .sort-lbl { display: none; }               /* "Sortiraj:" — the options say it */
  /* one control height so the filter button and the sort select line up */
  .shop-filter-btn, .shop-sort select { height: 38px; padding-block: 0; }
  .shop-sort, .shop-sort select { width: 100%; }
  .shop-tools > .shop-filter-btn { flex: none; }
  .shop-tools > .shop-sort { flex: 1; min-width: 0; }
  .active-filters { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent); }
  .active-filters::-webkit-scrollbar { display: none; }
  .af-chip { flex: none; }
  .af-clear { order: -1; flex: none; padding: 5px 11px; border: 1px dashed #9fd4e0; border-radius: 999px; }
  .shop-tools { flex-basis: 100%; justify-content: space-between; gap: 10px; }
  .shop-tools > .muted { white-space: nowrap; }
  .facets { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); z-index: 90;
    border-radius: 0; transform: translateX(-100%); transition: transform .22s; max-height: none; top: 0; }
  .facets.open { transform: none; }
  .facets-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
  .facets-overlay { position: fixed; inset: 0; background: rgba(10,37,64,.45); z-index: 80; }
  .pgrid-3, .pgrid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pgrid-3, .pgrid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pcard { padding: 8px; }
}
/* Two-up cards get narrow here, so the swatch row drops to CARD_SWATCHES_SM
   dots and the compact "+n" — both counts are in the markup, this picks one. */
@media (max-width: 560px) {
  .pcard-meta { font-size: .88em; gap: 5px; }
  .pcard-sw { gap: 2px; }
  .pcard-sw .sw-dot { width: 11px; height: 11px; }
  /* must out-specify .pcard-sw .sw-dot, which sets display */
  .pcard-sw .sw-wide { display: none; }
  .pcard-more-sm { display: inline; }
  .pcard-more { font-size: .82em; margin-left: 1px; }
}

/* home extras */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #123a63 60%, var(--teal-dark) 130%); color: #E7EFF7; }
.hero-grid { padding: 56px 20px; }
.hero-txt h1 { color: #fff; font-size: 2.1rem; max-width: 620px; }
.hero-txt p { max-width: 560px; font-size: 1.05em; }
.hero-cta { display: flex; gap: 12px; margin: 20px 0 26px; flex-wrap: wrap; }
.hero-usp { list-style: none; display: flex; gap: 26px; padding: 0; margin: 0; flex-wrap: wrap; font-size: .93em; }
.hero-usp li { display: flex; align-items: center; gap: 8px; }
.sect { margin-top: 44px; }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.sect-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.sect-sale { background: var(--sale-pale); padding: 34px 0 40px; }
.sale-ico { height: 30px; width: auto; display: inline-block; }
.cat-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-tile { border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; color: var(--navy); font-weight: 600; background: #fff; }
.cat-tile:hover { border-color: var(--teal); background: var(--teal-pale); text-decoration: none; }
.brand-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.brand-row a { color: var(--muted); font-weight: 600; }
.brand-row a:hover { color: var(--teal-dark); }
.shop-brand-logo { height: 34px; width: auto; vertical-align: -6px; margin-right: 8px; }
.brand-row img { height: 26px; width: auto; max-width: 120px; opacity: .8; }
.brand-row a:hover img { opacity: 1; }

/* pinned-page facet values rendered as page links (category/brand pages) */
a.facet-link { color: inherit; text-decoration: none; }
a.facet-link:hover span { color: var(--teal-dark); text-decoration: underline; }
a.facet-link .cat-ico { flex: none; }
