/* The brand cards keep their existing visual language in a single sliding row. */
.brand-carousel { min-width: 0; }
.brand-carousel #brands-grid,
.brand-carousel #brands-grid.is-filtered {
  display: grid;
  grid-template-columns: none;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2px) / 3);
  grid-auto-rows: auto;
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.brand-carousel #brands-grid::-webkit-scrollbar { display: none; }
.brand-carousel #brands-grid .brand-card {
  width: 100%;
  min-width: 0;
  min-height: 284px;
  scroll-snap-align: start;
}
.brand-carousel #brands-grid .brand-card p { max-width: none; }
.brand-carousel #brands-grid:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.brand-carousel #brands-grid .brand-card:focus-visible { outline-offset: -5px; }
.brand-carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}
.brand-carousel-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.brand-carousel-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-carousel-position { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 8px; }
.brand-carousel-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #3e3e3e;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  transition: border-color .2s, color .2s;
}
.brand-carousel-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.brand-carousel-nav:disabled { opacity: .3; cursor: default; }
.brand-carousel [hidden] { display: none; }

@media (hover: hover) and (pointer: fine) {
  .brand-carousel #brands-grid,
  .brand-carousel #brands-grid .brand-card { cursor: grab; user-select: none; -webkit-user-select: none; }
}
.brand-carousel #brands-grid.is-dragging { scroll-snap-type: none; }
.brand-carousel #brands-grid.is-dragging,
.brand-carousel #brands-grid.is-dragging .brand-card { cursor: grabbing; user-select: none; -webkit-user-select: none; }

@media (max-width: 767px) {
  .brand-carousel #brands-grid,
  .brand-carousel #brands-grid.is-filtered { grid-auto-columns: 90%; }
  .brand-carousel #brands-grid .brand-card { min-height: 270px; padding: 28px 24px; }
  .brand-carousel-footer { flex-wrap: wrap; gap: 12px 20px; margin-top: 18px; }
  .brand-carousel-controls { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-carousel #brands-grid { scroll-behavior: auto; }
  .brand-carousel-nav { transition: none; }
}
