/* Donor cards, search bar, skeleton, modals */
/* ============================================
   MODAL
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem var(--sp-4) var(--sp-4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s;
  overflow-y: auto;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 10px);
  overflow-y: auto;
  position: relative;
  transform: scale(0.96) translateY(-10px);
  opacity: 0;
  transition: transform 0.35s var(--ease-spring), opacity 0.3s var(--ease-out);
  box-shadow: var(--shadow-xl);
  will-change: transform, opacity;
  margin: 0 auto;
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal scrollbar */
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--clr-surface);
  z-index: 1;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
}

.modal-icon {
  width: 36px; height: 36px;
  background: rgba(229,57,53,0.1);
  border: 1px solid rgba(229,57,53,0.2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: var(--sp-2);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--txt-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--txt-muted);
  margin-top: 2px;
}

.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-muted);
  background: var(--border-subtle);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.modal-close:hover {
  background: rgba(239,68,68,0.1);
  color: var(--clr-error);
  border-color: rgba(239,68,68,0.2);
}

.modal-body {
  padding: 14px;
  margin-top: 2rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--clr-bg);
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
}

/* Confirm Modal */
.modal--confirm {
  max-width: 400px;
}

.confirm-icon {
  width: 56px; height: 56px;
  background: rgba(239,68,68,0.1);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto var(--sp-4);
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--txt-primary);
  margin-bottom: var(--sp-3);
}

.confirm-text {
  font-size: 0.9rem;
  color: var(--txt-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

/* ============================================
   SEARCH & FILTER SECTION
   ============================================ */

.donors-section {
  --donor-filter-bar-space: 96px;
  padding: calc(var(--navbar-h) + var(--sp-16)) 0 var(--sp-20);
  min-height: 60vh;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--txt-primary);
  letter-spacing: -0.03em;
}

.section-count {
  font-size: 0.875rem;
  color: var(--txt-muted);
  font-weight: 500;
  background: var(--border-subtle);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  border: 1px solid var(--border-medium);
  white-space: nowrap;
}

/* ── Filter Bar ── */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  position: fixed;
  top: calc(var(--navbar-h) + 124px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - var(--sp-12)));
  z-index: var(--z-sticky);
  transition: box-shadow 0.3s;
  /* margin-top: 145.5rem; */
}

.filter-bar:focus-within,
.filter-bar.pinned {
  box-shadow: var(--shadow-md);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  height: 48px;
  background: var(--clr-bg);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 0 44px 0 48px;
  font-size: 0.9375rem;
  color: var(--txt-primary);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.10);
}

.search-input::placeholder { color: var(--txt-muted); }

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--txt-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s;
  border: none;
}

.search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover { background: var(--border-strong); }

.filter-select {
  height: 48px;
  background: var(--clr-bg);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 0 36px 0 var(--sp-4);
  font-size: 0.875rem;
  color: var(--txt-primary);
  font-family: var(--font-body);
  appearance: none;
  cursor: pointer;
  min-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s;
}

.filter-select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.10);
  outline: none;
}

.filter-reset {
  height: 48px;
  padding: 0 var(--sp-4);
  background: var(--border-subtle);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--r-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--txt-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.filter-reset:hover {
  background: var(--border-medium);
  color: var(--txt-primary);
}

/* ── Active Filters ── */
.active-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--donor-filter-bar-space);
  margin-bottom: var(--sp-5);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(229,57,53,0.08);
  border: 1px solid rgba(229,57,53,0.2);
  color: var(--clr-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
  animation: chipIn 0.2s var(--ease-spring);
}

@keyframes chipIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.filter-chip-remove {
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.filter-chip-remove:hover { opacity: 1; }

/* ============================================
   DONOR CARDS
   ============================================ */

.donors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-content: start;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}

.donor-card {
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-out),
    border-color 0.3s;
  animation: cardIn 0.4s var(--ease-out) both;
  cursor: default;
}

.donor-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.donor-card-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.donor-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.donor-avatar {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.donor-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--txt-primary);
  line-height: 1.2;
  margin-bottom: 3px;
}

.donor-name mark {
  background: rgba(229,57,53,0.15);
  color: var(--clr-primary);
  border-radius: 3px;
  padding: 0 2px;
}

/* ── Blood Group Badge ── */
.blood-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: white;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  min-width: 52px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-top: var(--sp-4);
}

.blood-badge::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 40%;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.bg-O  { background: var(--bg-O); }
.bg-A  { background: var(--bg-A); }
.bg-B  { background: var(--bg-B); }
.bg-AB { background: var(--bg-AB); }
.bg-Oplus   { background: var(--bg-O); }
.bg-Aminus  { background: var(--bg-A); }
.bg-Bminus  { background: var(--bg-B); }
.bg-Ominus  { background: var(--bg-O); }
.bg-Aplus   { background: var(--bg-A); }
.bg-Bplus   { background: var(--bg-B); }
.bg-ABplus  { background: var(--bg-AB); }
.bg-ABminus { background: var(--bg-AB); }

/* ── Card Details ── */
.donor-details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.donor-detail {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 0.875rem;
  color: var(--txt-secondary);
}

.donor-detail-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--txt-muted);
}

.donor-detail mark {
  background: rgba(229,57,53,0.12);
  color: var(--clr-primary);
  border-radius: 3px;
  padding: 0 2px;
}

/* ── Card Footer ── */
.donor-card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.donor-card-footer .btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 10px var(--sp-4);
}

/* ── Card Date ── */
.donor-card-date {
  font-size: 0.72rem;
  color: #000000;
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-5);
  z-index: 1;
  background: var(--clr-surface);
  padding: 2px 4px;
  border-radius: var(--r-sm);
}

[data-theme="dark"] .donor-card-date {
  color: #FFFFFF;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateX(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.donor-card.removing {
  animation: cardOut 0.3s var(--ease-out) forwards;
}

@keyframes cardOut {
  to { opacity: 0; transform: scale(0.9); }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--sp-20) var(--sp-8);
  animation: fadeIn 0.4s var(--ease-out);
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--sp-5);
  display: block;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: var(--sp-3);
}

.empty-state-text {
  font-size: 0.9375rem;
  color: var(--txt-muted);
  margin-bottom: var(--sp-6);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ============================================
   SKELETON LOADER
   ============================================ */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--border-subtle);
  border-radius: var(--r-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.25) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
}

.sk-line { height: 14px; margin-bottom: var(--sp-3); }
.sk-circle { border-radius: 50%; }
.sk-avatar { width: 52px; height: 52px; border-radius: var(--r-lg); }
.sk-badge  { width: 52px; height: 36px; border-radius: var(--r-md); }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================
   STATS BAR
   ============================================ */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
}

.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s, border-color 0.28s;
  cursor: default;
}

/* Enhanced gradient overlay for stat cards */
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg,
    rgba(229,57,53,0.09) 0%,
    rgba(37,99,235,0.04) 50%,
    rgba(34,197,94,0.04) 100%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
}

/* Bottom accent bar */
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  border-radius: var(--r-full);
  transition: transform 0.35s var(--ease-spring);
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(229,57,53,0.12),
    0 8px 20px rgba(15,23,42,0.1);
  border-color: rgba(229,57,53,0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.2) rotate(-5deg);
}

.stat-card:hover .stat-card-num {
  color: var(--clr-primary);
}

.stat-card-icon {
  font-size: 1.5rem;
  margin-bottom: var(--sp-2);
  display: block;
  transition: transform 0.3s var(--ease-spring);
}

.stat-card-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--txt-primary);
  line-height: 1;
  margin-bottom: var(--sp-1);
  transition: color 0.3s var(--ease-out);
}

.stat-card-label {
  font-size: 0.78rem;
  color: var(--txt-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .section-header {
    margin-bottom: var(--sp-8);
  }
  .filter-bar {
    top: calc(var(--navbar-h) + 108px);
  }
}

@media (max-width: 1024px) {
  .donors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section-header {
    margin-bottom: var(--sp-9);
  }
  .filter-bar {
    top: calc(var(--navbar-h) + 116px);
  }
}

@media (max-width: 480px) {
  .donors-grid {
    grid-template-columns: 1fr;
    margin-top: var(--sp-10);
  }
  .donors-section { --donor-filter-bar-space: 176px; }
  .section-header {
    margin-bottom: var(--sp-7);
  }
  .filter-bar {
    grid-template-columns: 1fr;
    top: calc(var(--navbar-h) + 96px);
    width: calc(100% - var(--sp-8));
    z-index: calc(var(--z-sticky) - 3);
    /* margin-top: 232.5rem; */
  }
  
  /* Raise filter-bar above mobile menu when it's open */
  body.menu-open .filter-bar {
    z-index: calc(var(--z-sticky) - 2);
  }
  
  .filter-bar .filter-select,
  .filter-bar .filter-reset {
    width: 100%;
  }

  /* Mobile modal padding */
  .modal {
    max-height: calc(100dvh - 10px);
  }

  .modal-body {
    padding: 12px;
    margin-top: 2rem;
  }

  .modal-header {
    padding: 12px 12px 8px;
  }

  .modal-footer {
    padding: 10px 12px;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Grid within modal on small screens */
  .modal-body [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}



/* ////// */
/* ============================================
   SEARCH & FILTER SECTION (FINAL FIXED)
   ============================================ */

.donors-section {
  padding-top: calc(var(--navbar-h) + 0.5rem); /* 1rem from navbar */
  padding-bottom: var(--sp-20);
  min-height: 60vh;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: 7rem; /* 3rem gap before filter bar */
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--txt-primary);
  letter-spacing: -0.03em;
}

.section-count {
  font-size: 0.875rem;
  color: var(--txt-muted);
  font-weight: 500;
  background: var(--border-subtle);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  border: 1px solid var(--border-medium);
  white-space: nowrap;
}

/* ── Filter Bar ── */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--clr-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);

  position: fixed;
  top: calc(var(--navbar-h) + 6rem); /* below header */
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - var(--sp-12)));

  z-index: var(--z-sticky);
  transition: box-shadow 0.3s;
}

.filter-bar:focus-within,
.filter-bar.pinned {
  box-shadow: var(--shadow-md);
}

/* ── Active Filters ── */
.active-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;

  margin-top: 7rem; /* prevents overlap */
  margin-bottom: var(--sp-5);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(229,57,53,0.08);
  border: 1px solid rgba(229,57,53,0.2);
  color: var(--clr-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
  animation: chipIn 0.2s var(--ease-spring);
}

@keyframes chipIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.filter-chip-remove {
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.filter-chip-remove:hover { opacity: 1; }


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .donors-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: -2rem;
  }
}

@media (max-width: 480px) {

  .donors-grid {
    grid-template-columns: 1fr;
    margin-top: var(--sp-6);
    margin-top: 5rem;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    top: calc(var(--navbar-h) + 8.5rem); /* consistent spacing */
    width: calc(100% - var(--sp-8));
    z-index: calc(var(--z-sticky) - 3);
  }

  body.menu-open .filter-bar {
    z-index: calc(var(--z-sticky) - 2);
  }

  .filter-bar .filter-select,
  .filter-bar .filter-reset {
    width: 100%;
  }

  .section-header {
    margin-bottom: 6rem; /* keep same */
  }

  .active-filters {
    margin-top: 6rem; /* more space for stacked layout */
  }
}

@media (min-width: 1025px) {
  .section-header {
    margin-bottom: 5rem;
  }

  .active-filters {
    margin-top: 5rem;
    margin-bottom: var(--sp-4);
  }
}