/* ============================================================
   Fiberglass World — Category page styles
   (extends css/style.css — shares header, footer, product cards)
   ============================================================ */

/* Active category highlight (shared element states) */
.cat-tile.active span { color: var(--navy); font-weight: 700; }
.cat-tile.active { background: var(--bg); }
.subcat li a.active { color: var(--red); font-weight: 600; }

.catpage { padding: 26px 0 34px; }
.catpage-inner {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.cat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
/* The categories accordion box reuses .categories from style.css */

/* ---------- Filter box ---------- */
.filter-box {
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
}
.filter-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--ink);
}
.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 4px; }
.filter-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}

/* Price slider */
.price-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.range-wrap {
  position: relative;
  height: 26px;
  margin: 0 4px 14px;
}
.range-track {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 5px;
  transform: translateY(-50%);
  background: #d8dce3;
  border-radius: 3px;
}
.range-fill {
  position: absolute;
  height: 100%;
  background: var(--navy);
  border-radius: 3px;
}
.range-wrap input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--navy);
  box-shadow: 0 2px 5px rgba(20,27,46,.25);
  cursor: pointer;
}
.range-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--navy);
  box-shadow: 0 2px 5px rgba(20,27,46,.25);
  cursor: pointer;
}
.range-wrap input[type="range"]::-webkit-slider-runnable-track { background: none; }
.range-wrap input[type="range"]::-moz-range-track { background: none; }

.price-selected {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-value {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.price-clear {
  flex: none;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.price-clear:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Size filter */
.size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.size-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: #59606e;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: border-color .2s, color .2s, background .2s;
}
.size-btn:hover { border-color: #b9c0cc; color: var(--ink); }
.size-btn.is-active { border-color: var(--navy); color: var(--navy); background: #fff; box-shadow: inset 0 0 0 1px var(--navy); }

/* Przycisk „Filtruj" (storefront — bez klas adminowych) */
.filter-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.filter-submit:hover { background: #11182b; }
.filter-submit:active { transform: scale(.98); }

/* ---------- Bestseller ---------- */
.bestseller {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bestseller-head {
  background: #1f8ff0;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 12px;
}
.bestseller-card {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.bestseller-card:hover { box-shadow: none !important; }

/* ---------- Main column ---------- */
.cat-main { min-width: 0; }
.catalog-title { font-size: 26px; font-weight: 800; color: var(--ink); margin: 4px 0 16px; line-height: 1.2; }
@media (max-width: 560px) { .catalog-title { font-size: 22px; } }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); transition: color .2s; }
.breadcrumb a:hover { color: var(--navy); }
.crumb-home { display: inline-flex; }
.crumb-sep { color: var(--muted-2); }
.crumb-current { color: var(--ink); font-weight: 600; }

.cat-banner {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.cat-banner img { width: 100%; height: auto; display: block; }

/* Toolbar */
.cat-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 14px 26px;
  margin-bottom: 22px;
}
.toolbar-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: #51596a;
}
.toolbar-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7385;
  flex: none;
}
.dd-compact .dd-toggle { height: 40px; min-width: 74px; }
.dd-sort .dd-toggle { height: 40px; min-width: 180px; justify-content: space-between; }

/* Product grid — 3 columns on the category page */
.cat-main .product-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Pagination */
.cat-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pag-count { font-size: 13px; color: var(--muted); }
.pag-count strong { color: var(--ink); }
.pag-nav { display: flex; gap: 8px; }
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.pag-btn:hover { border-color: var(--navy); color: var(--navy); }
.pag-btn.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pag-prev, .pag-next { color: var(--muted); font-size: 18px; }
.pag-gap { display: inline-flex; align-items: flex-end; padding: 0 2px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .catpage-inner { grid-template-columns: 1fr; }
  .cat-main { order: 1; }
  .cat-sidebar { order: 2; }
  /* avoid duplicating the top icon bar */
  .cat-sidebar .categories { display: none; }
  .cat-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .cat-main .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-toolbar { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .cat-sidebar { grid-template-columns: 1fr; }

  /* Toolbar: drop the text labels and stack the selects full width */
  .cat-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .toolbar-label { display: none; }
  .toolbar-field { width: 100%; gap: 10px; }
  .toolbar-field .dd { width: 100%; }
  .dd-compact .dd-toggle,
  .dd-sort .dd-toggle {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .cat-main .product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
