/* =============================================
   BeeBeauty — Фільтр каталогу (сайдбар справа)
   ============================================= */

/* Лейаут: фільтр зліва, товари справа — розтягуємо на всю ширину вікна */
/* Знімаємо обмеження контейнера Storefront для каталогу */
body.woocommerce-shop .col-full,
body.post-type-archive-product .col-full,
body.tax-product_cat .col-full,
body.tax-product_brand .col-full {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Прибираємо порожній банер бренду якщо немає зображення */
body.tax-product_brand .woocommerce-products-header__image:empty,
body.tax-product_brand .woocommerce-products-header__image img[src=""] {
    display: none;
}

/* Стискаємо зайві відступи на сторінках бренду і категорії */
body.tax-product_brand .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header {
    padding-top: 8px;
    padding-bottom: 4px;
    margin-bottom: 0;
}

body.tax-product_brand .storefront-breadcrumb,
body.tax-product_cat .storefront-breadcrumb {
    margin-bottom: 0;
}

body.tax-product_brand .woocommerce-products-header__title,
body.tax-product_cat .woocommerce-products-header__title {
    margin-bottom: 0;
}

/* Логотип бренду по центру */
body.tax-product_brand .bee-brand-archive-img {
    display: block;
    margin: 12px auto 8px;
    max-height: 80px;
    width: auto;
}

/* Хлібні крихти і заголовок — по центру на десктопі */
body.woocommerce-shop .storefront-breadcrumb,
body.post-type-archive-product .storefront-breadcrumb,
body.tax-product_cat .storefront-breadcrumb,
body.tax-product_brand .storefront-breadcrumb,
body.woocommerce-shop .woocommerce-products-header,
body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header,
body.tax-product_brand .woocommerce-products-header {
    text-align: center;
    padding-left: 42px;
    padding-right: 42px;
}

.bee-catalog-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
}

.bee-catalog-main {
    flex: 1;
    min-width: 0;
    padding: 0 clamp(12px, 2vw, 32px);
}

/* Скидаємо float-лейаут Storefront і ставимо grid */
.bee-catalog-main ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Clearfix Storefront стає grid-клітинкою — прибираємо */
.bee-catalog-main ul.products::before,
.bee-catalog-main ul.products::after {
    display: none !important;
}

/* Скидаємо float-ширини на картках */
.bee-catalog-main ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
}

/* =============================================
   Сайдбар фільтра
   ============================================= */

.bee-filter-sidebar {
    width: 220px;
    flex-shrink: 0;
    order: 0;
    position: sticky;
    top: 100px;
    background: #fff;
    border-right: 1px solid #F0EAE4;
    border-radius: 0;
    overflow: hidden;
    min-height: 60vh;
    margin-left: 24px;
}

/* Шапка сайдбара */
.bee-filter-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #F0EAE4;
}

.bee-filter-sidebar__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #2B211C;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bee-filter__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #CDB79E;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.bee-filter__reset {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #A89880;
    text-decoration: underline;
    white-space: nowrap;
}

.bee-filter__reset:hover {
    color: #2B211C;
}

/* Форма */
.bee-filter__form {
    padding-bottom: 8px;
}

/* Група атрибута */
.bee-filter__group {
    border-bottom: 1px solid #F0EAE4;
}

.bee-filter__group:last-of-type {
    border-bottom: none;
}

.bee-filter__group-title {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 18px;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #2B211C;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.bee-filter__arrow {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.bee-filter__group-title[aria-expanded="false"] .bee-filter__arrow {
    transform: rotate(-90deg);
}

.bee-filter__group-body {
    padding: 2px 18px 12px;
}

.bee-filter__group-body.is-collapsed {
    display: none;
}

/* Чекбокс-опція */
.bee-filter__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
}

.bee-filter__option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bee-filter__checkbox {
    width: 17px;
    height: 17px;
    border: 1.5px solid #D5CAC0;
    border-radius: 4px;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

.bee-filter__option.is-checked .bee-filter__checkbox {
    background: #CDB79E;
    border-color: #CDB79E;
}

.bee-filter__option.is-checked .bee-filter__checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.bee-filter__label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #2B211C;
    line-height: 1.3;
}

@media (hover: hover) {
    .bee-filter__option:hover .bee-filter__checkbox {
        border-color: #CDB79E;
    }
}

/* Кнопка застосувати */
.bee-filter__actions {
    padding: 12px 18px 16px;
}

.bee-filter__apply {
    width: 100%;
    padding: 10px;
    background: #2B211C;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.bee-filter__apply:hover {
    background: #CDB79E;
}

.bee-filter__reset-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: transparent;
    color: #A89880;
    border: 1px solid #E8E0D8;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.bee-filter__reset-btn:hover {
    color: #2B211C;
    border-color: #2B211C;
}

/* Ієрархія брендів */
.bee-filter__brand-group {
    margin-bottom: 6px;
}

.bee-filter__brand-parent-option {
    margin-bottom: 2px;
}

.bee-filter__brand-parent-label,
.bee-filter__option--brand-solo .bee-filter__label {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #2B211C !important;
}

.bee-filter__brand-children {
    padding-left: 10px;
    border-left: 2px solid #F0EAE4;
    margin-bottom: 6px;
}

/* Стан завантаження */
.bee-catalog--loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Нічого не знайдено */
.bee-filter__no-results {
    padding: 40px 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: #A89880;
    font-size: 15px;
}

/* =============================================
   Оверлей (мобайл)
   ============================================= */

.bee-filter__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(43, 33, 28, 0.45);
    z-index: 998;
}

.bee-filter__overlay.is-visible {
    display: block;
}

/* Topbar — рядок з кнопкою фільтра і сортуванням */
.bee-catalog-topbar {
    display: none;
}

/* Кнопка тогл — прихована на десктопі */
.bee-filter__mobile-toggle {
    display: none;
}

/* Кнопка закрити всередині сайдбара — прихована на десктопі */
.bee-filter__mob-close {
    display: none;
}

/* =============================================
   Планшет
   ============================================= */

@media (max-width: 1024px) {
    .bee-catalog-main ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px !important;
    }
}

/* =============================================
   Мобайл
   ============================================= */

@media (max-width: 768px) {

    /* Прибираємо flex-лейаут — товари на всю ширину */
    .bee-catalog-layout {
        display: block;
    }

    /* Мінімальні бокові відступи */
    .bee-catalog-main {
        padding: 0 8px;
    }

    body.woocommerce-shop .woocommerce-products-header,
    body.post-type-archive-product .woocommerce-products-header,
    body.tax-product_cat .woocommerce-products-header,
    body.tax-product_brand .woocommerce-products-header {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Фільтр — фіксований drawer зліва */
    .bee-filter-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100%;
        z-index: 999;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s ease;
    }

    .bee-filter-sidebar.is-open {
        left: 0;
    }

    /* Кнопка тогл — над товарами */
    .bee-filter__mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        margin-left: 12px;
        flex-shrink: 0;
        background: #fff;
        border: 1px solid #E8E0D8;
        border-radius: 6px;
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        font-weight: 500;
        color: #2B211C;
        cursor: pointer;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    /* Кнопка ✕ закрити в шапці фільтра */
    .bee-filter__mob-close {
        display: block;
        background: none;
        border: none;
        font-size: 18px;
        color: #A89880;
        cursor: pointer;
        margin-left: 8px;
        padding: 0;
        line-height: 1;
    }

    .bee-filter__mob-close:hover {
        color: #2B211C;
    }

    /* Topbar — фільтр зліва, сортування справа */
    .bee-catalog-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 12px 12px 0;
    }

    .bee-filter__mobile-toggle {
        margin-left: 4px;
    }

    /* Сортування — справа в topbar */
    .bee-catalog-topbar .woocommerce-ordering {
        margin: 0 !important;
        flex: 1;
        min-width: 0;
    }

    .bee-catalog-topbar .woocommerce-ordering select {
        width: 100%;
        max-width: 100%;
        font-size: 13px;
        padding: 8px 28px 8px 10px;
        border: 1px solid #E8E0D8;
        border-radius: 6px;
        background-color: #fff;
        color: #2B211C;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232B211C' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        box-sizing: border-box;
    }

    /* 2 колонки на мобайлі */
    .bee-catalog-main ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}



/* =============================================
   Кнопки підкатегорій бренду
   ============================================= */
.bee-brand-subcats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 16px;
}

.bee-brand-subcat-btn {
    display: inline-block;
    padding: 7px 16px;
    border: 1.5px solid #C8A97E;
    border-radius: 20px;
    background: #fff;
    color: #2B211C;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.bee-brand-subcat-btn:hover {
    background: #C8A97E;
    color: #fff;
    text-decoration: none;
}
