/* =========================================================
   PRODUCT FILTERS
   Shared presentation for the desktop filter rail and mobile drawer.
   ========================================================= */

.catalog-filter-rail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-white);
  box-shadow: 0 12px 30px rgba(7, 31, 54, .08);
}

.catalog-filter-rail__header {
  position: relative;
  padding: 18px 18px 19px;
  overflow: hidden;
  border-bottom: 3px solid var(--brand-cyan);
  background:
    radial-gradient(circle at 92% 12%, rgba(0, 200, 255, .2), transparent 38%),
    linear-gradient(135deg, var(--brand-navy), #084a6c 125%);
  color: var(--surface-white);
}

.catalog-filter-rail__header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, transparent 0 72%, rgba(255, 255, 255, .06) 72% 72.5%, transparent 72.5%);
}

.catalog-filter-rail__header > * {
  position: relative;
  z-index: 1;
}

.catalog-filter-rail__eyebrow {
  margin: 0 0 7px;
  color: var(--brand-cyan);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.catalog-filter-rail__title {
  margin: 0;
  color: var(--surface-white);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
}

.catalog-filter-rail__help {
  max-width: 230px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, .74);
  font-size: .77rem;
  line-height: 1.45;
}

.filters.modern {
  --filter-border: var(--border-subtle);
  --filter-soft: var(--surface-blue-soft);
  --filter-count: #71808f;

  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--filter-border);
  border-radius: 10px;
  background: var(--surface-white);
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(7, 31, 54, .07);
}

.filters-panel-masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background:
    linear-gradient(90deg, transparent 0 76%, rgba(255, 255, 255, .08) 76% 76.4%, transparent 76.4%),
    linear-gradient(0deg, transparent 0 66%, rgba(255, 255, 255, .06) 66% 66.5%, transparent 66.5%);
}

.filters-panel-masthead > * {
  position: relative;
  z-index: 1;
}

.filters-panel-eyebrow {
  margin: 0 0 8px;
  color: var(--brand-cyan);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.25;
  text-transform: uppercase;
}

.filters-panel-help {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: .78rem;
  line-height: 1.45;
}

.filters.modern .filter-box {
  margin: 0;
  padding: 17px 0;
  border-top: 1px solid var(--filter-border);
}

.filters.modern .filter-box:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.filters.modern .filter-box:last-child {
  padding-bottom: 0;
}

.filters.modern .filter-header {
  display: flex;
  align-items: center;
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--brand-navy);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.filters.modern .filter-header::before {
  content: "";
  width: 3px;
  height: 15px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand-cyan);
}

.filters.modern .filter-list {
  display: grid;
  row-gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filters.modern .filter-list li {
  margin: 0;
}

.filters.modern .filter-list label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 34px;
  align-items: start;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: .86rem;
  line-height: 1.3;
  cursor: pointer;
  transition: color 130ms ease, background-color 130ms ease, border-color 130ms ease;
}

.filters.modern .filter-list label:hover {
  background: #f2f7fb;
}

.filters.modern .filter-list label:has(input:checked) {
  border-color: rgba(0, 120, 184, .22);
  background: var(--filter-soft);
  color: var(--brand-navy);
}

.filters.modern .filter-list input[type="checkbox"] {
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1px solid #9aa9b6;
  border-radius: 4px;
  background: var(--surface-white);
  cursor: pointer;
}

.filters.modern .filter-list input[type="checkbox"]:checked {
  border-color: var(--brand-blue);
  background: var(--brand-blue)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13' fill='none'%3E%3Cpath d='M3 6.6 5.2 8.8 10 4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 13px 13px no-repeat;
}

.filters.modern .filter-list input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(0, 120, 184, .2);
  outline-offset: 2px;
}

.filters.modern .cat-count {
  justify-self: end;
  color: var(--filter-count);
  font-size: .82rem;
  font-weight: 500;
}

.filters.modern .toggle-btn {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-top: 6px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  cursor: pointer;
}

.filters.modern .toggle-btn:hover,
.filters.modern .toggle-btn:focus-visible {
  color: var(--brand-blue-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.filters.modern .hidden {
  display: none;
}

@media (min-width: 1001px) {
  .catalog-filter-rail .filters.modern {
    width: 100%;
    max-height: calc(100vh - 239px);
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: var(--surface-white);
    box-shadow: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #c0d1dc transparent;
    scrollbar-width: thin;
  }

  .catalog-filter-rail .filters.modern::-webkit-scrollbar {
    width: 6px;
  }

  .catalog-filter-rail .filters.modern::-webkit-scrollbar-track {
    background: transparent;
  }

  .catalog-filter-rail .filters.modern::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c0d1dc;
  }

  .catalog-filter-rail .filters.modern:hover {
    scrollbar-color: #839cac transparent;
  }

  .catalog-filter-rail .filters.modern:hover::-webkit-scrollbar-thumb {
    background: #839cac;
  }
}

@media (max-width: 1000px) {
  .catalog-filter-rail {
    display: none;
  }
}

/* =========================================================
   MOBILE FILTER DRAWER
   The existing JavaScript moves the desktop aside into this shell.
   ========================================================= */

.filters-panel-shell {
  padding: 0 18px 24px;
  background: var(--surface-page);
  color: var(--text-primary);
}

.filters-panel-masthead {
  position: relative;
  margin: 0 -18px 16px;
  padding: 18px 76px 19px 18px;
  overflow: hidden;
  border-bottom: 3px solid var(--brand-cyan);
  background:
    radial-gradient(circle at 82% 22%, rgba(0, 200, 255, .18), transparent 34%),
    linear-gradient(112deg, var(--brand-navy) 0%, #093654 62%, var(--brand-blue-dark) 135%);
  color: var(--surface-white);
}

.filters-panel-title {
  margin: 0;
  color: var(--surface-white);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.filters-panel-title::after {
  content: none;
}

.active-filters-wrapper {
  display: none;
  margin: 0 0 12px;
}

.active-filters-wrapper.show {
  display: block;
}

.active-filters-help {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: .82rem;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
}

.active-filters .chip {
  appearance: none;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 120, 184, .25);
  border-radius: 999px;
  background: var(--surface-blue-soft);
  color: var(--brand-navy);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.active-filters .chip:hover,
.active-filters .chip:focus-visible {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: var(--surface-white);
}

.active-filters .chip .x {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
}

.active-filters .chip.clear-all {
  background: var(--surface-white);
  color: var(--brand-blue-dark);
}

#filters-slider-wrapper .filters.modern {
  width: 100%;
  padding-top: 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(7, 31, 54, .07);
}

#cartSlider .filters.in-slider {
  display: block !important;
  width: 100%;
}

@media (max-width: 480px) {
  .filters-panel-shell {
    padding: 0 14px 22px;
  }

  .filters-panel-masthead {
    margin: 0 -14px 14px;
    padding: 16px 72px 17px 14px;
  }

  .filters.modern {
    padding: 12px;
  }
}
