/* ── Brand Hero ── */
.brand-hero {
  position: relative;
  background: linear-gradient(135deg, var(--clr-primary-900) 0%, var(--clr-primary-400) 100%);
  min-height: min(60vh, 480px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.brand-hero--category {
  background: linear-gradient(135deg, var(--clr-neutral-900) 0%, hsl(228, 30%, 30%) 100%);
  min-height: min(50vh, 400px);
}

.brand-hero--compact {
  min-height: auto;
  padding: 2.5rem 0;
}

.brand-hero--compact .brand-hero__inner {
  padding-block: 0;
}

.brand-hero--compact .brand-hero__logo {
  max-height: 50px;
  margin-bottom: var(--space-base, 0.75rem);
}

.brand-hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  z-index: 1;
}

.brand-hero__inner {
  position: relative;
  z-index: 2;
  padding-block: var(--space-3xl);
  text-align: center;
}

.brand-hero__logo {
  max-width: 220px;
  max-height: 80px;
  margin: 0 auto var(--space-xl);
  filter: brightness(0) invert(1);
}

.brand-hero__title {
  font-family: var(--ff-heading);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: var(--fw-extrabold);
  color: var(--clr-neutral-100);
  line-height: 1.1;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-hero__text {
  font-size: clamp(0.9rem, 1.4vw, 1.0625rem);
  color: var(--clr-neutral-200);
  opacity: 0.85;
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.8;
  margin-bottom: var(--space-xl);
}

.brand-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-base);
  justify-content: center;
}

@media (min-width: 50em) {
  .brand-hero__inner {
    text-align: left;
    max-width: 600px;
    padding-block: var(--space-4xl);
  }

  .brand-hero__logo {
    margin: 0 0 var(--space-xl);
  }

  .brand-hero__text {
    margin-inline: 0;
  }

  .brand-hero__actions {
    justify-content: flex-start;
  }
}

/* ── Brand Category Grid ── */
.brand-categories__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

@media (min-width: 50em) {
  .brand-categories__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.brand-categories__card {
  background: var(--clr-neutral-200);
  border-radius: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--clr-primary-400);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-categories__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.brand-categories__icon {
  font-size: 2rem;
  margin-bottom: var(--space-base);
}

.brand-categories__name {
  font-family: var(--ff-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.brand-categories__count {
  font-size: var(--fs-sm);
  opacity: 0.5;
  max-width: none;
}

/* ── Category Filters ── */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.category-filters__btn {
  background: var(--clr-neutral-200);
  border: 1px solid transparent;
  border-radius: 100vmax;
  padding: 0.5em 1.5em;
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-primary-400);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.category-filters__btn:hover {
  border-color: var(--clr-accent-400);
  color: var(--clr-accent-400);
}

.category-filters__btn--active {
  background: var(--clr-accent-400);
  color: var(--clr-neutral-100);
}

.category-filters__btn--active:hover {
  background: var(--clr-accent-300);
  color: var(--clr-neutral-100);
  border-color: transparent;
}

/* ── Browse Layout ── */
.brand-browse {
  padding: var(--space-2xl) 0 var(--space-4xl);
  background: #f4f4f4;
}

.brand-browse__layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.brand-browse__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.sort-control__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.sort-control__select {
  font-size: var(--fs-sm);
  padding: 0.35rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: var(--clr-neutral-900);
  cursor: pointer;
}

.brand-browse__count {
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--clr-neutral-900);
  max-width: none;
}

.brand-browse__count span {
  font-weight: 400;
  color: #9ca3af;
}

.brand-browse__empty {
  text-align: center;
  color: #9ca3af;
  padding: 4rem 0;
  grid-column: 1 / -1;
  font-size: 0.9375rem;
}

/* ── Filter Pane Card ── */
.filter-pane {
  position: sticky;
  top: 6.5rem;
  background: var(--clr-neutral-100);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.filter-pane::-webkit-scrollbar { width: 4px; }
.filter-pane::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.filter-pane__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.125rem;
}

.filter-pane__title {
  font-family: var(--ff-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--clr-neutral-900);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-pane__clear {
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-accent-400);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.filter-pane__clear:hover {
  color: var(--clr-accent-300);
  text-decoration: underline;
}

/* ── Selected Filter Tags ── */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 10px;
  background: var(--clr-primary-400);
  color: var(--clr-neutral-100);
  font-family: var(--ff-body);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.filter-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.filter-tag__remove:hover {
  color: var(--clr-neutral-100);
}

/* ── Accordion Sections ── */
.filter-accordion {
  border-top: 1px solid #eee;
}

.filter-accordion:first-of-type {
  border-top: none;
}

.filter-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  font-family: var(--ff-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--clr-neutral-900);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s ease;
}

.filter-accordion__header:hover {
  color: var(--clr-accent-400);
}

.filter-accordion__header::-webkit-details-marker {
  display: none;
}

/* Chevron icon via SVG-like CSS */
.filter-accordion__header::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  opacity: 0.4;
  margin-top: -2px;
}

.filter-accordion[open] > .filter-accordion__header::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.filter-accordion__body {
  padding: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Checkbox Rows ── */
.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  margin: 0 -10px;
  transition: background 0.15s ease;
}

.filter-check:hover {
  background: #f7f7f8;
}

.filter-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Custom checkbox — rounded square */
.filter-check__box {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #c5c8cd;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--clr-neutral-100);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-check:hover .filter-check__box {
  border-color: #9ca3af;
}

/* Checked state */
.filter-check input:checked + .filter-check__box {
  background: var(--clr-primary-400);
  border-color: var(--clr-primary-400);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Checkmark */
.filter-check input:checked + .filter-check__box::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2px;
  width: 5.5px;
  height: 10px;
  border: solid var(--clr-neutral-100);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Label text */
.filter-check__text {
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  color: #4b5563;
  line-height: 1.3;
  transition: color 0.15s ease;
}

.filter-check:hover .filter-check__text {
  color: var(--clr-neutral-900);
}

.filter-check input:checked ~ .filter-check__text {
  color: var(--clr-neutral-900);
  font-weight: 600;
}

/* ── Mobile toggle ── */
.filter-pane__mobile-toggle {
  display: none;
}

.filter-pane__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--clr-accent-400);
  color: var(--clr-neutral-100);
  font-size: 0.625rem;
  font-weight: 800;
  border-radius: 50%;
  margin-left: 0.3rem;
  padding: 0 4px;
}

/* ── Mobile overlay + slide-in ── */
.filter-pane__overlay {
  display: none;
}

@media (max-width: 50em) {
  .brand-browse__layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .brand-browse {
    background: var(--clr-neutral-100);
  }

  .filter-pane {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 310;
    border-radius: 0 16px 16px 0;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    max-height: none;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
    visibility: hidden;
    padding: 1.75rem 1.5rem;
    padding-top: 2rem;
  }

  .filter-pane--open {
    transform: translateX(0);
    visibility: visible;
  }

  .filter-pane__overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 305;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .filter-pane__overlay--active {
    opacity: 1;
    pointer-events: auto;
  }

  .filter-pane__mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    background: var(--clr-neutral-100);
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 14px;
    font-family: var(--ff-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-neutral-900);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .filter-pane__mobile-toggle:hover {
    border-color: var(--clr-neutral-900);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  .filter-pane__mobile-toggle svg {
    flex-shrink: 0;
    opacity: 0.5;
  }

  .filter-pane__mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--clr-neutral-900);
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .filter-pane__mobile-close:hover {
    background: #e5e7eb;
  }
}

@media (min-width: 50.0625em) {
  .filter-pane__mobile-close {
    display: none;
  }
}
