/**
 * Browse / content page redesign
 * ==============================
 *
 * Shared visual upgrade for the public catalog & guide pages
 * (scripts, popular, serverside, executors). Loads AFTER styles.css /
 * filters.css so it can refine the shared layout primitives without
 * touching their base rules.
 *
 * Goals: a richer page header (eyebrow badge, accent title, quick-nav
 * pills), a modern sticky filter bar, and tighter results UI — all in the
 * existing teal/dark design language used on the home page.
 */

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  padding: calc(112px + var(--site-banner-height, 0px)) 0 40px;
  background-color: var(--bg-secondary);
}

/* Remove the ambient accent (green) glow on the header. */
.page-header::after {
  display: none;
}

.page-header-content {
  max-width: 760px;
  margin: 0 auto;
}

/* Eyebrow badge above the title */
.ph-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, transparent);
  animation: fadeInDown 0.6s ease forwards;
}

.ph-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

/* Accent underline beneath the title */
.page-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 18px;
}

.page-header-content .page-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: var(--accent-primary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-primary) 55%, transparent);
}

.page-subtitle {
  max-width: 640px;
}

/* Quick-nav pills below the subtitle */
.ph-quicknav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.ph-quicknav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast),
    background-color var(--transition-fast), transform var(--transition-fast);
}

.ph-quicknav a:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 45%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-card));
  transform: translateY(-1px);
}

.ph-quicknav a.is-active {
  color: var(--accent-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 50%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.ph-quicknav a svg {
  width: 15px;
  height: 15px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

/* No tray — the controls stand on their own as standalone pills, matching
   the landing-page hero search bar. */
.filter-bar {
  position: static;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

/* --- Search field: a glass pill identical to the hero search --- */
/* styles.css wraps the input in its own padded box; we promote that wrapper
   to BE the pill (icon via ::before) and make the input itself transparent. */
.filter-search {
  flex: 1 1 280px;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  background: rgba(18, 20, 32, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-search:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.18);
}

.filter-search::before {
  left: 18px;
  width: 18px;
  height: 18px;
}

.filter-search:focus-within::before {
  background: var(--accent-primary);
}

.filter-search-input {
  flex: 1;
  height: 50px;
  padding: 0 16px 0 46px;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 1rem;
}

.filter-search-input:hover,
.filter-search-input:focus {
  background: none;
  border: none;
  box-shadow: none;
}

.filter-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* --- Select controls: matching glass pills --- */
.filter-controls {
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  height: 50px;
  min-width: 150px;
  padding: 0 40px 0 16px;
  border-radius: 14px;
  background-color: rgba(18, 20, 32, 0.72);
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  background-position: right 15px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.filter-select:hover {
  background-color: rgba(24, 26, 40, 0.85);
  border-color: var(--border-light);
}

.filter-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.18);
}

/* --- Responsive: full-width search + wrapping selects on small screens --- */
@media (max-width: 720px) {
  .filter-search {
    flex: 1 1 100%;
  }
  .filter-controls {
    width: 100%;
  }
  .filter-controls .filter-select {
    flex: 1 1 auto;
  }
}

/* ============================================================
   RESULTS INFO
   ============================================================ */

.results-info {
  margin-bottom: 22px;
}

.bundles-strip {
  margin: 0 0 36px;
}

.bundles-strip-head {
  margin-bottom: 16px;
}

.bundles-strip-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
}

.bundles-strip-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bundles-strip-grid {
  margin-top: 4px;
}

.results-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.results-count::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* ============================================================
   CONTENT BREATHING ROOM
   ============================================================ */

.page-content .cards-grid {
  margin-top: 4px;
}

/* Infinite-scroll sentinel (sibling after .cards-grid) */
.nex-infinite-sentinel {
  height: 1px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.nex-infinite-sentinel.is-loading {
  visibility: visible;
  height: 48px;
  margin-top: 16px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  background-size: 200% 100%;
  animation: nex-infinite-pulse 1.1s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes nex-infinite-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

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

@media (max-width: 768px) {
  .filter-bar {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg-card);
  }

  .ph-quicknav {
    margin-top: 18px;
  }

  .page-header-content .page-title::after {
    margin-top: 14px;
  }
}
