/*
 * Silent Heroes — Archive (kategoria produktów) page
 * Layout: sidebar filtry + grid produktów
 */

.sh-archive-page {
  background: var(--sh-offwhite);
  padding: 32px 24px 80px;
  min-height: calc(100vh - 200px);
}
.sh-archive-page-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.sh-archive-grid-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* ===== SIDEBAR ===== */
.sh-archive-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 100px;
}
.sh-archive-card {
  background: #fff;
  border: 1px solid #E0DDD8;
  border-radius: 8px;
  padding: 18px;
}

/* Search */
.sh-archive-search {
  position: relative;
}
.sh-archive-search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid #E0DDD8;
  border-radius: 6px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--sh-ink);
}
.sh-archive-search-input::placeholder { color: var(--sh-gray-400); }
.sh-archive-search-input:focus { outline: none; border-color: var(--sh-red); }
.sh-archive-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--sh-gray-400);
  display: flex;
}
.sh-archive-search-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.sh-archive-filter-title {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sh-black);
  margin: 0 0 14px;
}

/* Category list */
.sh-archive-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sh-archive-cat-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--sh-ink);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.sh-archive-cat-list li a:hover {
  background: #F5F3EE;
  color: var(--sh-black);
}
.sh-archive-cat-list li a .sh-archive-cat-count {
  font-size: 12px;
  color: var(--sh-gray-400);
  font-weight: 400;
}
.sh-archive-cat-list li.is-active > a {
  background: var(--sh-red);
  color: #fff;
}
.sh-archive-cat-list li.is-active > a .sh-archive-cat-count {
  color: rgba(255, 255, 255, 0.8);
}

/* === TREE: nested categories (always expanded) === */
.sh-archive-cat-list li + li,
.sh-archive-cat-children li + li { margin-top: 0 !important; }

.sh-archive-cat-children {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--sh-border, #e0ddd8);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sh-archive-cat-list .sh-archive-cat-children li a {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--sh-muted, #6b6b6b);
}
.sh-archive-cat-list .sh-archive-cat-children li a:hover {
  background: rgba(0,0,0,0.03);
  color: var(--sh-black);
}
.sh-archive-cat-list .sh-archive-cat-children li.is-active > a {
  background: var(--sh-red);
  color: #fff !important;
}
.sh-archive-cat-list .sh-archive-cat-children li.is-active .sh-archive-cat-count {
  color: rgba(255,255,255,0.85) !important;
}
.sh-archive-cat-list .sh-archive-cat-children .sh-archive-cat-count {
  font-size: 11px;
}
/* Głębsze poziomy — mniejszy text */
.sh-archive-cat-list .sh-archive-cat-children .sh-archive-cat-children li a {
  font-size: 12px;
}

/* Price slider */
.sh-archive-price-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--sh-muted);
  margin-bottom: 10px;
}
.sh-archive-price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #E0DDD8;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.sh-archive-price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--sh-red);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.sh-archive-price-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--sh-red);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
}

/* Price filled track */
.sh-archive-price-track-wrap {
  position: relative;
  margin-top: 6px;
}
.sh-archive-price-fill {
  position: absolute;
  height: 4px;
  background: var(--sh-red);
  border-radius: 2px;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
}

/* Checkbox list */
.sh-archive-checkbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sh-archive-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--sh-ink);
  cursor: pointer;
  padding: 4px 0;
}
.sh-archive-checkbox-list input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #d0cec8;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.sh-archive-checkbox-list input[type="checkbox"]:checked {
  background: var(--sh-red);
  border-color: var(--sh-red);
}
.sh-archive-checkbox-list input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== TOOLBAR (sortowanie + view toggle) ===== */
.sh-archive-main {
  min-width: 0; /* fix grid overflow */
}

/* ===== TYTUŁ ARCHIWUM (H1) ===== */
.sh-archive-head {
  margin-bottom: 20px;
}
.sh-archive-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sh-black);
  margin: 0;
  line-height: 1.15;
}
.sh-archive-desc {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--sh-muted);
  max-width: 70ch;
}
.sh-archive-desc p:last-child { margin-bottom: 0; }
.sh-archive-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}
.sh-archive-count {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--sh-muted);
}
.sh-archive-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sh-archive-sort {
  padding: 8px 32px 8px 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") right 12px center no-repeat;
  border: 1px solid #E0DDD8;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--sh-ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-width: 160px;
}
.sh-archive-sort option { font-size: 13px; font-family: 'Poppins', sans-serif; }
.sh-archive-sort:focus { outline: none; border-color: var(--sh-red); }
.sh-archive-view-toggle {
  display: inline-flex;
  border: 1px solid #E0DDD8;
  border-radius: 4px;
  overflow: hidden;
}
.sh-archive-view-btn {
  width: 36px;
  height: 36px;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sh-gray-400);
  transition: background .15s ease, color .15s ease;
}
.sh-archive-view-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.sh-archive-view-btn.is-active {
  background: var(--sh-red);
  color: #fff;
}
.sh-archive-view-btn:not(.is-active):hover { color: var(--sh-black); }

/* ===== GRID ===== */
.sh-archive-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1240px) { .sh-archive-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .sh-archive-products { grid-template-columns: 1fr; } }

/* ===== LIST VIEW (1 col, horizontal cards) ===== */
.sh-archive-products.is-list {
  grid-template-columns: 1fr;
  gap: 14px;
}
.sh-archive-products.is-list .sh-product-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: stretch;
}
.sh-archive-products.is-list .sh-product-thumb {
  aspect-ratio: 1;
  height: 100%;
  min-height: 180px;
}
.sh-archive-products.is-list .sh-product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px 16px 0;
  gap: 8px;
}
.sh-archive-products.is-list .sh-product-name {
  font-size: 18px;
  margin: 0;
}
.sh-archive-products.is-list .sh-product-price-row {
  margin: 4px 0 8px;
}
.sh-archive-products.is-list .sh-product-cta {
  align-self: flex-start;
  width: auto;
  min-width: 200px;
}
@media (max-width: 600px) {
  .sh-archive-products.is-list .sh-product-card {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sh-archive-products.is-list .sh-product-thumb { min-height: 200px; }
  .sh-archive-products.is-list .sh-product-info { padding: 16px; }
  .sh-archive-products.is-list .sh-product-cta { width: 100%; }
}

/* Disabled CTA — Brak na magazynie */
.sh-product-cta.is-disabled,
.sh-product-cta:disabled {
  background: #fff;
  color: var(--sh-muted);
  border: 1px solid #E0DDD8;
  cursor: not-allowed;
  pointer-events: none;
}
.sh-product-cta.is-disabled:hover,
.sh-product-cta:disabled:hover { background: #fff; }

/* "Brak na magazynie" overlay badge na thumb */
.sh-product-thumb-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--sh-black);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  z-index: 2;
  line-height: 1;
}

/* === Hide #sh-archive-count na mobile === */
@media (max-width: 900px) {
  #sh-archive-count { display: none; }
}

/* === Mobile filter button (hidden on desktop, shown in toolbar on mobile) === */
.sh-archive-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--sh-black, #111);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.sh-archive-filter-btn svg { width: 18px; height: 18px; }
.sh-archive-sidebar-close { display: none; }
.sh-archive-sidebar-backdrop { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sh-archive-grid-layout { grid-template-columns: 1fr; }
  .sh-archive-title { font-size: 24px; }
  .sh-archive-filter-btn { display: inline-flex; }
  .sh-archive-view-toggle { display: none; }
  .sh-archive-toolbar { flex-wrap: wrap; gap: 12px; align-items: center; }
  .sh-archive-toolbar .sh-archive-filter-btn { order: 1; }
  .sh-archive-toolbar-right { order: 2; margin-left: auto; }
  .sh-archive-sort,
  .sh-archive-sort option { font-size: 13px; }

  /* Sidebar staje się full-screen off-canvas */
  .sh-archive-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(360px, 90vw);
    z-index: 9999;
    background: #fff;
    overflow-y: auto;
    padding: 60px 20px 24px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sh-archive-sidebar.is-open { transform: translateX(0); }

  .sh-archive-sidebar-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: 0;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--sh-black, #111);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
  }
  .sh-archive-sidebar-close svg { width: 18px; height: 18px; }

  /* Backdrop overlay */
  .sh-archive-sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
  }
  .sh-archive-sidebar-backdrop[hidden] { display: none; }
}

/* ===== FILTER FORM EXTRAS ===== */
.sh-archive-price-current {
  font-weight: 700;
  color: var(--sh-red);
}
.sh-archive-filter-clear {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sh-red);
  text-decoration: none;
  border: 1px solid var(--sh-red);
  border-radius: 4px;
  transition: all .15s;
}
.sh-archive-filter-clear:hover {
  background: var(--sh-red);
  color: #fff;
}
