@charset "UTF-8";

/* Shared directory behavior for brands, perfumers and years.
 * Generic page hierarchy, cards, controls, tabs, popovers, grids and dark-mode
 * surfaces come from design-system.css + design-patterns.css.
 */

.brand-directory-page {
  --theme-accent: var(--color-amber, #c97232);
  --ui-context-accent: var(--theme-accent);
  --brand-directory-inline-gutter: clamp(1rem, 3vw, 1.5rem);
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

.brand-directory-layout {
  width: auto;
  max-width: none;
  justify-self: stretch;
  margin-inline: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-page-gap, clamp(1.4rem, 3vw, 2.4rem));
  min-width: 0;
}

.brand-directory-page__header {
  --ui-context-accent: var(--theme-accent);
}

.directory-intro--mobile {
  display: none;
}

/* Toolbar ---------------------------------------------------------------- */
.brand-toolbar {
  position: relative;
  z-index: 25;
}

.brand-toolbar.ui-filter-bar {
  flex-wrap: wrap;
  width: auto;
  max-width: none;
  justify-self: stretch;
  margin-inline: var(--brand-directory-inline-gutter);
}

.brand-toolbar__meta {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-toolbar__count,
.brand-chips__count {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.brand-toolbar__reset.is-hidden,
.brand-chips__reset.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.brand-toolbar__controls {
  flex: 1 1 100%;
  min-width: 0;
}

.brand-search {
  min-width: 0;
}

.brand-search__field {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 3rem 0 2.7rem;
}

.brand-search__icon {
  position: absolute;
  left: 1rem;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--ui-text-muted);
  pointer-events: none;
}

.brand-search__input.ui-input {
  min-height: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.brand-search__input::placeholder {
  color: var(--ui-text-soft);
}

.brand-search__clear.ui-icon-button {
  position: absolute;
  right: 0.45rem;
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.brand-filters--desktop {
  display: flex;
  align-items: stretch;
  gap: var(--ui-space-2);
}

.brand-filters--mobile {
  display: none;
}

.brand-dropdown {
  position: relative;
  min-width: 0;
}

.brand-dropdown__trigger.ui-button {
  min-width: 142px;
  display: grid;
  justify-items: start;
  gap: 0.1rem;
  padding: 0.55rem 0.8rem;
  text-align: left;
}

.brand-dropdown__label {
  color: var(--ui-text-soft);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-dropdown__value {
  color: var(--ui-text);
  font-size: 0.9rem;
}

.brand-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  min-width: 230px;
  max-height: min(18rem, 45vh);
  max-height: min(18rem, 45dvh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.brand-dropdown__menu[hidden] {
  display: none;
}

.brand-dropdown__option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-text);
  font: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.brand-dropdown__option:hover,
.brand-dropdown__option:focus-visible,
.brand-dropdown__option[aria-selected="true"] {
  background: color-mix(in srgb, var(--theme-accent) 7%, var(--ui-surface-subtle));
  outline: 0;
}

/* A–Z navigation --------------------------------------------------------- */
.brand-az {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  min-width: 0;
}

.brand-segmented {
  flex: 0 0 auto;
}

.brand-segmented__btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.brand-az__rail {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
}

.brand-az__rail::-webkit-scrollbar {
  display: none;
}

.brand-az__letter.ui-chip {
  min-width: 31px;
  min-height: 31px;
  justify-content: center;
  padding: 0.3rem 0.4rem;
  border-color: transparent;
  background: transparent;
  cursor: pointer;
}

.brand-az__letter:hover,
.brand-az__letter:focus-visible,
.brand-az__letter.is-active {
  border-color: var(--ui-border);
  background: var(--ui-surface-subtle);
  color: var(--ui-text);
}

.brand-az__letter:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

/* Results ---------------------------------------------------------------- */
.brand-results {
  position: relative;
  display: grid;
  gap: var(--ui-space-4);
  width: auto;
  max-width: none;
  justify-self: stretch;
  margin-inline: 0;
  min-width: 0;
}

.brand-results__skeleton {
  display: none;
  gap: var(--ui-space-4);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.brand-results__skeleton.is-visible {
  display: grid;
}

.brand-results__skeleton[hidden] {
  display: none;
}

.brand-skeleton-card {
  position: relative;
  height: 84px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface-subtle);
}

.brand-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 58%, transparent), transparent);
  transform: translateX(-100%);
  animation: brandShimmer 1100ms ease-in-out infinite;
}

.brand-grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brand-grid__item {
  min-width: 0;
  margin: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 84px;
}

.brand-grid__item[hidden] {
  display: none;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 84px;
  padding: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand-card.ui-card--interactive:hover,
.brand-card.ui-card--interactive:focus-visible {
  border-color: color-mix(in srgb, var(--theme-accent) 22%, var(--ui-border));
}

.brand-card__logo {
  width: 68px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: #fff;
}

.brand-card__logo img {
  width: 100%;
  height: 100%;
  display: block;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  padding: 6px;
}

.brand-card__monogram {
  color: var(--ui-text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 650;
}

.brand-card__body {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.brand-card__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ui-text);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brand-card__meta {
  overflow: hidden;
  color: var(--ui-text-muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-directory-page--brands .brand-card__name {
  -webkit-line-clamp: 1;
}

.brand-empty[hidden] {
  display: none;
}

.brand-empty__title,
.brand-empty__hint {
  margin: 0;
}

.brand-empty__title {
  color: var(--ui-text);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.brand-empty__hint {
  color: var(--ui-text-muted);
}

/* Mobile sheet and utility controls -------------------------------------- */
.brand-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 35;
}

.brand-to-top[hidden],
.brand-sheet[hidden] {
  display: none;
}

.brand-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
}

.brand-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 24, 0.52);
  backdrop-filter: blur(8px);
}

.brand-sheet__panel.ui-card {
  position: relative;
  width: 100%;
  max-height: 78vh;
  overflow: hidden;
  border-radius: var(--ui-radius-xl) var(--ui-radius-xl) 0 0;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  box-shadow: var(--ui-shadow-3);
}

.brand-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem;
  border-bottom: 1px solid var(--ui-border);
}

.brand-sheet__title {
  margin: 0;
  color: var(--ui-text);
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.brand-sheet__close.ui-icon-button {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

.brand-sheet__content {
  display: grid;
  gap: 0.45rem;
  max-height: 62vh;
  overflow: auto;
  padding: 0.75rem 0.85rem 0;
}

.brand-sheet__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface-subtle);
  color: var(--ui-text);
  font-size: 0.95rem;
}

.brand-sheet__option[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--theme-accent) 24%, var(--ui-border));
  background: color-mix(in srgb, var(--theme-accent) 7%, var(--ui-surface-subtle));
}

.brand-sheet__option:disabled {
  opacity: 0.4;
}

.brand-chips {
  display: grid;
  gap: var(--ui-space-3);
}

.brand-chips__rail {
  display: flex;
  gap: var(--ui-space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.brand-chips__rail::-webkit-scrollbar {
  display: none;
}

.brand-chip.ui-chip {
  flex: 0 0 auto;
  cursor: pointer;
}

.brand-chip--ghost {
  border-style: dashed;
}

.brand-chips__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Responsive -------------------------------------------------------------- */
/* Mobile catalogues share the directory's editorial hierarchy and gutters. */
@media (max-width: 720px) {
  .filtrage-section.brand-directory-page.page-section--flush {
    width: calc(100% - 1rem);
    margin-inline: auto;
    padding: 1.25rem 0 1.5rem;
    background: var(--ui-surface);
    border-radius: var(--ui-radius-lg);
  }

  .filtrage-section.brand-directory-page .filtrage-layout {
    padding-inline: 0.75rem;
    gap: 1.25rem;
  }

  .filtrage-section.brand-directory-page.page-section--flush .brand-directory-page__header {
    margin-top: 0;
    padding: 0;
    border: 0;
    gap: 0.5rem;
  }

  .filtrage-section.brand-directory-page.page-section--flush .brand-directory-page__title {
    font-family: var(--font-editorial);
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.04em;
  }

  .filtrage-section.brand-directory-page .page-kicker {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 1024px) {
  .brand-grid.ui-grid--cards,
  .perfumer-grid.ui-grid--cards,
  .brand-results__skeleton.is-visible {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .brand-directory-page {
    padding-block: 1rem 2rem;
  }

  .brand-directory-layout {
    gap: clamp(1rem, 4vw, 1.5rem);
  }

  .directory-intro--desktop {
    display: none;
  }

  .directory-intro--mobile {
    display: block;
  }


  .brand-toolbar__controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand-filters--desktop {
    display: none;
  }

  .brand-filters--mobile {
    display: block;
    width: 100%;
  }

  .brand-toolbar__meta {
    display: none;
  }

  /* Brand directory keeps its two compact server-independent dropdowns. */
  .brand-directory-page--brands .brand-toolbar__meta {
    display: flex;
  }

  .brand-directory-page--brands .brand-filters--desktop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .brand-directory-page--brands .brand-dropdown__trigger.ui-button {
    width: 100%;
    min-width: 0;
  }

  .brand-directory-page--brands .brand-filters--mobile,
  .brand-az {
    display: none;
  }

  .brand-grid.ui-grid--cards,
  .perfumer-grid.ui-grid--cards,
  .brand-results__skeleton.is-visible {
    grid-template-columns: 1fr;
  }

  .brand-card {
    min-height: 72px;
    padding: 0.75rem;
  }

  .brand-card__logo {
    width: 58px;
    height: 52px;
  }
}

@media (max-width: 720px) {
  .brand-toolbar.ui-filter-bar {
    flex-wrap: nowrap;
  }
}

@media (max-width: 640px) {
  .brand-dropdown__menu {
    left: auto;
    right: 0;
    width: min(16rem, calc(100vw - 6rem));
    min-width: 0;
  }

  .brand-dropdown:first-child .brand-dropdown__menu {
    left: 0;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-skeleton-card::after {
    animation: none;
  }
}

@keyframes brandShimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(110%); }
}
