/* ==========================================================================
   Our Brands Page — Styles
   ========================================================================== */

/* ── A–Z Alphabet filter ──────────────────────────────────────────────────────
   A horizontal scrollable bar of letter buttons.
   Active letter is filled; empty letters are dimmed and non-interactive.
   ────────────────────────────────────────────────────────────────────────── */
.brands-az {
  padding: 3rem 0 1.5rem;
  /* border-bottom: 1px solid var(--color-border); */
  background: var(--color-bg);
  /* position: sticky;
    top: var(--navbar-height);
    z-index: 100; */
  background: #ffffff;
  /* box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04); */
}

.brands-az__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Individual letter button */
.brands-az__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  /* border-radius: 6px; */
  /* border: 1.5px solid var(--color-border); */
  border: none;
  border-bottom: 3px solid var(--color-border);
  background: #ffffff;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), transform 0.15s ease;
  padding: 0;
  line-height: 1;
}

.brands-az__btn:hover:not([disabled]) {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  transform: translateY(-2px);
}

/* Active state */
.brands-az__btn.active {
  /* background: var(--color-primary); */
  border-color: var(--color-primary);
  /* color: #ffffff; */
}

.brands-az__btn.active:hover {
  /* background: var(--color-secondary); */
  border-color: var(--color-secondary);
  /* color: #ffffff; */
  transform: translateY(-2px);
}

/* "All" button — slightly wider */
.brands-az__btn--all {
  width: auto;
  padding: 0 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Empty letter (no brands) — muted, no pointer */
.brands-az__btn--empty,
.brands-az__btn[disabled] {
  color: var(--color-border);
  /* border-color: transparent; */
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* Result count */
.brands-az__count {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin: 0;
  letter-spacing: 0.04em;
}

.brands-az__count-num {
  font-weight: 700;
  color: var(--color-secondary);
}

/* ── Brands grid (5 columns) ─────────────────────────────────────────────────
   CSS Grid with equal square cells.
   ────────────────────────────────────────────────────────────────────────── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3rem;
  /* 1px gap creates the shared border illusion */
  /* border: 1px solid var(--color-border); */
  /* border-radius: 8px; */
  overflow: hidden;
  /* background: var(--color-border); */
  /* the gap colour */
  padding: 0rem 4rem;
}

@media (max-width: 1199.98px) {
  .brands-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
}

@media (max-width: 767.98px) {
  .brands-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 479.98px) {
  .brands-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ── Brand box ───────────────────────────────────────────────────────────────
   Square cell: the inner link uses aspect-ratio to enforce the square.
   ────────────────────────────────────────────────────────────────────────── */
.brand-box {
  background: #ffffff;
  transition: background var(--transition);
}

.brand-box[hidden] {
  display: none !important;
}

.brand-box:hover {
  background: var(--color-bg-alt);
}

.brand-box__inner {
  display: block;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  height: 100%;
  perspective: 600px;
}

/* Flipper container */
.brand-box__flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.brand-box:hover .brand-box__flipper {
  transform: rotateY(180deg);
}

/* Shared face styles */
.brand-box__front,
.brand-box__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid rgba(211, 211, 211, 0.82);
}

.brand-box__front {
  background: #ffffff;
}

.brand-box__back {
  background: var(--color-primary, #1a1a2e);
  transform: rotateY(180deg);
  padding: 1rem;
}

/* Back face showing a brand image instead of the dark name plate */
.brand-box__back--image {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}

.brand-box__back-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark scrim so the brand name stays legible over the image */
.brand-box__back--image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.brand-box__back--image .brand-box__name {
  position: relative;
  z-index: 1;
}

/* Logo wrapper — centred with max size */
.brand-box__logo-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0.25rem;
}

.brand-box__logo {
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: grayscale(30%) opacity(0.85);
  transition: filter 0.35s ease;
}

/* Fallback initial letter when no logo */
.brand-box__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
}

/* Brand name label (shown on back face) */
.brand-box__name {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.3;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.brands-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-light);
}

.brands-empty i {
  font-size: 3rem;
  color: var(--color-border);
  display: block;
  margin-bottom: 1rem;
}

.brands-empty p {
  font-size: 0.95rem;
  margin: 0;
}

/* ── Shared section title ─────────────────────────────────────────────────── */
.bc-section-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 2.5rem;
}

/* ── Section 3: New Collections ───────────────────────────────────────────── */
.bc-collections {
  padding: 5rem 0 6rem;
  background: var(--color-bg-alt);
}

.bc-collections__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  grid-auto-rows: 1fr;
  align-items: stretch;
  overflow: visible !important;
}

@media (max-width: 991.98px) {
  .bc-collections__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 479.98px) {
  .bc-collections__grid {
    grid-template-columns: 1fr;
  }
}

/* Collection card */
.bc-coll-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease !important;
}

.bc-coll-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.bc-coll-card__image-wrap {
  position: relative;
  display: block;
  overflow: hidden !important;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  /* margin-left: -3px;
  margin-right: -3px; */
  /* background: var(--color-primary); */
  aspect-ratio: 3 / 4;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
}

.bc-coll-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.bc-coll-card__placeholder {
  /* width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 3rem; */

  width: auto;
  /* height: 80%; */
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 3rem;
  overflow: hidden;
  background: var(--color-primary);
  aspect-ratio: 3 / 4;
  text-decoration: none;
}

.bc-coll-card__footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: #fff;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: 0px 2px 2px 0px #5c5b5b75;
  flex-shrink: 0;
}

.bc-coll-card__name {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.bc-coll-card__actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.bc-coll-card__btn {
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 1px 2px 10px 1px rgba(255, 255, 255, 0.45), 0px 3px 2px rgba(94, 104, 121, 0.1);
  border-radius: 8px;
  background: #ddd;
  position: relative;
  transition: background 0.3s ease;
}

.bc-coll-card__btn::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  margin-bottom: 8px;
  z-index: 10;
  pointer-events: none;
}

.bc-coll-card__btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.bc-coll-card__btn:hover {
  background: var(--color-secondary);
  color: #ffffff;
}

/* ── Section 4: Browse by Product Categories ──────────────────────────────── */
.bc-categories {
  padding: 5rem 0 6rem;
  background: var(--color-bg);
}

/* Tab strip */
.bc-cat__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid #000;
  margin-bottom: 3rem;
}

.bc-cat__tab {
  padding: 0.65rem 1.4rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font-size: 0.85rem;
  font-weight: 600;
  /* color: var(--color-text-light); */
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.bc-cat__tab:hover {
  color: var(--color-primary);
}

.bc-cat__tab.active {
  /* color: var(--color-primary); */
  background-color: #D9D9D942;
;
  /* border-bottom-color: var(--color-primary); */
}

/* Brand logo grid — 6 columns */
.bc-cat__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3rem;
  /* background: var(--color-border); */
  /* border: 1px solid var(--color-border); */
  /* border-radius: 8px; */
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .bc-cat__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 575.98px) {
  .bc-cat__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.bc-cat__item {
  background: #ffffff;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  overflow: visible;
}

.bc-cat__item[hidden] {
  display: none !important;
}

.bc-cat__link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  perspective: 600px;
}

/* Flipper container */
.bc-cat__flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.bc-cat__item:hover .bc-cat__flipper {
  transform: rotateY(180deg);
}

/* Shared face styles */
.bc-cat__front,
.bc-cat__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid rgba(211, 211, 211, 0.82);
}

.bc-cat__front {
  background: #ffffff;
  padding: 0.5rem;
}

.bc-cat__back {
  background: var(--color-primary, #1a1a2e);
  transform: rotateY(180deg);
  padding: 1rem;
}

/* Back face showing a brand image instead of the dark name plate */
.bc-cat__back--image {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}

.bc-cat__back-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
}

/* Dark scrim so the brand name stays legible over the image */
.bc-cat__back--image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.bc-cat__back--image .bc-cat__name {
  position: relative;
  z-index: 1;
}

.bc-cat__link img {
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(30%) opacity(0.8);
  transition: filter 0.35s ease;
}

.bc-cat__initial {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-light);
}

/* Brand name on back face */
.bc-cat__name {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.3;
}

.bc-cat__empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-light);
}

.bc-cat__empty i {
  font-size: 2.5rem;
  color: var(--color-border);
  display: block;
  margin-bottom: 1rem;
}

.bc-cat__empty p {
  font-size: 0.95rem;
  margin: 0;
}

/* ── Filter animation ─────────────────────────────────────────────────────── */
.brand-box {
  animation: brandFadeIn 0.25s ease forwards;
}

@keyframes brandFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}