/* Brands page - scoped to .page-brands */

.page-brands {
  background:
    radial-gradient(1200px 480px at 50% -10%, rgba(214, 180, 106, 0.08), transparent),
    linear-gradient(180deg, #030303 0%, #060606 40%, #050505 100%);
}

/* Sticky .topbar (~74px) with translucent background + backdrop blur can
   visually crowd the hero card. Buffer applied to main itself so it works
   both at scroll-top and after any anchor scroll, and so the first section
   inherits the standard .section padding on top of it. */
.page-brands main {
  padding-top: 1.5rem;
}
.page-brands main > .section:first-child {
  padding-top: 5.5rem;
}
@media (max-width: 540px) {
  .page-brands main {
    padding-top: 1rem;
  }
  .page-brands main > .section:first-child {
    padding-top: 4rem;
  }
}
html {
  scroll-padding-top: 90px;
}

/* Hero card */
.brands-hero-card .section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.3;
}

.brands-hero-card .section-subtitle {
  max-width: 64ch;
  line-height: 1.75;
}

/* Filter chips */
.brands-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(214, 180, 106, 0.2);
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.8), rgba(8, 7, 6, 0.85));
  width: max-content;
  max-width: 100%;
}

.brands-filter-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(214, 180, 106, 0.32);
  background: rgba(0, 0, 0, 0.45);
  color: var(--champagne);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.brands-filter-chip:hover {
  border-color: rgba(214, 180, 106, 0.7);
  transform: translateY(-1px);
}

.brands-filter-chip.is-active {
  background: linear-gradient(180deg, #e8c98a 0%, #c9a763 100%);
  border-color: #d6b46a;
  color: #1a1208;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 18px rgba(214, 180, 106, 0.28);
}

@media (max-width: 860px) {
  /* Tablet + mobile: switch the filter row to clean horizontal scroll so
     8–10 chips never wrap into multiple cramped rows. Desktop is untouched. */
  .brands-filter {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 0.55rem;
  }
  .brands-filter::-webkit-scrollbar {
    display: none;
  }
  .brands-filter-chip {
    flex-shrink: 0;
  }
}

/* Brand tag badges - refined per-status */
.brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.brand-tag--premium {
  background: linear-gradient(135deg, rgba(232, 201, 138, 0.22), rgba(214, 180, 106, 0.12));
  color: #f0d693;
  border-color: rgba(232, 201, 138, 0.55);
}

.brand-tag--recommended {
  background: linear-gradient(135deg, rgba(140, 175, 220, 0.18), rgba(120, 155, 200, 0.1));
  color: #c8ddff;
  border-color: rgba(140, 175, 220, 0.45);
}

.brand-tag--popular {
  background: linear-gradient(135deg, rgba(235, 165, 95, 0.2), rgba(210, 140, 75, 0.1));
  color: #ffd0a4;
  border-color: rgba(235, 165, 95, 0.5);
}

.brand-tag--new {
  background: linear-gradient(135deg, rgba(130, 200, 150, 0.2), rgba(100, 175, 125, 0.1));
  color: #c8e8d2;
  border-color: rgba(130, 200, 150, 0.5);
}

/* Explainer section - softened a touch + extra breathing room above so it
   doesn't feel glued to the brand grid. */
.brands-explainer-section {
  padding-top: 1.4rem;
  padding-bottom: 2.4rem;
}

.brands-explainer {
  position: relative;
  padding: 1.5rem 1.3rem 1.6rem;
  border: 1px solid rgba(214, 180, 106, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.004));
  overflow: hidden;
}
.brands-explainer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.45), transparent);
  pointer-events: none;
}
@media (min-width: 720px) {
  .brands-explainer {
    padding: 1.7rem 1.6rem 1.8rem;
  }
}

.brands-explainer-title {
  margin: 0 0 1.1rem;
  text-align: center;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  color: var(--champagne);
  letter-spacing: -0.005em;
}
.brands-explainer-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 0.5rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(214, 180, 106, 0.55), transparent);
}

.brands-explainer-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 720px) {
  .brands-explainer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.brands-explainer-card {
  position: relative;
  padding: 1.15rem 1.05rem 1.2rem;
  border: 1px solid rgba(214, 180, 106, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(214, 180, 106, 0.035), rgba(0, 0, 0, 0));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  align-items: center;
  /* Uniform height across the 3-card row even when descriptions vary. */
  height: 100%;
  min-height: 170px;
}

.brands-explainer-num {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid rgba(214, 180, 106, 0.7);
  background:
    radial-gradient(circle at 35% 30%, rgba(214, 180, 106, 0.28), transparent 65%),
    rgba(214, 180, 106, 0.1);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.98rem;
  display: inline-grid;
  place-items: center;
  margin-bottom: 0.15rem;
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.16),
    0 3px 10px rgba(0, 0, 0, 0.3);
}

.brands-explainer-card h3 {
  margin: 0;
  color: var(--champagne);
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 700;
}

.brands-explainer-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 32ch;
}

/* CTA card */
.brands-cta-section {
  padding-top: 1rem;
}

.brands-cta-card {
  position: relative;
  padding: 1.8rem 1.3rem;
  text-align: center;
  border: 1px solid rgba(214, 180, 106, 0.4);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 60% at 50% 0%, rgba(214, 180, 106, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(20, 16, 12, 0.95), rgba(10, 9, 8, 0.97));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .brands-cta-card {
    padding: 2.3rem 2rem;
  }
}

.brands-cta-card h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  color: var(--champagne);
  max-width: 32ch;
  line-height: 1.3;
}

.brands-cta-card p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 56ch;
  line-height: 1.7;
  font-size: clamp(0.95rem, 1.5vw, 1.02rem);
}

.brands-cta-card .cta-row {
  justify-content: center;
}

/* List section spacing */
.brands-list-section {
  padding-top: 0.5rem;
  padding-bottom: 0.75rem;
}

/* New-brand chip - override legacy ribbon styling, scoped to brands page */
.page-brands .brands-card {
  overflow: visible;
}

.page-brands .brands-card-ribbon {
  position: absolute;
  top: 0.85rem;
  inset-inline-start: 0.85rem;
  right: auto;
  left: auto;
  transform: none;
  width: auto;
  text-align: initial;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.78));
  color: var(--gold);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(214, 180, 106, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(214, 180, 106, 0.15),
    0 0 10px rgba(214, 180, 106, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.page-brands .brands-card-ribbon::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(214, 180, 106, 0.85);
  flex-shrink: 0;
}

/* Grid balance - center trailing items, no card stretching, responsive
   column count without changing the dark/gold language. */
.page-brands .brands-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 240px));
  justify-content: center;
  align-items: start;
  grid-auto-rows: auto;
  gap: 1.25rem 1rem;
  /* Cap grid width so sparse filter results (1–3 cards) cluster cleanly in
     the middle instead of spreading across the full 1220px container. */
  max-width: 1140px;
  margin-inline: auto;
}

/* Reserve vertical space ONLY while the grid is in the loading state, so
   the footer/CTA below don't jump as skeletons are replaced. The moment
   real cards are rendered (`data-state="ready"`) we release the reservation
   so a small filtered result-set doesn't stretch cards. */
.page-brands .brands-grid[data-state="loading"] {
  min-height: 760px;
}
@media (max-width: 720px) {
  .page-brands .brands-grid[data-state="loading"] {
    min-height: 1200px;
  }
}
@media (max-width: 540px) {
  .page-brands .brands-grid[data-state="loading"] {
    min-height: 880px;
  }
}

/* Skeleton card - same dimensions/grid cell as a real brand card so the
   layout never shifts when real cards replace it. Dark/gold tint matches
   the rest of the brands page. */
.page-brands .brands-card--skeleton {
  pointer-events: none;
  border-color: rgba(214, 180, 106, 0.18);
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.55), rgba(10, 9, 8, 0.6));
}
.page-brands .brands-card--skeleton:hover {
  transform: none;
  border-color: rgba(214, 180, 106, 0.18);
  box-shadow: none;
}

.brands-skel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm, 10px);
  background: rgba(214, 180, 106, 0.06);
  border: 1px solid rgba(214, 180, 106, 0.08);
}
.brands-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214, 180, 106, 0.16) 50%,
    transparent 100%
  );
  animation: brandsSkelShimmer 1.4s ease-in-out infinite;
}
@keyframes brandsSkelShimmer {
  to { transform: translateX(100%); }
}

.brands-skel-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 220px;
  max-height: 280px;
}
.brands-skel-title {
  height: 1.1rem;
  width: 70%;
  margin: 0.55rem auto 0;
}
.brands-skel-cat {
  height: 0.75rem;
  width: 45%;
  margin: 0.4rem auto 0;
}
.brands-skel-desc {
  height: 0.7rem;
  width: 85%;
  margin: 0.45rem auto 0;
}
.brands-skel-tag {
  height: 1.4rem;
  width: 4.5rem;
  border-radius: 999px;
  margin: 0.45rem auto 0;
}

@media (prefers-reduced-motion: reduce) {
  .brands-skel::after { animation: none; }
}

@media (max-width: 540px) {
  .page-brands .brands-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
  }
}

/* Enlarged image + tighter bottom content */
.page-brands .brands-card {
  text-align: center;
  gap: 0.4rem;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  /* Natural card height - never stretch to fill the grid row, even when a
     filter leaves only a couple of cards in a row. A small min-height keeps
     cards visually balanced when descriptions differ in length. */
  height: auto;
  align-self: start;
  min-height: 320px;
}

.page-brands .brands-card img,
.page-brands .brands-card-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 220px;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  border-radius: var(--radius-sm);
}

.page-brands .brands-card-media {
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.page-brands .brands-card h3 {
  text-align: center;
  margin-top: 0.4rem;
  font-size: 1.08rem;
  line-height: 1.3;
  word-break: break-word;
}

.page-brands .brands-card-cat {
  text-align: center;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
}

.page-brands .brands-card-meta {
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-bottom: 0.1rem;
}

.page-brands .brands-card-desc {
  margin: 0.1rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30ch;
  margin-inline: auto;
}

/* Empty-state note */
.brands-page-note-sub {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Visual divider between tag chips and category chips */
.brands-filter-divider {
  display: inline-block;
  width: 1px;
  height: 1.5rem;
  margin: 0 0.15rem;
  background: linear-gradient(180deg, transparent, rgba(214, 180, 106, 0.45), transparent);
  align-self: center;
}
.brands-filter-divider[hidden] {
  display: none;
}

/* Luxury hover */
.page-brands .brands-card:hover {
  border-color: rgba(214, 180, 106, 0.65);
  box-shadow:
    0 0 22px rgba(214, 180, 106, 0.18),
    0 14px 32px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.page-brands .brands-card:hover img {
  transform: scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
  .page-brands .brands-card,
  .page-brands .brands-card img {
    transition: none;
  }
  .page-brands .brands-card:hover {
    transform: none;
  }
  .page-brands .brands-card:hover img {
    transform: none;
  }
}

/* Focused pitch block (replaces the 3 old AI content cards) */
.brands-pitch-section {
  padding: 0.6rem 0 2.2rem;
}

.brands-pitch-card {
  position: relative;
  padding: 1.35rem 1.3rem 1.45rem;
  border: 1px solid rgba(214, 180, 106, 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(214, 180, 106, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(20, 16, 12, 0.96), rgba(8, 7, 6, 0.97));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

@media (min-width: 720px) {
  .brands-pitch-card {
    padding: 1.6rem 2rem 1.7rem;
    gap: 0.75rem;
  }
}

.brands-pitch-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  color: var(--champagne);
  line-height: 1.25;
  max-width: 30ch;
}

.brands-pitch-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 1.5vw, 1.02rem);
  line-height: 1.75;
  max-width: 64ch;
}

.brands-pitch-points {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 880px;
}

@media (min-width: 760px) {
  .brands-pitch-points {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
  }
}

.brands-pitch-points li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(214, 180, 106, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(214, 180, 106, 0.05), rgba(255, 255, 255, 0));
  color: var(--champagne);
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
}

.brands-pitch-bullet {
  color: var(--gold);
  font-size: 0.55rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(214, 180, 106, 0.35));
}

.brands-pitch-btn {
  margin-top: 0.4rem;
}
