/* ─── Catalog Hero ───────────────────────────────────────── */

.catalog-hero {
  background: #F4FAF8;
  color: #0A2E22;
  padding: 4rem 2rem 3.5rem;
  text-align: center;
}

.catalog-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.catalog-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0A2E22;
  margin-bottom: 0.75rem;
}

.catalog-hero-sub {
  font-size: 1.05rem;
  color: #4A6655;
}

/* ─── Page-active nav state ──────────────────────────────── */

.nav-links a.page-active {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

/* ─── Catalog Layout ─────────────────────────────────────── */

.catalog-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  min-height: 60vh;
}

/* ─── Filter Sidebar ─────────────────────────────────────── */

.filter-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  max-height: calc(100vh - var(--nav-height) - 3rem);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #C8E6D5;
  display: flex;
  flex-direction: column;
}

.filter-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}

.filter-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0D7A45;
}

.filter-close {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: rgba(10, 46, 34, 0.45);
  transition: color 0.2s;
}

.filter-close:hover {
  color: var(--primary);
}

.filter-body {
  padding: 0.5rem 1.5rem 0;
  flex: 1;
  overflow-y: auto;
}

.filter-group {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(10, 46, 34, 0.07);
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(10, 46, 34, 0.42);
  margin-bottom: 0.75rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: rgba(10, 46, 34, 0.72);
  user-select: none;
  transition: color 0.15s;
}

.filter-option:hover {
  color: var(--primary);
}

.filter-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(10, 46, 34, 0.28);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  background: #fff;
  position: relative;
  transition: background-color 0.15s, border-color 0.15s;
}

.filter-cb:checked {
  background-color: #0D7A45;
  border-color: #0D7A45;
}

.filter-cb:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1.5px;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* PCR toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-row-label {
  font-size: 0.875rem;
  color: rgba(10, 46, 34, 0.72);
  user-select: none;
}

.toggle-switch {
  position: relative;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 40px;
  height: 22px;
  background-color: #d1d5db;
  border-radius: 11px;
  position: relative;
  transition: background-color 0.22s;
}

.toggle-switch input:checked ~ .toggle-track {
  background-color: #0D7A45;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

.filter-foot {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(10, 46, 34, 0.07);
  margin-top: auto;
}

.filter-clear-btn {
  width: 100%;
  background: none;
  border: 1.5px solid rgba(10, 46, 34, 0.18);
  border-radius: 5px;
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10, 46, 34, 0.55);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.filter-clear-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile backdrop */
.filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 499;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.filter-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Catalog Main ───────────────────────────────────────── */

.catalog-main {
  flex: 1;
  min-width: 0;
}

/* ─── Top Bar ────────────────────────────────────────────── */

.catalog-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  color: rgba(10, 46, 34, 0.38);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 0.72rem 1rem 0.72rem 2.6rem;
  background: #fff;
  border: 1.5px solid rgba(10, 46, 34, 0.14);
  border-radius: 7px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input::placeholder {
  color: rgba(10, 46, 34, 0.3);
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 46, 34, 0.08);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.result-count {
  font-size: 0.82rem;
  color: rgba(10, 46, 34, 0.48);
  white-space: nowrap;
}

.filter-open-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: #0D7A45;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.filter-open-btn:hover {
  background-color: #0B6438;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #fff;
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

/* ─── Product Grid ───────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ─── Product Card ───────────────────────────────────────── */

.product-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(10, 46, 34, 0.1);
  border-top: 3px solid transparent;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-top-color 0.22s, box-shadow 0.22s, transform 0.22s;
}

.product-card:hover {
  border-top-color: #0D7A45;
  box-shadow: 0 8px 32px rgba(10, 46, 34, 0.12);
  transform: translateY(-3px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  line-height: 1.25;
}

.card-badges {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-pcr {
  background-color: #d1fae5;
  color: #065f46;
}

.card-type {
  font-size: 0.8rem;
  color: rgba(10, 46, 34, 0.42);
  font-weight: 500;
  margin-top: -0.25rem;
}

.card-desc {
  font-size: 0.875rem;
  color: rgba(10, 46, 34, 0.65);
  line-height: 1.65;
  flex: 1;
}

.card-props {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.prop-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(10, 46, 34, 0.05);
  border-radius: 4px;
  padding: 0.3rem 0.65rem;
  font-size: 0.73rem;
  color: rgba(10, 46, 34, 0.7);
}

.prop-key {
  font-weight: 700;
  color: var(--primary);
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(10, 46, 34, 0.07);
}

.btn-card {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-details {
  background-color: #0D7A45;
  color: #fff;
  border: 1.5px solid #0D7A45;
}

.btn-details:hover {
  background-color: #0B6438;
  border-color: #0B6438;
}

.btn-tds {
  display: inline-block;
  background: #fff;
  color: #0D7A45;
  border: 1px solid #0D7A45;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-tds:hover {
  background: #0D7A45;
  color: #fff;
}

/* ─── No Results ─────────────────────────────────────────── */

.no-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--primary);
}

.no-results-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.no-results-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.no-results-sub {
  font-size: 0.9rem;
  color: rgba(10, 46, 34, 0.48);
  margin-bottom: 1.75rem;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .filter-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    width: 280px;
    border-radius: 0;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    border: none;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  }

  .filter-sidebar.open {
    transform: translateX(0);
  }

  .filter-sidebar-head {
    padding-top: calc(var(--nav-height) + 0.5rem);
  }

  .filter-close {
    display: flex;
  }

  .filter-backdrop {
    display: block;
  }

  .filter-open-btn {
    display: inline-flex;
  }

  .catalog-layout {
    padding: 2rem 1.25rem 4rem;
  }
}

@media (max-width: 600px) {
  .catalog-hero {
    padding: 3rem 1.25rem 2.5rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .catalog-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    justify-content: space-between;
  }

  .search-wrap {
    min-width: unset;
  }
}
