.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 30px;
    padding: 0;
    margin: 0;
}

.woocommerce nav.woocommerce-pagination ul {
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: none;
    padding: 5px;
}

.woocommerce nav.woocommerce-pagination ul li a {
    color: var(--gray_3, #A9A9A9);
    /* H4 */
    font-family: Involve;
    font-size: 24px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
    text-decoration: none;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    border-radius: 2px;
    color: var(--white, #FFF);
    /* H4 */
    font-family: Involve;
    font-size: 24px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
    background: var(--purple_dark, #272630);
    box-shadow: 0 4px 50px 0 rgba(151, 163, 183, 0.15);
    border: none;
}

.woocommerce nav.woocommerce-pagination ul li a:not(.prev):not(.next):hover {
    background: none;
    color: var(--purple_dark, #272630);
}

.prev.page-numbers {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='47' height='23' viewBox='0 0 47 23' fill='none'%3E%3Cpath d='M45.5 12.5459H47V9.54593H45.5V11.0459V12.5459ZM0.439339 9.98527C-0.146446 10.5711 -0.146446 11.5208 0.439339 12.1066L9.98528 21.6525C10.5711 22.2383 11.5208 22.2383 12.1066 21.6525C12.6924 21.0667 12.6924 20.117 12.1066 19.5312L3.62132 11.0459L12.1066 2.56065C12.6924 1.97486 12.6924 1.02511 12.1066 0.439327C11.5208 -0.14646 10.5711 -0.14646 9.98528 0.439327L0.439339 9.98527ZM45.5 11.0459V9.54593L1.5 9.54593V11.0459V12.5459L45.5 12.5459V11.0459Z' fill='%23514F5C'/%3E%3C/svg%3E") !important;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    width: 47px;
    height: 23px;
}

.woocommerce nav.woocommerce-pagination ul li a.prev:hover,
.woocommerce nav.woocommerce-pagination ul li a.next:hover {
    background-color: transparent;
}

.next.page-numbers {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='47' height='23' viewBox='0 0 47 23' fill='none'%3E%3Cpath d='M1.5 9.54593H0V12.5459H1.5V11.0459V9.54593ZM46.5607 12.1066C47.1464 11.5208 47.1464 10.5711 46.5607 9.98527L37.0147 0.439327C36.4289 -0.14646 35.4792 -0.14646 34.8934 0.439327C34.3076 1.02511 34.3076 1.97486 34.8934 2.56065L43.3787 11.0459L34.8934 19.5312C34.3076 20.117 34.3076 21.0667 34.8934 21.6525C35.4792 22.2383 36.4289 22.2383 37.0147 21.6525L46.5607 12.1066ZM1.5 11.0459V12.5459H45.5V11.0459V9.54593H1.5V11.0459Z' fill='%23514F5C'/%3E%3C/svg%3E") !important;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    width: 47px;
    height: 23px;
}

.woocommerce-ordering.custom-ordering {
    position: relative;
    display: flex;
    width: 100%;
    max-width: fit-content;
}

.ordering-visual-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #E0E0E0;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;

}

.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering {
    float: none;
    margin-bottom: 0 !important;
}

.ordering-visual-button .icon-sort {
    width: 20px;

    height: 20px;
    fill: none;

    stroke: #333;

    stroke-width: 1.5px;
}

.ordering-visual-button .ordering-label {
    color: var(--purple_dark, #272630);
    /* H5 */
    font-family: Involve;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
}

.woocommerce-ordering.custom-ordering:hover .ordering-visual-button {
    border-color: #333;
}

.custom-ordering .orderby.overlay-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
}

.category-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Сама плитка */
.cat-tile {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #F3F3F5;
    /* Светло-серый фон */
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    /* Небольшое скругление */
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Количество товаров внутри скобок */
.cat-tile .count {
    margin-left: 5px;
    opacity: 0.7;
    /* Чуть бледнее текста */
    font-size: 0.9em;
}

/* Активное состояние (выбранная категория) */
.cat-tile.active,
.cat-tile:hover {
    background-color: #272630;
    /* Темный фон */
    color: #FFF;
    /* Белый текст */
    border-color: #272630;
}

/* При наведении/активности цвет счетчика тоже белый */
.cat-tile.active .count,
.cat-tile:hover .count {
    opacity: 1;
    color: #FFF;
}









.custom-product-page {
    padding-top: 40px;
}

.product-grid-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* --- ЛЕВАЯ ЧАСТЬ: ГАЛЕРЕЯ --- */
.product-gallery-wrapper {
    width: 60%;
    /* Широкая левая часть */
    min-width: 0;
    /* Фикс для Swiper внутри Flexbox */
}

/* Главный слайдер */
.product-main-slider {
    width: 100%;
    height: 500px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.product-main-slider .main-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Слайдер миниатюр */
.product-thumb-slider {
    height: 100px;
    box-sizing: border-box;
}

.product-thumb-slider .swiper-slide {
    width: 20%;
    height: 100%;
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.3s;
}

.product-thumb-slider .swiper-slide-thumb-active {
    opacity: 1;
}

.product-thumb-slider img {
    width: 100%;
    /*height: 100%;*/
    height: 70px;
    object-fit: cover;
    display: block;
}

/* Стрелки слайдера */
.product-main-slider .swiper-button-next,
.product-main-slider .swiper-button-prev {
    color: #333;
    /* Цвет стрелок */
    transform: scale(0.7);
}

/* --- ПРАВАЯ ЧАСТЬ: ИНФО --- */
.product-info-wrapper {
    width: 40%;
}

.product-title {
    font-weight: 400;
    margin-bottom: 30px;
    font-weight: 500;
    line-height: 110%;
    font-size: 50px;
}

/* Список характеристик */
.product-attributes-list {
    margin-bottom: 30px;
}

.attr-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--graphite, #2A2B31);
    border-bottom: 1px solid #EEE;
    padding: 4px 0;
    font-family: var(--tilda-sans);

}

.attr-label {
    font-weight: 600;
    /* Жирный заголовок атрибута (Материал, Цвет) */
    flex-shrink: 0;
}

/* Линия-точки между названием и значением (опционально, на скрине просто пробел) */
.attr-dots {
    flex-grow: 1;
    border-bottom: 1px solid #eee;
    /* Линия */
    margin: 0 10px 4px 10px;
    /* Отступы, чтобы линия была на уровне текста */
}

/* Если не хотите линию, просто удалите border-bottom у класса выше */

.attr-value a {
    color: #878A87;
    text-align: right;
    max-width: 50%;
}

/* Кнопка */
.product-actions {
    margin-bottom: 30px;
}

.calc-btn {
    display: flex;
    padding: 14px 32px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: stretch;
    border-radius: 2px;
    border: 1px solid var(--purple_gray, #C2C0CB);
    color: var(--purple_gray, #C2C0CB);
    text-align: center;
    font-family: Involve;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 110%;
}

.calc-btn:hover {
    border-color: #333;
    color: #333;
}

/* Описание */
.desc-heading {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 500;
}

.desc-content {
    color: #1B1B24;
    font-family: "Tilda Sans";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 110%;
    margin-bottom: 15px;
}


/* Обертка контента */
.desc-content-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Состояние: СВЕРНУТО */
.desc-content-wrapper.is-collapsed {
    max-height: 120px;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.desc-content-wrapper.is-expanded {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
}

/* Кнопка */
.read-more-trigger {
    color: var(--purple_dark, #272630);

    /* H5 */
    font-family: Involve;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
    /* 22px */
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: none;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
    cursor: pointer;
}

.read-more-trigger:hover {
    color: #000;
    border-color: #000;
}

/* Карточка товара в слайдере */
.rec-card {
    display: flex;
    flex-direction: column;
}

.rec-card__img {
    display: block;
    width: 100%;
    height: 250px;
    /* Фиксируем высоту фото */
    overflow: hidden;
    margin-bottom: 15px;
    background: #f5f5f5;
}

.rec-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.rec-card:hover .rec-card__img img {
    transform: scale(1.03);
}

.rec-card__title {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 10px 0;
    line-height: 110%;
}

.rec-card__title a {
    color: #333;
    text-decoration: none;
}

.rec-card__link {
    font-size: 14px;
    color: #666;
    text-decoration: underline;
    align-self: flex-start;
}

.rec-card__link:hover {
    color: #000;
}

.rec-pagination {
    position: relative !important;
    margin-top: 30px;
    bottom: 0 !important;
}

.rec-pagination .swiper-pagination-bullet {
    background: #ccc;
    opacity: 1;
    width: 30px;
    height: 2px;
    border-radius: 0;
    margin: 0 5px !important;
}

.rec-pagination .swiper-pagination-bullet-active {
    background: #333;
}

.rec-footer {
    margin-top: 40px;
    text-align: center;
}

.rec-more-btn {
    display: inline-block;
    padding: 12px 60px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.rec-more-btn:hover {
    border-color: #333;
    background: #333;
    color: #fff;
}

.fv-wrapper {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.fv-content {
    flex: 1;
}

.fv-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.fv-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.fv-title {
    color: var(--h_color, #31313D);
    text-align: center;
    /* H4 */
    font-family: Involve;
    font-size: 24px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
    margin-bottom: 4px;
}

.fv-text {
    color: var(--text, #514F5C);

    /* main */
    font-family: var(--tilda-sans);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 110%;
    /* 17.6px */
}

/* Правая колонка (Видео) */
.fv-video-box {
    flex: 0 0 400px;
    max-width: 100%;
}


.fv-video-box iframe,
.fv-video-box video,
.fv-video-box .wp-block-embed__wrapper {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 9/10;
    border-radius: 8px;
    display: block;
}

.fv-video-box.horizontal-video iframe {
    aspect-ratio: 16/9;
}

.fv-wrapper.no-video-mode .fv-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.fv-wrapper.no-video-mode .fv-item {
    border-bottom: 0;
    border: 1px solid #eee;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 0;
}

.rec-slider .swiper-pagination-bullet-active {
    width: 40px !important;
    background: #2F3140 !important;
}

.products-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filter-button {
    border-radius: 2px;
    border: 1px solid var(--gray, #E1E1E3);
    background: var(--white, #FFF);
    display: flex;
    padding: 8px 20px;
    align-items: center;
    gap: 10px;
    color: var(--purple_dark, #272630);
    /* H5 */
    font-family: Involve;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 110%;
}

.icon-filter {
    position: relative;
    top: 6px;
}


.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Полупрозрачный черный */
    z-index: 9998;
    /* Высокий слой */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

/* Когда фильтр открыт, показываем фон */
.filter-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* 2. Блок фильтров (Панель) */
.filters {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    /* Растягиваем на всю высоту */
    width: 100%;
    max-width: 360px;
    /* Ваше требование */
    background: #fff;
    z-index: 9999;
    /* Поверх фона */
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);

    /* Скрываем за правой границей экрана */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;

    /* Скролл внутри панели, если фильтров много */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Класс для открытия */
.filters.is-active {
    transform: translateX(0);
}

/* 3. Кнопка закрытия (Крестик) */
.filter-close {
    align-self: flex-end;
    /* Прижимаем вправо */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-bottom: 15px;
    color: #333;
}

.filter-close:hover {
    color: #000;
}

.bapf_head h3 {
    font-size: 20px !important;
    margin-bottom: 10px;
}

.bapf_body ul {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cat-show-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 20px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cat-show-more-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
}
.category-wrapper {
   margin-bottom: 30px;
}
 
/* Опционально: стиль для скрытых элементов при загрузке, 
   на случай если JS долго грузится (хотя inline-стиль в PHP это уже делает) */
.cat-tile.cat-hidden {
    /* display: none; - это уже прописано в HTML через style="display:none" */
}

/* Адаптив */
@media (max-width: 992px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }

    .fv-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .fv-video-box {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .product-grid-layout {
        flex-direction: column;
        gap: 20px;
    }

    .product-gallery-wrapper,
    .product-info-wrapper {
        width: 100%;
    }

    .product-main-slider {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .fv-wrapper.no-video-mode .fv-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .products {
        grid-template-columns: 1fr;
    }

    .product-title {
        font-size: 36px;
    }
    .ordering-label {
        display: none;
    }
    .ordering-visual-button {
        min-width: auto;
        max-width: fit-content;
    }
}