/* Hallmark · v2.0.0 · direction: custom (no theme dealt) · genre: editorial · job: find a brand, then shop it · shape: index-first (search hero → best sellers → sticky A–Z → letter groups of brand sections, each a title, a short description and a product carousel) · signature: the Bodoni brand names over clean product carousels that load as you scroll · sweep: by hand (sloplint/theme scripts not installed in this project) */
/* critique: text-led identity (no logo wall); the products are the pictures — real miniatures with real prices — so each brand is shown, not described; risk is a very long page, answered by the search, the sticky A–Z bar and lazy carousels */
/* waive 44d-partial: the outer theme layout owns the page container; this block caps and centres its own measure inside it */

.brands-dir {
    /* tokens (declared theme block) */
    --bd-ink: #141414;
    --bd-ink-soft: #3a3631;
    --bd-muted: #6b645a;
    --bd-surface: #ffffff;
    --bd-paper: #faf8f4;
    --bd-paper-deep: #efe9df;
    --bd-line: #e4ddd1;
    --bd-line-strong: #141414;
    --bd-gold: #a37e47;
    --bd-gold-ink: #7a5a2c;
    --bd-focus: #a37e47;
    --bd-shadow: 0 10px 28px -14px rgba(20, 20, 20, 0.28);
    --bd-face-display: "Bodoni Moda", "Bodoni 72", "Didot", Georgia, serif;
    --bd-face-body: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

    --bd-measure: 1240px;
    --bd-gutter: clamp(16px, 4vw, 40px);
    --bd-gap: 32px;
    --bd-card-gap: 20px;
    --bd-card-width: calc((100% - 3 * var(--bd-card-gap)) / 4);
    --bd-az-height: 52px;
    --bd-ease: cubic-bezier(0.22, 1, 0.36, 1);

    box-sizing: border-box;
    max-width: var(--bd-measure);
    margin-inline: auto;
    padding: clamp(24px, 5vw, 56px) var(--bd-gutter) clamp(48px, 7vw, 96px);
    font-family: var(--bd-face-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--bd-ink);
}

html:has(.brands-dir),
body:has(.brands-dir) {
    overflow-x: clip;
}

.brands-dir *,
.brands-dir *::before,
.brands-dir *::after {
    box-sizing: border-box;
}

.brands-dir [hidden] {
    display: none !important;
}

/* ---------- hero: headline, one sentence, the search ---------- */
.brands-dir__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-bottom: clamp(28px, 4vw, 44px);
}

.brands-dir__title {
    min-width: 0;
    max-width: 14ch;
    margin: 0;
    font-family: var(--bd-face-display);
    font-size: clamp(40px, 6.2vw, 80px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: var(--bd-ink);
    overflow-wrap: break-word;
}

.brands-dir__lede {
    max-width: 46ch;
    margin: 0;
    font-size: 18px;
    color: var(--bd-muted);
}

.brands-dir__search {
    max-width: 560px;
    margin-top: 10px;
}

.brands-dir__search-label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bd-ink-soft);
}

.brands-dir__search-field {
    position: relative;
}

.brands-dir__search-icon {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bd-muted);
    pointer-events: none;
}

.brands-dir__search-input {
    width: 100%;
    height: 56px;
    padding: 0 8px 0 34px;
    border: 0;
    border-bottom: 2px solid var(--bd-line-strong);
    border-radius: 0;
    background: transparent;
    font-family: var(--bd-face-body);
    font-size: 20px;
    color: var(--bd-ink);
    -webkit-appearance: none;
    appearance: none;
}

.brands-dir__search-input::placeholder {
    color: var(--bd-muted);
    opacity: 1;
}

.brands-dir__search-input:hover {
    border-bottom-color: var(--bd-gold-ink);
}

.brands-dir__search-input:focus {
    outline: none;
}

.brands-dir__search-input:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 4px;
    border-bottom-color: var(--bd-gold-ink);
}

.brands-dir__status {
    min-height: 1.5em;
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--bd-muted);
}

/* ---------- best sellers ---------- */
.brands-dir__popular {
    padding: clamp(24px, 4vw, 40px) 0 clamp(32px, 5vw, 56px);
    border-top: 1px solid var(--bd-line-strong);
}

.brands-dir__h2 {
    min-width: 0;
    margin: 0 0 20px;
    font-family: var(--bd-face-display);
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 500;
    line-height: 1.15;
    color: var(--bd-ink);
    overflow-wrap: break-word;
}

.brands-dir__popular-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--bd-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 900px) {
    .brands-dir__popular-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.bd-pop {
    animation: bd-rise 0.6s var(--bd-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

.bd-pop__link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 16px 0 22px;
    border-top: 1px solid var(--bd-line);
    color: var(--bd-ink);
    text-decoration: none;
}

.bd-pop__rank {
    font-family: var(--bd-face-display);
    font-size: 15px;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--bd-gold-ink);
}

.bd-pop__name {
    min-width: 0;
    font-family: var(--bd-face-display);
    font-size: clamp(22px, 2.4vw, 32px);
    font-weight: 500;
    line-height: 1.1;
    overflow-wrap: break-word;
    transition: transform 0.25s var(--bd-ease), color 0.2s ease;
}

.bd-pop__link:hover .bd-pop__name {
    color: var(--bd-gold-ink);
    transform: translateX(4px);
}

.bd-pop__link:active .bd-pop__name {
    transform: translateX(2px);
}

.bd-pop__link:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 4px;
}

/* ---------- A–Z bar (sticky) ---------- */
.brands-dir__az {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 calc(var(--bd-gutter) * -1);
    padding: 0 var(--bd-gutter);
    background: var(--bd-surface);
    border-top: 1px solid var(--bd-line-strong);
    border-bottom: 1px solid var(--bd-line);
}

.brands-dir__az-list {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.brands-dir__az-list::-webkit-scrollbar {
    display: none;
}

.brands-dir__az-link,
.brands-dir__az-off {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: var(--bd-az-height);
    padding: 0 6px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.brands-dir__az-link {
    color: var(--bd-ink);
    text-decoration: none;
}

.brands-dir__az-link:hover {
    color: var(--bd-gold-ink);
    text-decoration: underline;
    text-underline-offset: 6px;
}

.brands-dir__az-link:active {
    color: var(--bd-gold);
}

.brands-dir__az-link:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: -4px;
}

.brands-dir__az-off {
    color: var(--bd-line);
    cursor: default;
}

/* ---------- letter groups ---------- */
.bd-group {
    padding-top: clamp(28px, 4vw, 44px);
    scroll-margin-top: calc(var(--bd-az-height) + 12px);
}

.bd-group__letter {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    margin: 0;
    font-family: var(--bd-face-display);
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 500;
    line-height: 1;
    color: var(--bd-gold);
    overflow-wrap: break-word;
}

.bd-group__letter::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--bd-line);
}

/* ---------- one brand: title, description, carousel ---------- */
.bd-brand {
    padding: clamp(24px, 3vw, 36px) 0 clamp(28px, 3.5vw, 40px);
    border-bottom: 1px solid var(--bd-line);
    scroll-margin-top: calc(var(--bd-az-height) + 12px);
}

.bd-brand:last-child {
    border-bottom: 0;
}

.bd-brand__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 32px;
    margin-bottom: 18px;
}

.bd-brand__intro {
    min-width: 0;
    flex: 1 1 auto;
}

.bd-brand__name {
    min-width: 0;
    margin: 0;
    font-family: var(--bd-face-display);
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 500;
    line-height: 1.08;
    color: var(--bd-ink);
    overflow-wrap: break-word;
}

.bd-brand__name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bd-brand__name-link:hover {
    color: var(--bd-gold-ink);
}

.bd-brand__name-link:active {
    color: var(--bd-gold);
}

.bd-brand__name-link:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 3px;
}

.bd-brand__desc {
    max-width: 62ch;
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--bd-muted);
}

.bd-brand__aside {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding-bottom: 4px;
}

.bd-brand__count {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--bd-muted);
}

.bd-brand__all {
    font-size: 15px;
    font-weight: 600;
    color: var(--bd-ink);
    text-decoration: underline;
    text-decoration-color: var(--bd-gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    white-space: nowrap;
}

.bd-brand__all:hover {
    color: var(--bd-gold-ink);
}

.bd-brand__all:active {
    color: var(--bd-gold);
}

.bd-brand__all:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 4px;
}

/* ---------- carousel (behaviour: nowosci-carousel.js) ---------- */
.bd-carousel {
    position: relative;
}

.bd-carousel__track {
    display: flex;
    gap: var(--bd-card-gap);
    margin: 0;
    padding: 6px 2px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.bd-carousel__track::-webkit-scrollbar {
    display: none;
}

.bd-carousel__track:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 3px;
}

.bd-carousel.is-dragging .bd-carousel__track {
    scroll-snap-type: none;
    scroll-behavior: auto;
    cursor: grabbing;
}

.bd-carousel.is-dragging .bd-carousel__track,
.bd-carousel.is-dragging .bd-carousel__track * {
    user-select: none;
}

.bd-carousel__track > .product-miniature,
.bd-carousel__track > .bd-skeleton {
    flex: 0 0 var(--bd-card-width);
    width: var(--bd-card-width);
    max-width: var(--bd-card-width);
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}

.bd-carousel__nav {
    position: absolute;
    top: 38%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--bd-line-strong);
    border-radius: 50%;
    background: var(--bd-surface);
    color: var(--bd-ink);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.2s var(--bd-ease), opacity 0.2s ease;
}

.bd-carousel__nav--prev { left: -12px; }
.bd-carousel__nav--next { right: -12px; }

.bd-carousel__nav:hover {
    transform: translateY(-50%) scale(1.06);
}

.bd-carousel__nav:active {
    transform: translateY(-50%) scale(0.96);
}

.bd-carousel__nav:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 3px;
}

.bd-carousel__nav[disabled] {
    opacity: 0.3;
    cursor: default;
    transform: translateY(-50%);
}

.bd-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.bd-carousel__dots:empty {
    display: none;
}

.bd-carousel__dots .nowosci-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 1px solid var(--bd-ink);
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.bd-carousel__dots .nowosci-carousel__dot--active {
    background: var(--bd-ink);
}

.bd-carousel__dots .nowosci-carousel__dot:hover {
    background: var(--bd-gold);
    border-color: var(--bd-gold);
}

.bd-carousel__dots .nowosci-carousel__dot:focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 3px;
}

/* skeleton cards while a carousel loads */
.bd-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: bd-pulse 1.4s ease-in-out infinite;
}

.bd-skeleton__img {
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--bd-paper-deep);
}

.bd-skeleton__line {
    display: block;
    width: 80%;
    height: 12px;
    background: var(--bd-paper-deep);
}

.bd-skeleton__line--short {
    width: 45%;
}

/* product cards — carousel context only; miniature internals stay store-wide */
.bd-carousel__track > .product-miniature {
    background: var(--bd-surface);
    border: 1px solid var(--bd-line);
    transition: transform 0.25s var(--bd-ease), box-shadow 0.25s ease, border-color 0.2s ease;
}

.bd-carousel__track > .product-miniature:hover {
    transform: translateY(-4px);
    box-shadow: var(--bd-shadow);
    border-color: var(--bd-ink);
}

.bd-carousel__track > .product-miniature .thumbnail-container {
    height: 100%;
}

.bd-carousel__track > .product-miniature .product-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ---------- empty state ---------- */
.brands-dir__empty {
    max-width: 48ch;
    margin: 32px 0 0;
    font-size: 18px;
    color: var(--bd-ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
    .brands-dir {
        --bd-card-gap: 16px;
        --bd-card-width: calc((100% - 2 * var(--bd-card-gap)) / 3);
    }

    .bd-carousel__nav--prev { left: 4px; }
    .bd-carousel__nav--next { right: 4px; }
}

@media (max-width: 767px) {
    .brands-dir {
        --bd-card-gap: 14px;
        --bd-card-width: calc((100% - var(--bd-card-gap)) / 2);
    }

    .bd-brand__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .bd-brand__aside {
        flex-direction: row;
        align-items: baseline;
        gap: 16px;
    }

    .bd-carousel__nav {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 479px) {
    .brands-dir {
        --bd-card-width: 70%;
    }
}

/* ---------- motion ---------- */
@keyframes bd-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bd-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .bd-pop,
    .bd-skeleton { animation: none; }
    .bd-pop__name,
    .bd-brand__name-link,
    .bd-carousel__nav,
    .bd-carousel__track > .product-miniature { transition: none; }
    .bd-pop__link:hover .bd-pop__name,
    .bd-pop__link:active .bd-pop__name,
    .bd-carousel__track > .product-miniature:hover { transform: none; }
    .bd-carousel__track { scroll-behavior: auto; }
}
