/* ============================================================
   eterniit.com — Category / Listing page additions
   Layered on top of styles.css
   ============================================================ */

/* ---------------- Hero band ---------------- */
.cat-hero {
  background: #f5f4f2;
  border-bottom: 1px solid var(--line);
}
.cat-hero .container {
  min-height: 120px;
  padding-top: var(--s-5);
  padding-bottom: var(--s-5);
  display: flex;
  align-items: center;
}
.cat-hero h1 {
  font-size: 32px;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.cat-hero p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  max-width: 62ch;
  line-height: 1.55;
}
.result-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.result-chip b { color: var(--ink); font-weight: 600; }
.result-chip .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--save); }

@media (max-width: 640px) {
  .cat-hero .container { min-height: 90px; grid-template-columns: 1fr; gap: var(--s-3); }
  .cat-hero h1 { font-size: 24px; }
  .result-chip { justify-self: flex-start; }
}

/* ---------------- Sub-category row ---------------- */
.subcat-row-wrap {
  /* longhand top/bottom only — keep .container's horizontal padding intact */
  position: relative;
  padding-top: var(--s-5);
  padding-bottom: var(--s-3);
}
.subcat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-bottom: 4px;
}
.subcat {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.subcat:hover { border-color: var(--line-strong); text-decoration: none; }
.subcat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.subcat.active .subcat-count { color: rgba(255,255,255,0.7); }
.subcat-thumb {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.subcat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.subcat.active .subcat-thumb { border-color: rgba(255,255,255,0.3); }
.subcat-label { font-weight: 600; color: inherit; }
.subcat-count { color: var(--muted); font-size: 12px; }

/* ---------------- Sticky filter + sort bar ---------------- */
.fsb {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.fsb-inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 0;
  flex-wrap: wrap;
}
.fsb-active {
  display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0;
  align-items: center;
}
.fsb-active .pl {
  color: var(--muted); font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.chip-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
}
.chip-tag button,
.chip-tag a {
  border: 0; background: transparent;
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 12px;
  padding: 0;
  text-decoration: none;
  transition: background 0.12s;
}
.chip-tag button:hover,
.chip-tag a:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); text-decoration: none; }
.chip-clear {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  padding: 0 6px;
}
.chip-clear:hover { color: var(--sale); text-decoration-color: currentColor; }

.fsb-right { display: flex; align-items: center; gap: var(--s-2); }
.fsb-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-2);
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.fsb-btn:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.fsb-btn .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  padding: 0 5px;
}
.fsb-mobile-only { display: none; }
@media (max-width: 1024px) { .fsb-mobile-only { display: inline-flex; } }

/* Mobile: drop "Sorteeri:" prefix to save horizontal space — show only the active value. */
@media (max-width: 640px) {
  .sort summary .sort-prefix { display: none; }
  .sort summary b#sortLabel  { max-width: none; }
  .fsb-inner { gap: var(--s-2); }
  .fsb-active .pl { font-size: 12px; }
}

.sort {
  position: relative;
}
.sort summary {
  list-style: none;
  cursor: pointer;
  height: 36px;
  padding: 0 36px 0 12px;
  border-radius: var(--r-2);
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex; align-items: center;
  position: relative;
  white-space: nowrap;
  max-width: 100%;
}
.sort summary b#sortLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}
.sort summary::-webkit-details-marker { display: none; }
.sort summary::after {
  content: "";
  position: absolute; right: 12px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s;
}
.sort[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.sort summary:hover { background: var(--bg-soft); }
.sort-menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--sh-2);
  padding: 4px;
  min-width: 220px;
  z-index: 5;
}
.sort-menu a,
.sort-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: var(--r-1);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.sort-menu a:hover,
.sort-menu button:hover { background: var(--bg-soft); text-decoration: none; }
.sort-menu a.active,
.sort-menu button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.view-toggle {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: #fff;
  height: 36px;
}
.view-toggle button {
  width: 36px; height: 100%;
  background: transparent; border: 0;
  color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.view-toggle button:hover { background: var(--bg-soft); color: var(--ink); }
.view-toggle button.active { background: var(--ink); color: #fff; }
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button.active + button,
.view-toggle button + button.active { border-left-color: var(--ink); }

/* ---------------- Main panel layout ---------------- */
.cat-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-7);
  padding: var(--s-6) 0 var(--s-7);
  align-items: start;
}
@media (max-width: 1024px) {
  .cat-main { grid-template-columns: 1fr; gap: var(--s-5); }
  .sidebar { display: none; }
}

/* ---------------- Sidebar accordions ---------------- */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 58px);
  align-self: start;
  font-size: 14px;
}
.acc {
  border-bottom: 1px solid var(--line);
  padding: var(--s-3) 0;
}
.acc:first-child { padding-top: var(--s-2); }
.acc-head {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 0;
  font-size: 14px;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head::after {
  content: "";
  width: 9px; height: 9px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-right: 4px;
}
.acc[open] .acc-head::after { transform: rotate(-135deg); margin-bottom: 4px; }
.acc-head .pill {
  font-size: 11px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  margin-left: 8px;
}
.acc-body {
  padding-top: var(--s-3);
  display: flex; flex-direction: column;
  gap: 8px;
}

/* Color swatch grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.color-sw {
  position: relative;
  aspect-ratio: 1;
  border: 1.5px solid var(--line);
  border-radius: var(--r-1);
  background: var(--sw, #ddd);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  display: block;
  text-decoration: none;
}
.color-sw:hover { transform: scale(1.08); text-decoration: none; }
.color-sw.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.color-sw .tip {
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--r-1);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
  z-index: 5;
}
.color-sw:hover .tip { opacity: 1; }

/* Checkbox row */
.check-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 3px 0;
}
.check-row input { display: none; }
.check-row .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.check-row:hover .box { border-color: var(--accent); }
.check-row input:checked + .box {
  background: var(--accent); border-color: var(--accent);
}
.check-row input:checked + .box::after {
  content: "";
  position: absolute;
  left: 4px; top: 0;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-row .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.check-row .lbl { flex: 1; min-width: 0; }

/* Radio row (same look as check-row but circular) */
.radio-row .box { border-radius: 999px; }
.radio-row input:checked + .box::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #fff;
  transform: none;
  border: 0;
}

/* Price range slider */
.range {
  position: relative;
  height: 24px;
  margin: 8px 4px 6px;
}
.range .track {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  transform: translateY(-50%);
}
.range .fill {
  position: absolute;
  top: 50%;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
}
.range input[type="range"] {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  height: 24px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  margin: 0;
}
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: auto;
  cursor: grab;
}
.range input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
.range input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: auto;
}
.range-inputs {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.range-inputs input {
  width: 100%;
  height: 32px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-2);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}
.range-inputs span { color: var(--muted); font-size: 13px; }
.range-apply {
  margin-top: 8px;
  width: 100%;
  height: 32px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--r-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.range-apply:hover { background: var(--accent); }

.reset-btn {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 13px;
  padding: var(--s-4) 0 var(--s-2);
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}
.reset-btn:hover { color: var(--sale); text-decoration-color: currentColor; }

/* ---------------- Product grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 1280px) and (min-width: 1025px) { .grid { gap: var(--s-4); } }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
/* Keep 2 columns even on small phones — cards designed paired, not solo. */
@media (max-width: 480px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); } }

/* Card */
.pcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  isolation: isolate;             /* own stacking context for the overlay */
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
}
.pcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(20,24,30,0.07), 0 2px 4px rgba(20,24,30,0.04);
}

/* Whole-card click is wired by category.js (see "Pcard whole-card click"). */
.pcard-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-soft);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.pcard-img .img-a,
.pcard-img .img-b {
  position: absolute; inset: 0;
  transition: opacity 0.35s ease;
}
.pcard-img .img-a img,
.pcard-img .img-b img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-img .img-b { opacity: 0; }
.pcard:hover .pcard-img .img-b { opacity: 1; }
.pcard:hover .pcard-img .img-a { opacity: 0; }
.pcard-img .photo-ph {
  position: absolute; inset: 0;
  background: var(--ph-bg, var(--bg-soft));
}

.pcard-badges {
  position: absolute;
  top: 10px; left: 0;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 2;
}
.pbadge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 9px 4px 11px;
  border-radius: 0 4px 4px 0;
  color: #fff;
  background: var(--sale);
}
.pbadge.new { background: var(--accent); }

.pcard-quick {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s, color 0.15s;
  z-index: 2;
}
.pcard:hover .pcard-quick { opacity: 1; transform: translateY(0); }
.pcard-quick:hover { background: var(--ink); color: #fff; }

.pcard-body {
  padding: var(--s-3) var(--s-4) var(--s-4);
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.pcard-brand {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.pcard-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.pcard-name a { color: inherit; }
.pcard-name a:hover { color: var(--accent); text-decoration: none; }
.pcard-sku {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pcard-swatches {
  display: flex; align-items: center; gap: 5px;
  margin-top: 2px;
}
.pcard-swatches a,
.pcard-swatches button {
  width: 16px; height: 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--sw, #ddd);
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  display: inline-block;
  position: relative;
  z-index: 2;
}
.pcard-swatches a:hover,
.pcard-swatches button:hover { transform: scale(1.15); }
.pcard-swatches a.active,
.pcard-swatches button.active { border-color: var(--ink); }
.pcard-swatches .more {
  background: transparent;
  border: 0;
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
  height: 16px;
  width: auto;
}

.pcard-price {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.pcard-price .now {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.pcard-price .now.sale { color: var(--sale); }
.pcard-price .was {
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
}
.pcard-price .unit {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.pcard-action {
  margin-top: var(--s-3);
  height: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  position: relative;
  z-index: 2;
}
.pcard-action:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
  text-decoration: none;
}
.pcard-action.variant { background: #fff; }
.pcard-action.variant:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Stock dot */
.pcard-stock {
  font-size: 11.5px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3);
}
.pcard-stock .d { width: 6px; height: 6px; border-radius: 999px; background: var(--save); }
.pcard-stock.low .d { background: var(--warn); }
.pcard-stock.low { color: var(--warn); }
.pcard-stock.oos .d { background: var(--muted); }
.pcard-stock.oos { color: var(--muted); }

/* List view */
.grid.list-view { grid-template-columns: 1fr; gap: var(--s-3); }
.grid.list-view .pcard {
  flex-direction: row;
  align-items: stretch;
}
.grid.list-view .pcard-img {
  width: 160px; flex-shrink: 0;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}
.grid.list-view .pcard-body {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
}
.grid.list-view .pcard-info {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1; min-width: 0;
}
.grid.list-view .pcard-name { -webkit-line-clamp: 1; min-height: 0; }
.grid.list-view .pcard-swatches { margin-top: 4px; }
.grid.list-view .pcard-price {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-top: 0;
  margin: 0;
}
.grid.list-view .pcard-price .unit { margin-left: 0; }
.grid.list-view .pcard-action {
  width: 180px;
  margin-top: 0;
}
.grid.list-view .pcard-quick { display: none; }
@media (max-width: 820px) {
  .grid.list-view .pcard-img { width: 110px; }
  .grid.list-view .pcard-body { padding: var(--s-3) var(--s-4); }
  .grid.list-view .pcard-action { width: 100%; flex-basis: 100%; }
}

/* Skeleton */
.pcard.skel { pointer-events: none; }
.pcard.skel .pcard-img,
.pcard.skel .pcard-name,
.pcard.skel .pcard-sku,
.pcard.skel .pcard-price .now,
.pcard.skel .pcard-action {
  background: linear-gradient(90deg, var(--bg-soft), #f0f1f3, var(--bg-soft));
  background-size: 200% 100%;
  animation: skel 1.3s ease-in-out infinite;
  color: transparent !important;
  border-radius: var(--r-1);
  border: 0;
}
.pcard.skel .pcard-img { aspect-ratio: 1; }
.pcard.skel .pcard-name { height: 18px; min-height: 18px; }
.pcard.skel .pcard-sku { height: 10px; width: 40%; }
.pcard.skel .pcard-price .now { width: 50%; height: 22px; }
.pcard.skel .pcard-brand { background: var(--bg-soft); height: 10px; width: 30%; color: transparent; }
.pcard.skel .pcard-action { height: 38px; }
@keyframes skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty {
  background: var(--bg-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-3);
  padding: var(--s-9) var(--s-5);
  text-align: center;
  color: var(--ink-3);
}
.empty .icon {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto var(--s-3);
  color: var(--muted);
}
.empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 auto var(--s-4); max-width: 36ch; font-size: 14px; }

/* ---------------- Pagination ---------------- */
.pagi-wrap {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  padding: var(--s-7) 0 var(--s-5);
}
.pagi {
  display: inline-flex; align-items: center; gap: 4px;
}
.pagi button, .pagi a, .pagi span.dots, .pagi span.here {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-decoration: none;
}
.pagi button:hover, .pagi a:hover {
  background: var(--bg-soft); border-color: var(--line-strong);
  text-decoration: none;
}
.pagi .here {
  background: var(--accent); color: #fff; border-color: var(--accent);
  cursor: default;
}
.pagi .here:hover { background: var(--accent); }
.pagi .dots {
  min-width: 28px; height: 36px;
  border: 0;
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.pagi .nav-btn { padding: 0 14px; gap: 6px; }

.pagi-meta {
  display: flex; align-items: center; gap: var(--s-4);
  font-size: 13px;
  color: var(--ink-3);
}
.pagi-meta select {
  height: 28px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-1);
  padding: 0 24px 0 8px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%235b626c' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.pagi-mobile { display: none; }
@media (max-width: 640px) {
  .pagi-desktop { display: none; }
  .pagi-mobile { display: inline-flex; gap: var(--s-3); align-items: center; }
}

/* ---------------- SEO description ---------------- */
.seo-block {
  margin-top: var(--s-8);
  padding: var(--s-7) 0 0;
  border-top: 1px solid var(--line);
}
.seo-block h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 var(--s-4);
}
.seo-block h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: var(--s-5) 0 var(--s-2);
  color: var(--ink);
}
.seo-content {
  color: var(--ink-2);
  line-height: 1.65;
  font-size: 14px;
}
.seo-teaser p { margin: 0; }
/* When a teaser is present, hide the full body until .open is set. */
.seo-content .seo-teaser ~ .seo-full { display: none; }
.seo-content.open .seo-teaser         { display: none; }
.seo-content.open .seo-teaser ~ .seo-full { display: block; }
.seo-content p { margin: 0 0 var(--s-3); }
.seo-content ul { padding-left: 20px; margin: 0 0 var(--s-3); }
.seo-content li { margin: 4px 0; }
.seo-content a { color: var(--accent); }
.seo-content .faq {
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.seo-content .faq h3 { margin-top: 0; }
.seo-content .faq details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.seo-content .faq details:last-child { border-bottom: 0; }
.seo-content .faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.seo-content .faq summary::-webkit-details-marker { display: none; }
.seo-content .faq summary::after {
  content: "+";
  font-size: 18px;
  color: var(--ink-3);
  transition: transform 0.2s;
}
.seo-content .faq details[open] summary::after { transform: rotate(45deg); }
.seo-content .faq details p { padding-top: 8px; color: var(--ink-2); }

.seo-toggle {
  margin-top: var(--s-3);
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0;
}
.seo-toggle:hover { color: var(--accent-2); text-decoration: underline; }

/* ---------------- Mobile filter drawer ---------------- */
.scrim {
  position: fixed; inset: 0;
  background: rgba(15, 18, 22, 0.45);
  z-index: 80;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.scrim.visible { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 85vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}
.drawer.visible { transform: translateY(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-head h3 { font-size: 18px; margin: 0; font-family: var(--font-display); }
.drawer-close {
  width: 34px; height: 34px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
}
.drawer-body {
  padding: var(--s-3) var(--s-5);
  overflow-y: auto;
  flex: 1;
}
.drawer-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.drawer-foot .btn { width: 100%; }
/* In drawer, show the sidebar contents */
.drawer .sidebar { display: block; position: static; top: auto; }
