.brand-hero {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 60%, #e9eef4 100%);
  margin-bottom: 1rem;
}

.brand-hero-media {
  min-height: 240px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.brand-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.65) 100%);
}

.brand-hero-media:not([style*="background-image"])::after {
  display: none;
}

.brand-hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  min-height: 240px;
  padding: 1.25rem;
  color: #fff;
}

.brand-logo-frame {
  /* Wide enough for calligraphy / wordmarks; square marks still center fine. */
  width: 140px;
  height: 88px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.brand-logo-frame img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-logo-fallback {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
}

.brand-hero-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-hero-tagline {
  margin: 0.2rem 0 0.1rem 0;
  opacity: 0.95;
  font-weight: 500;
}

.brand-hero-description {
  margin: 0;
  opacity: 0.9;
  max-width: 820px;
}

.brand-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
  color: var(--stat-color, rgba(255, 255, 255, 0.9));
  border-color: var(--stat-color, rgba(255, 255, 255, 0.35));
}

.brand-mini-nav {
  margin: -0.15rem 0 1rem 0;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  background: #fff;
  position: sticky;
  top: 12px;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.brand-mini-nav-header {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brand-mini-nav-title {
  font-size: 0.78rem;
  color: #6c757d;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.brand-mini-nav-crumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 0.75rem;
}

.brand-mini-nav-crumb {
  border: none;
  background: transparent;
  color: #64748b;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.brand-mini-nav-crumb.active {
  color: #0f172a;
  font-weight: 700;
}

.brand-mini-nav-sep {
  color: #94a3b8;
  font-size: 0.68rem;
}

.brand-mini-nav-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.65rem 0.75rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.brand-mini-nav-link,
.brand-mini-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: 320px;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #dce3ea;
  background: #f8fafc;
  color: #334155;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-size: 0.78rem;
  line-height: 1.2;
  scroll-snap-align: start;
  cursor: pointer;
}

.brand-mini-nav-btn {
  font-family: inherit;
  text-align: left;
}

.brand-mini-nav-link:hover,
.brand-mini-nav-btn:hover {
  border-color: #cbd5e1;
  background: #eef2f7;
  color: #0f172a;
}

.brand-mini-nav-link.active,
.brand-mini-nav-btn.active {
  border-color: #111827;
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
}

.brand-mini-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mini-nav-count {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.brand-mini-nav-back {
  border: 1px solid #dce3ea;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.brand-mini-nav-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

.brand-mini-nav-empty {
  color: #6b7280;
  font-size: 0.8rem;
  padding: 0.15rem 0.25rem;
}

.brand-hero-text-on-light {
  color: #1f2937;
}

.brand-hero-text-on-light .brand-hero-stat {
  background: rgba(15, 23, 42, 0.05);
}

[dir="rtl"] .brand-mini-nav-btn {
  text-align: right;
}

[dir="rtl"] .brand-mini-nav-crumbs {
  margin-left: 0;
  margin-right: auto;
}

@media (max-width: 767.98px) {
  .brand-hero-media,
  .brand-hero-body {
    min-height: 200px;
  }

  .brand-logo-frame {
    width: 112px;
    height: 72px;
    padding: 8px 10px;
  }

  .brand-mini-nav {
    top: 8px;
  }
}

/* Without a hero photo the stat chips sat white-on-light and were unreadable. */
.brand-hero-text-on-light .brand-hero-stat {
  --stat-color: #1f2937;
  border-color: rgba(15, 23, 42, 0.12);
}

/* ── Phones: one compact brand header, chip-style category links, category-page margins ── */
@media (max-width: 767.98px) {
  .brand-page .brand-page-topbar {
    display: none !important;
  }

  .brand-page .brand-hero {
    margin: 0.6rem 0 0.75rem;
  }

  .brand-page .brand-hero-media,
  .brand-page .brand-hero-body {
    min-height: 0;
  }

  .brand-page .brand-hero-body {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem;
  }

  .brand-page .brand-logo-frame {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    padding: 6px;
    border-radius: 14px;
  }

  .brand-page .brand-hero-title {
    margin-bottom: 0.15rem;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
  }

  .brand-page .brand-hero-tagline,
  .brand-page .brand-hero-description {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
  }

  .brand-page .brand-hero-stat {
    margin-top: 0.2rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
  }

  /* Category links: the same swipeable chips as the category page. */
  .brand-page .brand-mini-nav {
    position: static;
    margin-bottom: 0.6rem;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .brand-page .brand-mini-nav-header {
    padding: 0 0.15rem 0.35rem;
    border: 0;
  }

  .brand-page .brand-mini-nav-title {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: start;
  }

  /* At the top level the crumb trail is a lone "Top" link that goes nowhere new. */
  .brand-page .brand-mini-nav-crumbs:has(> .brand-mini-nav-crumb:only-child) {
    display: none;
  }

  .brand-page .brand-mini-nav-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    padding: 0 0 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .brand-page .brand-mini-nav-scroll::-webkit-scrollbar {
    display: none;
  }

  .brand-page .brand-mini-nav-link,
  .brand-page .brand-mini-nav-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 0.42rem 0.9rem;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-size: 0.8rem;
    text-decoration: none !important;
    white-space: nowrap;
  }

  .brand-page .brand-mini-nav-link.active,
  .brand-page .brand-mini-nav-btn.active {
    border-color: #111;
    background: #111;
    color: #fff;
  }

  .brand-page .brand-mini-nav-label,
  .brand-page .brand-mini-nav-count {
    text-decoration: none !important;
  }

  .brand-page .brand-mini-nav-count {
    margin-inline-start: 0.25rem;
    opacity: 0.6;
  }

  .brand-page .brand-mini-nav-btn .fa-chevron-right,
  .brand-page .brand-mini-nav-btn .fa-chevron-left,
  .brand-page .brand-mini-nav-link .fa-layer-group {
    display: none;
  }

  /* Same grid margins as the category page. */
  .brand-page .row.g-0.px-3 {
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
  }

  .brand-page .products-content-col {
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
  }

  .brand-page .product-grid-row {
    --bs-gutter-x: 0.55rem;
    --bs-gutter-y: 0.75rem;
  }
}
