/* ===== ASTRO: геометрия фильтров. Цвета — ТОЛЬКО переменные ниже. ===== */
:root {
  --ff-accent: #ef4444;
  --ff-accent-soft: rgba(239, 68, 68, 0.2);
  --ff-accent-border: rgba(239, 68, 68, 0.5);
  --ff-surface: #140a0a;
  --ff-surface-2: #1c0e0e;
  --ff-text: #ffffff;
  --ff-muted: #9ca3af;
  --ff-line: rgba(255, 255, 255, 0.1);
  --ff-pill-col: rgba(239, 68, 68, 0.22);
  --ff-pill-bd: rgba(220, 38, 38, 0.2);
  --ff-pill-md: rgba(185, 28, 28, 0.24);
  --ff-pill-sy: rgba(127, 29, 29, 0.28);
  --ff-pill-col-text: #fca5a5;
  --ff-pill-bd-text: #fecaca;
  --ff-pill-md-text: #f87171;
  --ff-pill-sy-text: #fca5a5;
}

.astro-catalog-filters,
.catalog-filters,
[data-catalog-filters],
#root .fixed.glass-light.backdrop-blur-xl,
#root .fixed.glass-light.backdrop-blur-xl.z-40,
#root .fixed.glass-light.backdrop-blur-xl .space-y-3,
#root .fixed.glass-light.backdrop-blur-xl .relative {
  overflow: visible !important;
}

/* Старая шторка FilterBar внутри sticky — прячем, живой UI в #astro-ff-root */
#root .fixed.glass-light.backdrop-blur-xl .space-y-3 > .space-y-3 {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ff-row { display: flex; align-items: center; gap: 8px; }
.ff-sort-wrap { flex: 1; position: relative; min-width: 0; }
.ff-sort-btn,
.ff-hub-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--ff-surface);
  color: var(--ff-text);
  font-size: 14px;
}
.ff-sort-btn.is-open,
.ff-hub-item.is-on {
  background: var(--ff-accent-soft);
  border-color: var(--ff-accent-border);
}
.ff-icon-btn {
  position: relative;
  flex-shrink: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--ff-surface);
  color: var(--ff-muted);
  line-height: 0;
}
.ff-icon-btn.is-on { background: var(--ff-accent); color: #fff; border-color: transparent; }
.ff-gift-img { display: block; width: 20px; height: 20px; transform: scale(1.3); pointer-events: none; }
.ff-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--ff-accent); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ff-dot {
  position: absolute; top: -4px; right: -4px;
  width: 12px; height: 12px; border-radius: 999px; background: var(--ff-accent);
}
.ff-sort-dd {
  position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 8px; z-index: 200000;
  background: var(--ff-surface);
  border: 1px solid var(--ff-line);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.ff-sort-opt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent; color: #d1d5db; font-size: 14px; text-align: left;
}
.ff-sort-opt:last-child { border-bottom: 0; }
.ff-sort-opt.is-on { background: var(--ff-accent-soft); color: #fff; }
.ff-radio {
  width: 20px; height: 20px; border-radius: 999px;
  border: 2px solid #4b5563;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ff-sort-opt.is-on .ff-radio { border-color: var(--ff-accent); background: var(--ff-accent); }
.ff-radio i { width: 8px; height: 8px; border-radius: 999px; background: #fff; }
.filter-pills-row {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.filter-pills-row::-webkit-scrollbar { display: none; }
.ff-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 14px;
  white-space: nowrap; flex-shrink: 0; border: 1px solid transparent;
}
.ff-pill--col { background: var(--ff-pill-col); color: var(--ff-pill-col-text); }
.ff-pill--bd { background: var(--ff-pill-bd); color: var(--ff-pill-bd-text); }
.ff-pill--md { background: var(--ff-pill-md); color: var(--ff-pill-md-text); }
.ff-pill--sy { background: var(--ff-pill-sy); color: var(--ff-pill-sy-text); }
.filter-attr-overlay { opacity: 0; pointer-events: auto; transition: opacity 0.18s ease; }
.filter-attr-overlay.is-open { opacity: 1; }
.filter-attr-shell { pointer-events: auto; overflow: hidden; }
.filter-attr-shell--sheet {
  transform: translate3d(0, 100%, 0);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.filter-attr-shell--sheet.is-open { transform: translate3d(0, 0, 0); }
.filter-attr-panel--sheet {
  transform: none !important; opacity: 1 !important; transition: none !important;
  display: flex; flex-direction: column; height: 100%;
  background: var(--ff-surface); border: 1px solid var(--ff-line); border-bottom: 0; overflow: hidden;
}
.filter-attr-footer {
  flex-shrink: 0; padding: 12px 16px 0; border-top: 1px solid var(--ff-line);
  padding-bottom: max(1.5rem, calc(var(--app-safe-bottom, 12px) + 14px), calc(env(safe-area-inset-bottom, 0px) + 14px));
}
html.filter-attr-open,
html.filter-attr-open body { overflow: hidden !important; overscroll-behavior: none; }
.filter-hub-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.16s ease; pointer-events: auto;
}
.filter-hub-overlay.is-open { opacity: 1; }
.filter-hub-sheet {
  position: fixed; z-index: 10001;
  background: var(--ff-surface); border: 1px solid var(--ff-line); border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: min(70vh, 420px); overflow: auto; -webkit-overflow-scrolling: touch;
}
.filter-hub-sheet.is-open { opacity: 1; transform: translateY(0); }
.filter-attr-swatch {
  width: 2.75rem; height: 2.75rem; border-radius: 9999px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.filter-attr-pattern {
  width: 3.5rem; height: 3.5rem; border-radius: 9999px; overflow: hidden; flex-shrink: 0;
  background: #ebebef; border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.filter-attr-pattern__img {
  width: 62%; height: 62%; object-fit: contain; object-position: center;
  filter: brightness(0); pointer-events: none;
}
.filter-attr-thumb {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: var(--ff-surface-2); border: 1px solid var(--ff-line);
}
.filter-attr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.filter-attr-minprice {
  display: block; margin-top: 2px; font-size: 11px; line-height: 1.2;
  color: rgba(255, 255, 255, 0.38); font-weight: 500;
}
.filter-attr-check {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid #6b7280;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.filter-attr-check.is-on { background: var(--ff-accent); border-color: var(--ff-accent); }
.filter-attr-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  text-align: left; padding: 12px; border-radius: 12px; border: 0;
  background: transparent; color: #d1d5db; font-size: 14px;
}
.filter-attr-row.has-media { padding: 14px 12px; }
.filter-attr-row.is-on { background: var(--ff-accent-soft); color: #fff; }
.ff-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--ff-line); flex-shrink: 0;
}
.ff-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: #fff; }
.ff-close {
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--ff-line); background: rgba(255, 255, 255, 0.05);
  color: #d1d5db; display: flex; align-items: center; justify-content: center;
}
.ff-search-wrap { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.ff-search {
  width: 100%; box-sizing: border-box; background: var(--ff-surface-2);
  border: 1px solid var(--ff-line); border-radius: 12px;
  padding: 10px 36px; font-size: 16px; color: #fff;
}
.ff-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.ff-btn-primary { width: 100%; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--ff-accent); color: #fff; font-weight: 700; }
.ff-btn-secondary { flex: 1; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--ff-line); background: var(--ff-surface-2); color: #fff; }
.ff-hub-pad { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ff-hub-label { display: block; font-size: 12px; color: var(--ff-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.ff-hub-actions { display: flex; gap: 12px; padding-top: 4px; }
