/*
 * category.css — NorApotek
 * Styles specific to the category listing page (category.html).
 * Requires: base.css loaded first.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ══════════════════
   CATEGORY HERO
══════════════════ */
.cat-hero {
  background: linear-gradient(110deg, var(--g900) 0%, var(--g800) 60%, var(--g700) 100%);
  padding: 48px 0 52px; position: relative; overflow: hidden;
}
.cat-hero::after {
  content: '💊'; position: absolute; right: -20px; top: 50%;
  transform: translateY(-50%); font-size: 200px; opacity: .05;
  pointer-events: none; line-height: 1;
}
.cat-hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.cat-hero-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--g400); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.cat-hero-eyebrow::before { content: ''; width: 18px; height: 1.5px; background: var(--g400); }
.cat-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 4vw, 52px); font-weight: 700; color: #fff;
  line-height: 1.1; letter-spacing: -.5px; margin-bottom: 14px;
}
.cat-hero-desc { color: rgba(255,255,255,.55); font-size: 16px; max-width: 560px; line-height: 1.75; margin-bottom: 22px; }
.cat-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-tag {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.75); border-radius: 50px; padding: 5px 14px;
  font-size: 13px; font-weight: 500; text-decoration: none; transition: background .2s;
}
.cat-tag:hover { background: rgba(255,255,255,.15); }
.cat-tag.active { background: var(--g500); border-color: var(--g500); color: #fff; }
.cat-hero-stat { text-align: right; flex-shrink: 0; }
.cat-hero-stat .num {
  font-family: 'Cormorant Garamond', serif; font-size: 52px;
  font-weight: 700; color: #fff; line-height: 1;
}
.cat-hero-stat .lbl { font-size: 12px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ══════════════════
   PAGE LAYOUT
══════════════════ */
.cat-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 32px; padding: 36px 0 80px; align-items: start;
}

/* ══════════════════
   SIDEBAR FILTERS
══════════════════ */
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }

.filter-toggle {
  display: none; width: 100%; background: var(--white); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 12px 16px; font-size: 15px; font-weight: 600;
  font-family: 'Jost', sans-serif; color: var(--g800); cursor: pointer;
  text-align: left; transition: border-color .2s; margin-bottom: 4px;
}
.filter-toggle:hover { border-color: var(--g500); }
.sidebar-body { display: flex; flex-direction: column; gap: 4px; }

.filter-box { background: var(--white); border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.filter-box-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.filter-box-head h3 { font-size: 14px; font-weight: 700; color: var(--g900); }
.filter-arrow { font-size: 11px; color: var(--muted); transition: transform .2s; }
.filter-body { padding: 4px 18px 16px; border-top: 1px solid var(--border); }
.filter-body.hidden { display: none; }

.filter-option { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.filter-option input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; border: 2px solid var(--border);
  border-radius: 4px; flex-shrink: 0; cursor: pointer;
  transition: border-color .2s, background .2s; position: relative;
}
.filter-option input[type=checkbox]:checked { background: var(--g700); border-color: var(--g700); }
.filter-option input[type=checkbox]:checked::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: #fff; font-size: 10px; font-weight: 700;
}
.filter-label { font-size: 14px; color: var(--text); cursor: pointer; flex: 1; display: flex; justify-content: space-between; align-items: center; }
.filter-count { font-size: 12px; color: var(--muted); }

.price-inputs { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.price-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: 'Jost', sans-serif;
  color: var(--text); outline: none; transition: border-color .2s; min-width: 0;
}
.price-input:focus { border-color: var(--g600); }
.price-sep { color: var(--muted); font-size: 13px; flex-shrink: 0; }

.applied-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; }
.applied-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--g100); border: 1px solid var(--g400);
  color: var(--g800); border-radius: 50px; padding: 3px 10px 3px 12px;
  font-size: 12px; font-weight: 500;
}
.applied-tag button { background: none; border: none; color: var(--g600); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.clear-all {
  font-size: 12px; font-weight: 600; color: var(--red); text-decoration: none;
  padding: 0 0 12px 18px; display: block; cursor: pointer;
  background: none; border: none; font-family: 'Jost', sans-serif;
}
.clear-all:hover { text-decoration: underline; }

/* ══════════════════
   TOOLBAR
══════════════════ */
.products-area { display: flex; flex-direction: column; gap: 24px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; background: var(--white);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 18px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { font-size: 14px; color: var(--muted); }
.result-count strong { color: var(--g900); font-weight: 700; }
.sort-wrap { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sort-select {
  border: 1.5px solid var(--border); border-radius: 6px; padding: 7px 12px;
  font-size: 14px; font-family: 'Jost', sans-serif; color: var(--text);
  background: var(--white); outline: none; cursor: pointer; transition: border-color .2s;
}
.sort-select:focus { border-color: var(--g600); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 7px 10px; cursor: pointer; font-size: 16px; color: var(--muted);
  transition: background .2s, border-color .2s, color .2s;
}
.view-btn.active { background: var(--g100); border-color: var(--g500); color: var(--g700); }

/* ══════════════════
   PRODUCT GRID (3-col)
══════════════════ */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.products-grid.list-view { grid-template-columns: 1fr; }

/* list view overrides */
.products-grid.list-view .product-card { flex-direction: row; }
.products-grid.list-view .prod-img {
  width: 140px; height: auto; min-height: 140px;
  border-bottom: none; border-right: 1px solid var(--border); flex-shrink: 0; font-size: 52px;
}
.products-grid.list-view .prod-body { padding: 18px 20px; flex-direction: row; align-items: center; gap: 20px; }
.prod-info-main { display: contents; }
.products-grid.list-view .prod-info-main { display: flex; flex-direction: column; flex: 1; }
.products-grid.list-view .prod-foot {
  border-top: none; padding-top: 0;
  flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; margin-top: 0;
}

/* ══════════════════
   PAGINATION
══════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding-top: 8px; flex-wrap: wrap;
}
.page-btn {
  background: var(--white); border: 1.5px solid var(--border); border-radius: 7px;
  padding: 9px 15px; font-size: 14px; font-weight: 500; font-family: 'Jost', sans-serif;
  color: var(--text); cursor: pointer; transition: background .2s, border-color .2s, color .2s;
  min-width: 42px; text-align: center; text-decoration: none;
}
.page-btn:hover { background: var(--g50); border-color: var(--g400); }
.page-btn.active { background: var(--g700); border-color: var(--g700); color: #fff; font-weight: 700; }
.page-btn.disabled { color: var(--border); cursor: default; pointer-events: none; }
.page-ellipsis { padding: 9px 6px; color: var(--muted); font-size: 14px; }

/* ══════════════════
   SEO TEXT BLOCK
══════════════════ */
.seo-block {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 28px 32px;
}
.seo-block h2 { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 700; color: var(--g900); margin-bottom: 12px; }
.seo-block p { font-size: 14px; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }
.seo-hidden { display: none; }
.seo-read-more {
  font-size: 13px; font-weight: 600; color: var(--g600);
  background: none; border: none; cursor: pointer;
  font-family: 'Jost', sans-serif; padding: 0;
}
.seo-read-more:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   RESPONSIVE — category page
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .cat-layout { grid-template-columns: 220px 1fr; gap: 24px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .cat-hero-inner { grid-template-columns: 1fr; }
  .cat-hero-stat { display: none; }
  .cat-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .filter-toggle { display: block; }
  .sidebar-body { display: none; }
  .sidebar-body.open { display: flex; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  /* revert list view on mobile */
  .products-grid.list-view .product-card { flex-direction: column; }
  .products-grid.list-view .prod-img { width: 100%; height: 150px; border-right: none; border-bottom: 1px solid var(--border); }
  .products-grid.list-view .prod-body { flex-direction: column; align-items: flex-start; }
  .products-grid.list-view .prod-foot { border-top: 1px solid var(--border); padding-top: 12px; flex-direction: row; align-items: center; width: 100%; margin-top: 0; }
}
@media (max-width: 540px) {
  .products-grid, .products-grid.list-view { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .view-toggle { display: none; }
  .seo-block { padding: 20px; }
  .cat-hero { padding: 36px 0 40px; }
}
@media (max-width: 380px) {
  .products-grid, .products-grid.list-view { grid-template-columns: 1fr; }
}
