/**
 * Bonlineco Brand Frontend (Luma) styles.
 *
 * Inherits the host theme's type; personality comes from scale and structure:
 * a sticky directory head (search + live A-Z rail) and ghost-letter group
 * markers. Dependency-light: flexbox + CSS grid; degrades without JS.
 * RTL-safe via logical properties where practical.
 *
 * Palette: ink #17212e | slate #5b6675 | line #e3e7ee | wash #f6f8fb | accent #2662f0
 */

.bon-brands-page {
    margin: 0 auto;
    max-width: 1280px;
}

.bon-brands-page__empty,
.bon-brand-products__empty {
    padding: 24px 0;
    color: #5b6675;
    font-size: 1.4rem;
}

/* ---------- Featured strip / slider ---------- */
.bon-brands-featured {
    position: relative;
    margin-bottom: 8px;
}

.bon-brands-featured.is-hidden {
    display: none;
}

.bon-brands-featured__title,
.bon-brand-widget__title,
.bon-more-from__title {
    margin: 0 0 14px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #17212e;
}

.bon-brands-featured__viewport {
    position: relative;
    overflow: hidden;
}

.bon-brands-featured__track {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin: 0;
    list-style: none;
}

.bon-brand-slide {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 156px;
    height: 92px;
    padding: 12px;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bon-brand-slide:hover {
    border-color: #c6d2ea;
    box-shadow: 0 6px 18px -8px rgba(23, 33, 46, .18);
    transform: translateY(-2px);
    text-decoration: none;
}

.bon-brand-slide__img {
    max-width: 100%;
    max-height: 66px;
    object-fit: contain;
}

.bon-brand-slide__name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #17212e;
    text-align: center;
}

/* Slider enhancement controls (added by brand-slider.js) */
.bon-brand-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid #e3e7ee;
    border-radius: 50%;
    background: #fff;
    color: #17212e;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(23, 33, 46, .12);
}

.bon-brand-slider__nav--prev {
    inset-inline-start: -6px;
}

.bon-brand-slider__nav--next {
    inset-inline-end: -6px;
}

/* ---------- Directory head: search + live A-Z rail ---------- */
.bon-brands-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin: 0 0 10px;
    padding: 14px 0;
    background: #fff;
    border-bottom: 1px solid #e3e7ee;
}

.bon-brands-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
    min-width: 220px;
}

.bon-brands-search__icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #5b6675;
    pointer-events: none;
}

/* Element+attribute in the selector so the theme's input[type="search"]
   rules cannot out-specify the icon inset. */
.bon-brands-search input.bon-brands-search__input,
.bon-brands-search input.bon-brands-search__input:focus {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    padding-inline-start: 42px;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    background: #f6f8fb;
    font-size: 1.4rem;
    color: #17212e;
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease;
}

.bon-brands-search input.bon-brands-search__input::placeholder {
    color: #8a94a6;
}

.bon-brands-search input.bon-brands-search__input:focus {
    border-color: #2662f0;
    background: #fff;
    outline: none;
}

.bon-brands-azbar {
    flex: 2 1 320px;
    min-width: 0;
}

.bon-brands-azbar__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bon-brands-azbar__item {
    margin: 0;
}

.bon-brands-azbar__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e3e7ee;
    border-radius: 999px;
    background: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: #17212e;
    transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}

.bon-brands-azbar__pill:hover {
    border-color: #17212e;
    color: #17212e;
    text-decoration: none;
}

.bon-brands-azbar__pill.is-active,
.bon-brands-azbar__pill.is-active:hover {
    border-color: #2662f0;
    background: #2662f0;
    color: #fff;
}

.bon-brands-azbar__pill.is-empty {
    opacity: .35;
}

.bon-brands-azbar__pill--all {
    padding: 0 14px;
    letter-spacing: .02em;
}

.bon-brands-head__meta {
    flex: 0 0 auto;
    margin: 0;
    margin-inline-start: auto;
    font-size: 1.25rem;
    color: #5b6675;
    white-space: nowrap;
}

/* ---------- Letter groups with ghost markers ---------- */
.bon-brands-group {
    position: relative;
    margin: 0 0 8px;
    padding: 26px 0 30px;
    scroll-margin-top: 96px;
}

.bon-brands-group.is-hidden {
    display: none;
}

.bon-brands-group + .bon-brands-group {
    border-top: 1px solid #eef1f6;
}

.bon-brands-group__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}

.bon-brands-group__title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.01em;
    color: #17212e;
}

.bon-brands-group__count {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f6f8fb;
    border: 1px solid #e3e7ee;
    font-size: 1.15rem;
    font-weight: 600;
    color: #5b6675;
}

/* ---------- Brand grid + cards (shared with widgets) ---------- */
.bon-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bon-brands-grid__item {
    margin: 0;
}

.bon-brands-grid__item.is-hidden {
    display: none;
}

.bon-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 20px 14px 16px;
    border: 1px solid #e3e7ee;
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    text-align: center;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bon-brand-card:hover {
    border-color: #c6d2ea;
    box-shadow: 0 10px 24px -10px rgba(23, 33, 46, .2);
    transform: translateY(-3px);
    text-decoration: none;
}

.bon-brand-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 72px;
}

.bon-brand-card__logo img {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.bon-brand-card__placeholder {
    font-size: 1.6rem;
    font-weight: 700;
    color: #17212e;
}

.bon-brand-card__name {
    font-size: 1.35rem;
    font-weight: 600;
    color: #17212e;
    word-break: break-word;
}

.bon-brand-card__count {
    font-size: 1.2rem;
    color: #5b6675;
}

.bon-brand-card__count::before {
    content: '(';
}

.bon-brand-card__count::after {
    content: ')';
}

.bon-brands-directory__empty {
    padding: 40px 0 56px;
    font-size: 1.5rem;
    color: #5b6675;
    text-align: center;
}

/* ---------- Brand landing (view) ---------- */
.bon-brand-view__header {
    margin-bottom: 24px;
    text-align: center;
}

.bon-brand-view__logo {
    margin-bottom: 12px;
}

.bon-brand-view__logo img {
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
}

.bon-brand-view__title {
    margin: 0 0 10px;
    font-size: 2.6rem;
}

.bon-brand-view__description {
    max-width: 820px;
    margin: 0 auto;
    color: #5b6675;
    font-size: 1.4rem;
    line-height: 1.6;
}

/* ---------- Product grids (view + more-from) ---------- */
.bon-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bon-product-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 12px;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
}

.bon-product-card:hover {
    box-shadow: 0 6px 18px -8px rgba(23, 33, 46, .18);
    text-decoration: none;
}

.bon-product-card__img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
}

.bon-product-card__img img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.bon-product-card__name {
    font-size: 1.3rem;
    color: #17212e;
}

.bon-product-card__price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #17212e;
}

/* ---------- "More from brand" (PDP) ---------- */
.bon-more-from {
    position: relative;
    margin: 32px 0;
}

.bon-more-from__track {
    align-items: stretch;
}

.bon-more-from__item {
    flex: 0 0 auto;
    width: 200px;
}

.bon-more-from__item .bon-product-card {
    width: 100%;
}

/* ---------- Brand logo on PDP ---------- */
.bon-product-brand {
    margin: 10px 0;
}

.bon-product-brand__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.bon-product-brand__logo {
    object-fit: contain;
}

.bon-product-brand__name {
    font-size: 1.4rem;
    font-weight: 600;
}

/* ---------- Widgets ---------- */
.bon-brand-widget {
    margin: 20px 0;
}

/* ---------- Accessibility ---------- */
.bon-brands-azbar__pill:focus-visible,
.bon-brand-card:focus-visible,
.bon-brand-slide:focus-visible,
.bon-brands-search__input:focus-visible {
    outline: 2px solid #2662f0;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bon-brand-card,
    .bon-brand-slide,
    .bon-brands-azbar__pill,
    .bon-brands-search__input {
        transition: none;
    }

    .bon-brand-card:hover,
    .bon-brand-slide:hover {
        transform: none;
    }

    .bon-brands-featured__track {
        scroll-behavior: auto;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .bon-brands-head {
        position: static;
        padding: 10px 0;
    }

    .bon-brands-head__meta {
        display: none;
    }

    .bon-brands-group {
        padding: 18px 0 22px;
    }

}

@media (max-width: 640px) {
    .bon-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    }

    .bon-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .bon-brand-slide {
        width: 124px;
        height: 78px;
    }
}
