/* ============================================
   Brands A-Z Menu — DiParfum.com
   ============================================ */

/* Hide "Все бренды" link in top header menu — replaced by A-Z bar */
a.header-menu__link[href="/brands/"] {
    display: none !important;
}

/* Mobile: keep header always visible (override Aspro scroll-hide behavior) */
@media (max-width: 991px) {
    #mobileheader {
        top: 0 !important;
    }

    .dp-brands-bar {
        position: relative !important;
        top: auto !important;
        background: rgb(248, 248, 252) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Hide Aspro bottom icons panel (Главная, Каталог, Корзина...) on mobile */
.bottom-icons-panel {
    display: none !important;
}

/* --- Alphabet Bar --- */
.dp-brands-bar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(232, 232, 232, 0.3);
    transition: top 0.3s ease;
}

.dp-brands-bar::before,
.dp-brands-bar::after {
    display: none;
}

@media (max-width: 991px) {
    .dp-brands-bar {
        position: sticky;
    }

    .dp-brands-bar::before,
    .dp-brands-bar::after {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        width: 48px;
        z-index: 2;
        pointer-events: none;
    }

    .dp-brands-bar::before {
        left: 0;
        background: linear-gradient(to right, #fff 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    }

    .dp-brands-bar::after {
        right: 0;
        background: linear-gradient(to left, #fff 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    }
}

/* Кнопки лэндингов — по центру */
.header__bottom-inner {
    justify-content: center !important;
}

.dp-brands-bar.dp-brands-bar--fixed {
    top: 79px;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    /* No position/z-index — inherits stacking from headerfixed parent.
       Header popups (z-index:110) will be above bar. */
}

.dp-brands-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
}

.dp-brands-bar__inner::-webkit-scrollbar {
    display: none;
}

.dp-brands-bar__letter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: none;
    background: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    user-select: none;
}

.dp-brands-bar__letter:hover {
    background: #f0f0f0;
    color: #000;
}

.dp-brands-bar__letter--active {
    background: #600b82 !important;
    color: #fff !important;
    -webkit-tap-highlight-color: transparent;
    background-image: none !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

.dp-brands-bar__letter--active:hover {
    background: #7a1aa0;
    color: #fff;
}

.dp-brands-bar__letter--empty {
    opacity: 0.25;
    pointer-events: none;
    cursor: default;
}

.dp-brands-bar__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 22px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
    line-height: 1;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.dp-brands-bar__close:hover {
    background: #600b82;
    border-color: #600b82;
    color: #fff;
}

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

.dp-brands-bar__close:not([hidden]) {
    display: flex;
}

/* --- Overlay --- */
.dp-brands-overlay {
    position: fixed;
    inset: 0;
    z-index: 995;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.dp-brands-overlay.dp-brands-overlay--visible {
    opacity: 1;
}

/* --- Dropdown inner bar (letter switcher) --- */
.dp-brands-dropdown__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.dp-brands-dropdown__close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.dp-brands-dropdown__close-btn:hover {
    background: #600b82;
    border-color: #600b82;
    color: #fff;
}

/* --- Dropdown --- */
.dp-brands-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 996;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.dp-brands-dropdown.dp-brands-dropdown--open {
    max-height: 65vh;
    overflow-y: auto;
}

.dp-brands-dropdown__inner {
    padding: 0 20px 20px;
}

/* Header (visible only on mobile) */
.dp-brands-dropdown__header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dp-brands-dropdown__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: none;
}

.dp-brands-dropdown__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
    margin-left: auto;
}

.dp-brands-dropdown__close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Popular brand logos */
.dp-brands-dropdown__logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow: hidden;
}

.dp-brands-dropdown__logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 160px;
    height: 96px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.dp-brands-dropdown__logo-link:hover {
    border-color: #600b82;
}

.dp-brands-dropdown__logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Search */
.dp-brands-dropdown__search {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    margin-bottom: 12px;
    box-sizing: border-box;
    text-align: center;
}

.dp-brands-dropdown__search:focus {
    border-color: #999;
}

/* Filters */
.dp-brands-dropdown__filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    overflow: visible;
    padding-bottom: 2px;
    flex-wrap: nowrap;
}

/* Filter dropdown component */
.dp-brands-filter-dropdown {
    position: relative;
    flex-shrink: 0;
}

.dp-brands-filter-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    line-height: 1;
    height: 34px;
    box-sizing: border-box;
}

.dp-brands-filter-dropdown__toggle:hover {
    border-color: #600b82;
    color: #600b82;
}

.dp-brands-filter-dropdown__toggle--active {
    border-color: #600b82;
    color: #600b82;
    background: #f8f0fc;
}

.dp-brands-filter-dropdown__count {
    font-weight: 600;
    color: #600b82;
}

.dp-brands-filter-dropdown__arrow {
    transition: transform 0.15s;
    flex-shrink: 0;
}

.dp-brands-filter-dropdown--open .dp-brands-filter-dropdown__arrow {
    transform: rotate(180deg);
}

.dp-brands-filter-dropdown__menu {
    position: fixed;
    z-index: 1100;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.dp-brands-filter-dropdown__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.1s;
    white-space: nowrap;
}

.dp-brands-filter-dropdown__option:hover {
    background: #f5f5f5;
}

.dp-brands-filter-dropdown__option input[type="checkbox"] {
    accent-color: #600b82;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dp-brands-dropdown__filter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dp-brands-dropdown__filter-icon path:not([fill="none"]),
.dp-brands-dropdown__filter-icon .st0 {
    fill: #600b82;
}

.dp-brands-filter-dropdown__option-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

.dp-brands-filter-dropdown__separator {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 10px;
}

/* Niche checkbox */
.dp-brands-filter-niche {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
    height: 34px;
    box-sizing: border-box;
}

.dp-brands-filter-niche:hover {
    border-color: #600b82;
    color: #600b82;
}

.dp-brands-filter-niche:has(input:checked) {
    border-color: #600b82;
    color: #600b82;
    background: #f8f0fc;
}

.dp-brands-filter-niche__input {
    accent-color: #600b82;
    width: 16px;
    height: 16px;
}

.dp-brands-filter-niche__hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #bbb;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    cursor: help;
    flex-shrink: 0;
    line-height: 1;
}

.dp-brands-filter-niche__hint:hover {
    border-color: #600b82;
    color: #600b82;
}

.dp-brands-filter-niche__tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 300px;
    width: max-content;
    z-index: 1200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    white-space: normal;
    word-wrap: break-word;
}

/* === Brands Page /brands/ === */
.dp-brands-page {
    padding: 0 0 40px;
}

.dp-brands-page__bar-wrap {
    position: relative;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.dp-brands-page__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 48px;
}

@media (max-width: 991px) {
    .dp-brands-page__bar-wrap::before,
    .dp-brands-page__bar-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 80px;
        z-index: 2;
        pointer-events: none;
    }
    .dp-brands-page__bar-wrap::before {
        left: 0;
        background: linear-gradient(to right, #fff 0%, rgba(255,255,255,0.5) 60%, transparent 100%);
    }
    .dp-brands-page__bar-wrap::after {
        right: 0;
        background: linear-gradient(to left, #fff 0%, rgba(255,255,255,0.5) 60%, transparent 100%);
    }
}

.dp-brands-page__controls {
    text-align: center;
    margin-bottom: 16px;
}

/* Niche page: search + single filter inline */
.dp-brands-page__controls--inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.dp-brands-page__controls--inline .dp-brands-page__search {
    max-width: 400px;
    flex: 1;
    margin: 0 !important;
    height: 38px;
    box-sizing: border-box;
}

.dp-brands-page__controls--inline .dp-brands-filter-dropdown__toggle {
    height: 38px;
    box-sizing: border-box;
}

.dp-brands-page__controls--inline .dp-brands-page__filters {
    margin: 0;
    padding: 0;
}

@media (max-width: 991px) {
    .dp-brands-page__controls--inline {
        flex-wrap: wrap;
    }
    .dp-brands-page__controls--inline .dp-brands-page__search {
        width: 100%;
        max-width: none;
    }
}

.dp-brands-page__search {
    max-width: 500px;
    margin: 0 auto 12px;
}

.dp-brands-page__filters {
    justify-content: center;
}

.dp-brands-page__logos,
#dp-page-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    max-height: none !important;
    overflow: visible !important;
}

.dp-brands-page__list {
    column-count: 3;
    column-gap: 0;
}

.dp-brands-page__list .dp-brands-dropdown__item {
    display: block;
    text-align: left;
    padding: 5px 0 5px 15%;
}

/* Search results: switch to sections layout instead of columns */
.dp-brands-page__list--search {
    column-count: unset !important;
}

.dp-brands-page__list--search .dp-brands-dropdown__letter-group {
    font-size: 20px;
    font-weight: 700;
    color: #600b82;
    padding: 16px 0 6px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 4px;
    text-align: center;
}

.dp-brands-page__list--search .dp-brands-page__search-section {
    column-count: 3;
    column-gap: 0;
    margin-bottom: 8px;
}

.dp-brands-page__list--search .dp-brands-page__search-section .dp-brands-dropdown__item {
    text-align: left;
}

@media (min-width: 992px) and (max-width: 1199px) {
    .dp-brands-page__list--search .dp-brands-page__search-section {
        column-count: 2;
    }
}

@media (max-width: 991px) {
    .dp-brands-page__list--search .dp-brands-page__search-section {
        column-count: 1;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .dp-brands-page__list {
        column-count: 2;
    }
}

@media (max-width: 991px) {
    .dp-brands-page__bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        padding: 0 40px;
        height: 52px;
        scroll-snap-type: x proximity;
        position: relative;
    }
    .dp-brands-page__bar::-webkit-scrollbar { display: none; }
    .dp-brands-page__letter {
        scroll-snap-align: center;
        min-width: 34px;
        height: 34px;
        font-size: 14px;
        font-weight: 500;
    }

    /* Page logos: grid scroll, no height clip */
    #dp-page-logos {
        display: grid !important;
        grid-template-rows: repeat(2, 1fr) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc(33.333% - 6px) !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-height: none !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        scroll-snap-type: x proximity;
    }

    .dp-brands-page__list {
        column-count: 1;
    }

    .dp-brands-page__list .dp-brands-dropdown__item {
        padding-left: 16px;
    }
}

/* Reset filters button */
.dp-brands-filter-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: all 0.15s;
}

.dp-brands-filter-reset:hover {
    border-color: #d33;
    color: #d33;
    background: #fff0f0;
}

@media (max-width: 991px) {
    .dp-brands-filter-reset {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Cross-letter ref */
.dp-brands-dropdown__xref-separator {
    column-span: all;
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0 8px;
    break-before: column;
}

.dp-brands-dropdown__xref-dim {
    opacity: 0.45;
}

.dp-brands-dropdown__xref-hl {
    font-weight: 600;
    opacity: 1;
}

/* Brand list — 3 equal columns */
.dp-brands-dropdown__list {
    column-count: 3;
    column-gap: 0;
}

.dp-brands-dropdown__item {
    display: block;
    text-align: left;
    padding: 5px 0 5px 20%;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    break-inside: avoid;
    transition: color 0.1s;
}

.dp-brands-dropdown__item:hover {
    color: #600b82;
    text-decoration: none;
}

.dp-brands-dropdown__item-count {
    color: #999;
    font-size: 12px;
}

.dp-brands-dropdown__item--popular {
    font-weight: 600;
}

.dp-brands-dropdown__item-country {
    color: #999;
    font-size: 11px;
    margin-left: 4px;
}

/* Empty state */
.dp-brands-dropdown__empty {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
}

/* Letter group header (for search results spanning multiple letters) */
.dp-brands-dropdown__letter-group {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 8px 0 4px;
    break-inside: avoid;
    column-span: all;
}

/* ============================================
   Mobile / Tablet
   ============================================ */

@media (max-width: 991px) {
    .dp-brands-bar__inner {
        justify-content: flex-start;
        padding: 0 40px;
        scroll-snap-type: x proximity;
        scroll-behavior: smooth;
        height: 52px;
    }

    .dp-brands-bar__letter {
        min-width: 34px;
        height: 34px;
        font-size: 14px;
        font-weight: 500;
        padding: 0 4px;
        scroll-snap-align: center;
    }

    /* Dropdown: full-screen panel on mobile */
    .dp-brands-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        max-height: none !important;
        overflow-y: auto;
        transition: transform 0.25s ease;
        transform: translateY(-100%);
    }

    .dp-brands-dropdown.dp-brands-dropdown--open {
        transform: translateY(0);
        max-height: none;
    }

    .dp-brands-dropdown__inner {
        padding: 12px 16px 16px;
        min-height: 100vh;
    }

    .dp-brands-dropdown__list {
        column-count: 1;
    }

    .dp-brands-dropdown__item {
        padding-left: 8px;
    }

    /* Logos: horizontal scroll, 2 rows × 3 columns visible */
    .dp-brands-dropdown__logos {
        display: grid;
        grid-template-rows: repeat(2, 1fr);
        grid-auto-flow: column;
        grid-auto-columns: calc(33.333% - 6px);
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-height: none;
        flex-wrap: nowrap;
        justify-content: center;
        scroll-snap-type: x proximity;
        padding-bottom: 4px;
    }

    .dp-brands-dropdown__logos::-webkit-scrollbar {
        display: none;
    }

    .dp-brands-dropdown__logo-link {
        width: auto;
        height: 64px;
        padding: 8px;
        scroll-snap-align: start;
    }

    .dp-brands-dropdown__title {
        display: block;
    }

    .dp-brands-dropdown__header {
        display: flex;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
        padding: 8px 0;
        margin-bottom: 8px;
    }

    .dp-brands-dropdown__search {
        position: sticky;
        top: 48px;
        z-index: 1;
        background: #fff;
    }

    /* Filter dropdowns on mobile */
    .dp-brands-dropdown__filters {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .dp-brands-filter-dropdown__toggle {
        font-size: 11px;
        padding: 5px 8px;
        gap: 4px;
        height: 28px;
    }

    .dp-brands-filter-niche {
        font-size: 11px;
        padding: 5px 8px;
        gap: 4px;
        height: 28px;
    }

    .dp-brands-dropdown__bar {
        display: none;
    }

    .dp-brands-dropdown__close--mobile {
        display: flex;
        width: 36px;
        height: 36px;
        font-size: 28px;
        color: #333;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
    }

    .dp-brands-filter-niche__hint {
        display: none;
        width: 14px;
        height: 14px;
        font-size: 10px;
    }

    .dp-brands-filter-dropdown__menu {
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        bottom: auto !important;
        right: auto;
        border-radius: 8px;
        max-height: 50vh;
        min-width: 220px;
        width: auto;
        z-index: 1100;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    /* Hide overlay on mobile (dropdown is full-screen) */
    .dp-brands-overlay {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .dp-brands-dropdown__list {
        column-count: 2;
    }
}
