/* ═══════════════════════════════════════════════════════════════
   KONTURA SLOVAKIA — SMER B · STRÁNKA PRODUKTY (KATALÓG / E-SHOP)
   Rozširuje styles.css — len štýly katalógovej stránky
   ═══════════════════════════════════════════════════════════════ */

/* ── UTILITY ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── AKTÍVNA POLOŽKA NAVIGÁCIE ──────────────────────────────── */
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ── HERO-LITE — E-SHOP ─────────────────────────────────────── */
.cat-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(36px, 6vh, 68px));
  padding-bottom: clamp(30px, 4.5vh, 48px);
  border-bottom: 1px solid var(--border);
}
.cat-hero .breadcrumb { margin-bottom: clamp(12px, 2.5vh, 26px); }

.cat-hero h1 {
  font-size: clamp(2.5rem, 4.6vw + .6rem, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.cat-hero h1 em {
  font-style: normal;
  color: var(--red-hi);
  text-shadow: 0 0 40px var(--red-glow);
}

.cat-hero-sub {
  margin-top: 16px;
  max-width: 62ch;
  font-size: clamp(1rem, 1.3vw, 1.16rem);
  color: var(--text-muted);
}

.cat-hero-meta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}
.cat-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .66rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── LAYOUT — SIDEBAR + KATALÓG ─────────────────────────────── */
.section--catalog {
  padding-block: clamp(36px, 4.5vw, 60px) clamp(72px, 9vw, 110px);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: clamp(28px, 3.5vw, 52px);
  align-items: start;
}

/* ── SIDEBAR FILTER ─────────────────────────────────────────── */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.filters::-webkit-scrollbar { width: 6px; }
.filters::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.filters::-webkit-scrollbar-track { background: transparent; }

.filters-index { margin-bottom: 18px; }

.filter-toggle { display: none; }

.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px 24px;
}

.f-block + .f-block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.f-label {
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-ghost);
  margin-bottom: 12px;
}

/* — vyhľadávanie — */
.f-search { position: relative; }
.f-search .icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-ghost);
  pointer-events: none;
}
.f-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 40px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.f-search input::placeholder { color: var(--text-ghost); }
.f-search input:focus {
  outline: none;
  border-color: var(--red-hi);
  box-shadow: 0 0 0 3px rgba(225, 29, 41, .16);
}
.f-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* — prepínač s DPH / bez DPH — */
.vat-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.vat-btn {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 7px;
  min-height: 44px;
  font-size: .64rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.vat-btn:hover { color: var(--text); }
.vat-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  color: #fff;
  box-shadow: 0 6px 18px -8px var(--red-glow);
}

/* — kategórie — */
.cat-list { display: grid; }
.cat-group {
  font-size: .58rem;
  font-weight: 600;
  color: var(--text-ghost);
  letter-spacing: .16em;
  margin-top: 16px;
  margin-bottom: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.cat-item {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  text-align: left;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.cat-item:hover { background: var(--glass-bg); color: var(--text); }
.cat-item.is-active {
  background: var(--glass-bg);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--red-hi);
}
.cat-count {
  font-size: .62rem;
  font-weight: 500;
  color: var(--text-ghost);
  flex: none;
}
.cat-item.is-active .cat-count { color: var(--red-hi); }

/* — checkbox — */
.f-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.f-check input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.f-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  transition: background .2s ease, border-color .2s ease;
}
.f-box .icon {
  width: 12px; height: 12px;
  color: #fff;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s var(--ease-spring);
}
.f-check input:checked + .f-box {
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  border-color: var(--red-hi);
}
.f-check input:checked + .f-box .icon { opacity: 1; transform: none; }
.f-check input:focus-visible + .f-box {
  outline: 2px solid var(--red-hi);
  outline-offset: 2px;
}
.f-check:hover .f-box { border-color: var(--red-hi); }

/* — cena range (vizuál) — */
.f-range {
  position: relative;
  height: 4px;
  margin: 16px 8px 24px;
  background: var(--border);
  border-radius: 2px;
}
.f-range-fill {
  position: absolute;
  left: 14%; right: 18%;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--red), var(--red-hi));
  border-radius: 2px;
  box-shadow: 0 0 12px var(--red-glow);
}
.f-thumb {
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  transform: translate(-50%, -50%);
  background: var(--elevated);
  border: 2px solid var(--red-hi);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.f-price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.f-price-inputs label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color .2s ease;
}
.f-price-inputs label:focus-within { border-color: var(--red-hi); }
.f-price-inputs .mono {
  font-size: .56rem;
  font-weight: 600;
  color: var(--text-ghost);
  flex: none;
}
.f-price-inputs input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}
.f-price-inputs input:focus { outline: none; }
.f-price-inputs input::placeholder { color: var(--text-ghost); }

/* — zrušiť filtre — */
.f-reset {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s ease;
}
.f-reset:hover { color: var(--text); }
.f-reset .icon {
  width: 15px; height: 15px;
  color: var(--red-hi);
  transition: transform .3s var(--ease-spring);
}
.f-reset:hover .icon { transform: rotate(-45deg); }

/* ── KATALÓG — TOOLBAR ──────────────────────────────────────── */
.catalog-main { min-width: 0; }
.catalog-head { margin-bottom: 20px; }
.toolbar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toolbar-count {
  font-size: .64rem;
  font-weight: 500;
  color: var(--text-muted);
}
.sort {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort > .mono {
  font-size: .58rem;
  font-weight: 600;
  color: var(--text-ghost);
}
.sort select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 38px 0 14px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa4b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s ease;
}
.sort select:hover { border-color: var(--red-hi); }
.sort select:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; }

/* ── KATALÓG — GRID + KARTY ─────────────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.catalog-grid .pc-body { padding: 20px 20px 22px; }
.catalog-grid .pc-body h3 { font-size: 1.06rem; }
.catalog-grid .pc-chips { font-size: .6rem; margin-bottom: 10px; }
.catalog-grid .pc-desc {
  font-size: .86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-grid .pc-footer { padding-top: 16px; gap: 12px; }
.catalog-grid .pc-price { padding-top: 16px; }
.catalog-grid .pc-price strong { font-size: 1.45rem; }
.catalog-grid .more-card h3 { font-size: 1.3rem; }

/* — badge stavu na fotke — */
.pc-status {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: .56rem;
  font-weight: 600;
  border-radius: 999px;
  color: #2a3242;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.pc-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
}
.pc-status--ok .dot { background: #0d9a6f; box-shadow: 0 0 6px rgba(16, 185, 129, .7); }
.pc-status--order .dot { background: var(--blue); box-shadow: 0 0 6px rgba(37, 99, 235, .6); }
.pc-status--showroom .dot { background: #c69104; box-shadow: 0 0 6px rgba(234, 179, 8, .6); }
.pc-status--sale {
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 8px 18px -8px var(--red-glow);
}
.pc-status--sale .dot { background: #fff; }

/* — menšie okno pre kalkulačky — */
.pc-media--compact { aspect-ratio: 4 / 2.7; }
.pc-media--compact .pc-img--contain {
  width: 42%;
  max-height: 72%;
}
.pc-media--compact .pc-shadow {
  width: 34%;
  height: 14px;
  bottom: 11%;
}

/* — telefonická alternatíva pri kartách bez ceny — */
.pc-tel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  min-height: 36px;
  margin-top: -4px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s ease;
}
.pc-tel:hover { color: var(--text); }
.pc-tel .icon {
  width: 13px; height: 13px;
  color: var(--red-hi);
  flex: none;
}

/* ── PAGINATION (vizuál) ────────────────────────────────────── */
.pagination {
  margin-top: clamp(30px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.page-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.page-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    transform .25s var(--ease-spring),
    border-color .2s ease,
    color .2s ease;
}
.page-btn:hover:not(:disabled):not(.is-active) {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.page-btn:disabled { opacity: .35; cursor: default; }
.page-btn.is-active {
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  border-color: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: 0 10px 26px -10px var(--red-glow);
  cursor: default;
}
.page-btn .icon { width: 16px; height: 16px; }
.page-gap {
  align-self: center;
  padding: 0 4px;
  font-size: .8rem;
  color: var(--text-ghost);
}
.page-meta {
  font-size: .62rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* sidebar → collapsible panel */
  .filters {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .filters-index { display: none; }

  .filter-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  .filter-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .filter-toggle .icon { width: 18px; height: 18px; }
  .filter-toggle-label .icon { color: var(--red-hi); }
  .filter-toggle .chev-f {
    color: var(--text-muted);
    transition: transform .3s var(--ease-out);
  }
  .filter-toggle[aria-expanded="true"] .chev-f { transform: rotate(180deg); }

  .filters-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s var(--ease-out);
  }
  .filters-collapse.open { grid-template-rows: 1fr; }
  .filters-inner {
    overflow: hidden;
    min-height: 0;
    visibility: hidden; /* zatvorený panel = nefokusovateľný obsah */
    transition: visibility 0s .35s;
  }
  .filters-collapse.open .filters-inner {
    visibility: visible;
    transition-delay: 0s;
  }
  .filters-panel {
    margin-top: 12px;
    padding: 20px 18px 22px;
  }

  .catalog-head { margin-bottom: 16px; }
}

@media (max-width: 559px) {
  .catalog-grid { grid-template-columns: 1fr; }

  .cat-hero-meta { gap: 8px 18px; }

  .toolbar { padding: 12px 14px; }
  .sort { width: 100%; justify-content: space-between; }
  .sort select { flex: 1; max-width: 240px; }
}

@media (max-width: 419px) {
  .page-hide-sm { display: none; }
  .page-btn { min-width: 42px; }
}

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .filters-collapse { transition: none; }
  .filters-inner { transition: none; }
  .f-reset:hover .icon { transform: none; }
}
