/* ============================================= */
/* ==           ПЕРЕМЕННЫЕ И ГЛОБАЛЬНЫЕ         == */
/* ============================================= */
:root {
    --main-text-color: rgba(79, 79, 79, 1);
    --title-font-family: 'Trajan Pro 3', serif;
    --main-font-family: 'Century Gothic', sans-serif;
    --header-font-size: 24px;
    --normal-font-weight: 400;
    --bold-font-weight: 600;
}

/* Скрываем декоративный элемент с цветами на страницах каталога */
.uni-catalog-page img[src$="two-gold-flowers-are-shown-each-other.svg"] {
    display: none !important;
}


/* ============================================= */
/* ==           ОСНОВНАЯ СТРУКТУРА СТРАНИЦЫ     == */
/* ============================================= */
.uni-catalog-page__container {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.uni-catalog-page__body {
    display: flex;
    flex-direction: row;
    gap: 11px;
}

.uni-catalog-filter {
    width: 345px;
    flex-shrink: 0;
    display: none; /* Скрываем по умолчанию */
    background-color: #fafafa;
}
@media (min-width: 1024px) {
    .uni-catalog-filter {
        display: block;
    }
    .uni-catalog-controls__filter-mobile {
        display: none;
    }
}

.uni-catalog-controls__title {
    color: rgba(79, 79, 79, 1);
    font-family: 'Trajan Pro 3', serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 130%;
}

.uni-catalog-page__content {
    flex-grow: 1;
    padding: 0;
    border-left: none;
    padding-top: 20px;
}
.uni-catalog-page--parent .uni-catalog-page__content {
    border: none !important;
    padding: 20px;
}
@media (min-width: 1024px) {
    .uni-catalog-page__content {
        /* Возвращаем границу для ПК */
        padding: 0 0 40px 0;
    }
}


/* ============================================= */
/* ==           ШАПКА И ПАНЕЛЬ ИНСТРУМЕНТОВ     == */
/* ============================================= */

/* --- Блок шапки категории --- */
.uni-catalog-header {
    margin-bottom: 2rem;
    margin-left: -57px;
    margin-top: -40px;
}
.uni-catalog-header__banner {
    position: relative;
    width: 100%;
    height: 235px;
    background-color: #f0f0f0;
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
}
/* .uni-catalog-header__banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

.uni-catalog-header__title {
    font-family: var(--title-font-family);
    font-weight: var(--bold-font-weight);
    font-size: 28px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.uni-catalog-header__no-image {
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-left: 40px;
    display: flex;
    flex-direction: column;
}
.uni-catalog-header__no-image .uni-catalog-header__title {
    color: #333;
    text-shadow: none;
    font-size: 1.8rem;
    order: 2;
}

/* --- Панель инструментов (хлебные крошки + сортировка) --- */
.uni-catalog-toolbar {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 2rem;
    margin-top: 12px;
}
.uni-catalog-toolbar .uni-catalog-breadcrumbs,
.uni-catalog-toolbar .uni-catalog-controls {
    margin: 0;
}
.uni-catalog-toolbar .uni-catalog-controls__actions {
    margin: 0;
}
@media (min-width: 1024px) {
    .uni-catalog-toolbar {
        padding-right: 0;
        margin-top: 60px;
    }
}

/* --- Хлебные крошки --- */
.uni-catalog-breadcrumbs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 3rem 0;
    flex-wrap: wrap;
    align-items: center;
}
.uni-catalog-breadcrumbs__item {
    display: flex;
    align-items: center;
}
.uni-catalog-breadcrumbs__item:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #6c757d;
}
.uni-catalog-breadcrumbs__link {
    color: #4F4F4F;
    text-decoration: none;
}
.uni-catalog-breadcrumbs__link:hover {
    text-decoration: underline;
}

/* Иконка "домой" в хлебных крошках */
.uni-catalog-breadcrumbs__item:first-child .uni-catalog-breadcrumbs__link {
    font-size: 0;
    color: transparent;
}
.uni-catalog-breadcrumbs__item:first-child .uni-catalog-breadcrumbs__link::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    font-size: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%234F4F4F'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 12 8.954-8.955a1.5 1.5 0 0 1 2.122 0l8.954 8.955M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h7.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-top: -2px;
}

/* ============================================= */
/* ==       АДАПТАЦИЯ ШАПКИ И ПАНЕЛИ          == */
/* ============================================= */

/* --- ПК (Desktop) --- */
@media (min-width: 1024px) {
    .uni-catalog-header__banner {
        height: 345px;
    }
    .uni-catalog-header__banner .uni-catalog-header__title {
        position: absolute;
        left: 60px;
        bottom: 60px;
        margin: 0;
    }
    .uni-catalog-back-btn {
        display: none;
    }
}

/* --- Планшеты и Мобильные --- */
@media (max-width: 1023px) {
    .uni-catalog-toolbar .uni-catalog-breadcrumbs {
        display: none; /* На мобильных крошки в тулбаре не нужны */
    }
    .uni-catalog-header__banner .uni-catalog-header__title {
        position: absolute;
        left: 20px;
        bottom: 20px;
        margin: 0;
        font-size: 16px;
    }
    .uni-catalog-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: white;
        border-radius: 99px;
        text-decoration: none;
        font-weight: 500;
    }
    .uni-catalog-back-btn svg {
        width: 20px;
        height: 20px;
    }
    .uni-catalog-header__banner .uni-catalog-back-btn {
        position: absolute;
        top: 20px;
        left: 20px;
    }
    .uni-catalog-header__no-image .uni-catalog-back-btn {
        background: transparent;
        color: #333;
        margin-bottom: 1rem;
        align-self: flex-start;
        order: 1;
    }
    .uni-catalog-controls__actions {
        justify-content: space-between;
    }
    
    .uni-catalog-toolbar .uni-catalog-controls {
        width: 100%;
    }
}


@media (max-width: 820px) {
    .uni-catalog-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 0;
    }

}


/* ============================================= */
/* ==           ПАНЕЛЬ УПРАВЛЕНИЯ И СОРТИРОВКА  == */
/* ============================================= */
.uni-catalog-controls {
    margin: 0; /* Основной margin теперь на .uni-catalog-toolbar */
}
.uni-catalog-controls__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.uni-catalog-controls__sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.uni-catalog-controls__sort-label {
    color: #748059;
    font-family: var(--main-font-family);
    font-style: italic;
    font-size: 16px;
    font-weight: 400;
    line-height: 100%;
    white-space: nowrap;
}
.uni-catalog-sort-dropdown {
    position: relative;
}
.uni-catalog-sort-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    color: #748059;
    font-family: var(--main-font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 100%;
    min-height: 46px;
}
.uni-catalog-sort-dropdown__arrow {
    width: 12px;
    transition: transform 0.2s ease-in-out;
    color: #748059;
}
.uni-catalog-sort-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 100;
    min-width: 200px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
}
.uni-catalog-sort-dropdown.is-active .uni-catalog-sort-dropdown__panel {
    display: block;
}
.uni-catalog-sort-dropdown.is-active .uni-catalog-sort-dropdown__arrow {
    transform: rotate(180deg);
}
.uni-catalog-sort-dropdown__option {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}
.uni-catalog-sort-dropdown__option:hover {
    background-color: #f0f0f0;
}

/* Основная сетка товаров */
.uni-catalog-products--grid {
  display: grid;
  gap: 30px; /* Увеличим gap для лучшей читаемости */
  grid-template-columns: repeat(3, 1fr); /* По умолчанию 3 колонки на десктопе */
  width: 100%;
}
.uni-search-products--grid {
  display: grid;
  gap: 30px; /* Увеличим gap для лучшей читаемости */
  grid-template-columns: repeat(4, 1fr); /* По умолчанию 4 колонки на десктопе */
  width: 100%;
}

/* Планшеты - 2 колонки */
@media (max-width: 1500px) {
  .uni-catalog-products--grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .uni-search-products--grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Мобильные устройства - 2 колонки */
@media (max-width: 640px) {
  .uni-catalog-products--grid,
  .uni-search-products--grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* Очень маленькие экраны - 1 колонка */
@media (max-width: 480px) {
  .uni-catalog-products--grid,
  .uni-search-products--grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Карточка товара */
.uni-catalog-card {
    background-color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    /* Убираем min-width, чтобы карточки правильно адаптировались */
    width: 100%;
    box-sizing: border-box; /* Важно для правильного расчета размеров */
    /* Добавим тень для визуального разделения карточек */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.uni-catalog-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Обертка изображения */
.uni-catalog-card__image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
    margin: -20px -20px 0 -20px; /* Компенсируем padding карточки */
    border-radius: 10px 10px 0 0; /* Скругление только сверху */
    width: calc(100% + 40px); /* Компенсируем отрицательные margin */
}

/* Убедимся, что изображение заполняет контейнер */
.uni-catalog-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Основной контент карточки */
.uni-catalog-card__main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: 20px; /* Уменьшим отступ для компактности */
    padding: 0; /* Убедимся что нет лишних padding */
}

/* Детали товара */
.uni-catalog-card__details {
    flex-grow: 1;
    margin-bottom: 15px; /* Добавим отступ снизу */
}

/* Название товара */
.uni-catalog-card__title {
    color: rgba(0, 0, 0, 1);
    font-family: var(--main-font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 130%;
    text-decoration: none;
    margin: 0 0 11px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Ограничим 2 строками для единообразия */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px; /* Минимальная высота для выравнивания */
}
/* === Стили для звезд рейтинга в карточке товара === */

.uni-catalog-card__attributes {
    /* Этот блок теперь контейнер для звезд */
    margin-top: 6px; 
    margin-bottom: 10px;
    min-height: 16px; /* Резервируем место, чтобы карточки не прыгали */
}

.uni-catalog-card__rating {
    display: flex;
    align-items: center;
    gap: 2px; /* Расстояние между звездами */
}

.uni-catalog-card__rating .star {
    flex-shrink: 0; /* Запрещаем звездам сжиматься */
}

/* Стиль для рейтинга, у которого еще нет отзывов */
.uni-catalog-card__rating--no-reviews .star {
    opacity: 0.4; /* Делаем пустые звезды полупрозрачными */
}
/* Футер карточки */
.uni-catalog-card__footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Информация о цене */
.uni-catalog-card__price-info {
    color: rgba(0, 0, 0, 1);
    font-family: 'Century Gothic', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 100%;
    text-align: left;
    flex-shrink: 0; /* Не сжимаем цену */
}

/* Специальная цена */
.uni-catalog-card__price--special {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(190, 198, 165, 1);
    font-family: 'Century Gothic', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 100%;
    text-align: left;
    margin-bottom: 4px;
}

.uni-catalog-card__price--special span {
    font-size: 12px;
    font-weight: 600;
    color: #BEC6A5;
}

/* Обычная цена */
.uni-catalog-card__price--regular {
    font-size: 16px;
    color: #333;
}

@media (min-width: 1024px) {
    .uni-catalog-card__price--regular {
        font-size: 24px;
    }
    .uni-catalog-card__price--special {
        font-size: 20px;
    }
    .uni-catalog-card__price--special span {
        font-size: 20px;
    }
}

/* Действия карточки */
.uni-catalog-card__actions {
    flex-shrink: 0;
}

/* Кнопка добавления в корзину */
.uni-catalog-card__add-to-cart-btn,
.btn-interactive.btn--category {
    background-color: #748059;
    color: white;
    padding: 9px 19px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.uni-catalog-card__add-to-cart-btn:hover,
.btn-interactive.btn--category:hover {
    background-color: #333;
}

/* Адаптивные стили для планшетов */
@media (min-width: 1024px) {
    .uni-catalog-card__title {
        font-size: 16px;
        -webkit-line-clamp: 3;
        min-height: 60px;
    }
    
    .uni-catalog-card__price-info {
        font-size: 18px;
    }
    
    .uni-catalog-card__price--special {
        font-size: 20px;
    }
    .btn--category {
        padding: 15px 25px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 54px !important;
    }
}

/* Адаптивные стили для мобильных */
@media (max-width: 640px) {
    .uni-catalog-card {
        padding: 15px;
    }
    
    .uni-catalog-card__image-wrapper {
        margin: -15px -15px 0 -15px;
        width: calc(100% + 30px);
    }
    
    .uni-catalog-card__title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        min-height: 34px;
    }
    
    .uni-catalog-card__price-info {
        font-size: 14px;
    }
    
    .uni-catalog-card__price--special {
        font-size: 16px;
    }
    
    .uni-catalog-card__add-to-cart-btn,
    .btn-interactive.btn--category {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .uni-catalog-card__footer {
        align-items: stretch;
        gap: 12px;
    }
    
    .uni-catalog-card__price-info {
        text-align: center;
    }
    
    .uni-catalog-card__add-to-cart-btn,
    .btn-interactive.btn--category {
        padding: 8px;
    }
}

/* Исправление для контейнера страницы на маленьких экранах */
@media (max-width: 640px) {
    .uni-catalog-page__container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Убедимся, что основной контент правильно растягивается */
.uni-catalog-page__content {
    width: 100%;
    box-sizing: border-box;
}

/* Дополнительные исправления для пагинации точек слайдера */
.custom-slider__pagination-external {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 0;
}

/* Исправление для хедера карточки */
.uni-catalog-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 10;
}

/* Стикер новинки */
.uni-catalog-card__new-sticker {
    max-height: 30px;
    width: auto;
}

/* Кнопка избранного */
.uni-catalog-card__wishlist-btn {
    background: transparent;
    backdrop-filter: blur(10px);
    border: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.uni-catalog-card__wishlist-btn:hover {
    transform: scale(1.1);
}
@media (min-width: 1024px) {
    .uni-catalog-card__title {
        font-size: 22px;
    }
    .uni-catalog-card__price-info {
        font-size: 24px;
    }
    .uni-catalog-card__price--special {
        display: flex;
    }
}


/* ============================================= */
/* ==           КОМПОНЕНТЫ                      == */
/* ============================================= */

/* --- Кастомный слайдер в карточке товара --- */
.custom-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
.custom-slider.grabbing {
    cursor: grabbing;
}
.custom-slider__track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
}
.custom-slider__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-slider__slide a {
    height: 100%;
    object-fit: cover;
}
.custom-slider__slide img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}
.custom-slider__pagination {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 3px 6px;
}
.custom-slider__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}
.custom-slider__dot:hover {
    background-color: rgba(0, 0, 0, 0.5);
}
.custom-slider__dot.active {
    background-color: #333;
}
@media (min-width: 768px) {
    .custom-slider__pagination {
        bottom: 8px;
        padding: 4px 8px;
    }
    .custom-slider__dot {
        width: 8px;
        height: 8px;
    }
}


/* --- Кнопка "Показать еще" --- */
.uni-catalog-page__show-more-wrapper {
    width: 100%;
    text-align: center;
    margin: 40px auto;
}
.uni-catalog-page__show-more-btn {
    font-family: 'Century Gothic', sans-serif;
    background-color: #748059;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}


/* ============================================= */
/* ==           ПОДКАТЕГОРИИ (если нужны)       == */
/* ============================================= */
.uni-catalog-subcategories {
    margin-bottom: 3rem;
}
.uni-catalog-subcategories__grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 768px) {
    .uni-catalog-subcategories__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .uni-catalog-subcategories__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.uni-catalog-subcategories__item .uni-catalog-subcategories__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.uni-catalog-subcategories__image {
    width: 100%;
    height: 221px;
    object-fit: cover;
    margin-bottom: 8px;
    border-radius: 8px;
}
.uni-catalog-subcategories__image img {
    border-radius: 8px;
}
.uni-catalog-subcategories__name {
    color: var(--main-text-color);
    font-family: var(--title-font-family);
    font-size: 18px;
    font-weight: var(--bold-font-weight);
    line-height: 130%;
    text-align: center;
}
/* ============================================= */
/* ==   СТИЛИ ДЛЯ КНОПОК ФИЛЬТРОВ И СОРТИРОВКИ   == */
/* ============================================= */
.uni-catalog-controls__filter-btn {
    border: 1px solid #748059;
    border-radius: 8px;
    background: #748059;
    font-family: var(--main-font-family);
    padding: 10px 16px;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    line-height: 100%;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

@media (max-width: 1023px) {

    .uni-catalog-controls__sort-label {
        display: none;
    }

    .uni-catalog-sort-dropdown__toggle {
        border: 1px solid #748059;
        border-radius: 8px;
        background: #fff;
        padding: 10px 16px;
        width: 100%;
    }
}

@media (max-width: 450px) {
    .uni-catalog-controls__actions {
        flex-direction: row;
        align-items: stretch;
        width: 100%;
    }
    .uni-catalog-controls__filter-mobile,
    .uni-catalog-controls__sort,
    .uni-catalog-sort-dropdown {
        width: 100%;
    }
        .uni-catalog-sort-dropdown__toggle {
        justify-content: center;
    }
}

/* ============================================= */
/* ==     КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ DISPLAY      == */
/* ============================================= */

/* Базовая структура - фильтр скрыт только на десктопе по умолчанию */
.uni-catalog-filter {
    width: 345px;
    flex-shrink: 0;
    height: fit-content;
    border-right: 1px solid #9B9B9B;
    padding-right: 56px;
}

/* На десктопе показываем всегда */
@media (min-width: 1024px) {
    .uni-catalog-filter {
        display: block !important;
    }
    .uni-catalog-controls__filter-mobile {
        display: none;
    }
}

/* На мобильных устройствах - скрываем по умолчанию через позиционирование, НЕ через display */
@media (max-width: 1023px) {
    .uni-catalog-filter {
        display: block !important; /* ВАЖНО: всегда block на мобильных */
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background: white;
        z-index: 9999;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        /* Скрываем через transform, а не display */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    /* Показываем при активации */
    .uni-catalog-filter.active {
        transform: translateX(0) !important;
    }
    
    /* Кнопка фильтра видна на мобильных */
    .uni-catalog-controls__filter-mobile {
        display: block !important;
    }
}

/* Затемнение фона */
@media (max-width: 1023px) {
    body.ocf-overflow-hidden::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Блокируем прокрутку body */
body.ocf-overflow-hidden {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* OCFilter контейнер на мобильных */
@media (max-width: 1023px) {
    .ocf-container {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        left: auto !important;
        background: transparent !important;
    }
    
    .ocf-container .ocf-content {
        padding: 15px;
    }
    
    /* Хедер фильтра на мобильных */
    .uni-catalog-filter__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px;
        border-bottom: 1px solid #e0e0e0;
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .uni-catalog-filter__close-btn {
        background: transparent;
        border: none;
        padding: 5px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .uni-catalog-filter__close-btn svg {
        width: 24px;
        height: 24px;
        stroke: #333;
    }
}

/* Убедимся, что кнопка открытия фильтра работает */
.uni-catalog-controls__filter-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

/* Стили для плавного появления */
@media (max-width: 1023px) {
    .uni-catalog-filter {
        will-change: transform;
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        transform: translateX(-100%);
    }
    
    .uni-catalog-filter.active {
        -webkit-transform: translateX(0) !important;
        -moz-transform: translateX(0) !important;
        -ms-transform: translateX(0) !important;
        transform: translateX(0) !important;
    }
}

/* TOP - Мобильная версия (по умолчанию) */
.uni-catalog-page__top {
    height: 235px;
}

.uni-catalog-page__top-content {
    display: flex;
    flex-direction: column; /* колонка на мобильных */
    align-items: center; /* центрируем по горизонтали */
    justify-content: center; /* центрируем по вертикали */
    text-align: center;    
    height: 235px;
    border-radius: 10px;
    padding: 20px;
}

.uni-catalog-page__top-content h2 {
    color: rgba(245, 245, 245, 1);
    font-family: 'Trajan Pro 3', serif;
    font-size: 35px; /* уменьшен размер для мобильных */
    font-weight: 600;
    line-height: 100%;
    text-align: center; /* центрируем текст */
    margin: 0;
    padding: 0;
    padding-bottom: 20px; /* отступ между заголовком и текстом */
    border-right: none; /* убираем границу на мобильных */
    border-bottom: 3px solid white; /* граница снизу на мобильных */
    margin-bottom: 20px;
}

.uni-catalog-page__top-content p {
    color: rgba(245, 245, 245, 1);
    font-family: 'Trajan Pro 3', serif;
    font-size: 18px; /* уменьшен размер для мобильных */
    font-weight: 600;
    line-height: 120%;
    text-align: center; /* центрируем текст */
    text-transform: uppercase;
    margin: 0;
    max-width: 100%;
    padding: 0 10px;
}

/* Планшеты */
@media (min-width: 768px) and (max-width: 1023px) {
    .uni-catalog-page__top-content h2 {
        font-size: 45px; /* средний размер для планшетов */
    }
    
    .uni-catalog-page__top-content p {
        font-size: 22px; /* средний размер для планшетов */
        max-width: 500px;
    }
}

/* Десктоп (≥ 1024px) */
@media (min-width: 1024px) {
    .uni-catalog-page__top {
        height: 417px;
    }
    
    .uni-catalog-page__top-content {
        flex-direction: row; /* горизонтальное расположение на десктопе */
        justify-content: flex-start; /* выравнивание по левому краю */
        height: 417px;
        padding: 0;
    }
    
    .uni-catalog-page__top-content h2 {
        font-size: 70px; /* полный размер на десктопе */
        text-align: left;
        margin-left: 54px;
        padding-right: 54px;
        padding-top: 89px;
        padding-bottom: 89px;
        border-right: 3px solid white; /* возвращаем правую границу */
        border-bottom: none; /* убираем нижнюю границу */
        margin-bottom: 0;
    }
    
    .uni-catalog-page__top-content p {
        font-size: 27px; /* полный размер на десктопе */
        text-align: left;
        margin-left: 60px;
        max-width: 412px;
        padding: 0;
    }
}
/*
 * Стили для стандартной пагинации OpenCart
 */
.uni-catalog-pagination-wrapper {
    display: flex;
    justify-content: center; /* Центрируем пагинацию */
    width: 100%;
    margin-top: 30px;
    margin-bottom: 20px;
}

.pagination {
    display: flex;
    flex-wrap: wrap; /* Позволяет переноситься на мобильных */
    justify-content: center;
    list-style: none; /* Убираем маркеры списка */
    padding: 0;
    margin: 0;
}

.pagination > li {
    margin: 0 4px; /* Отступы между кнопками */
}

/* Стили для всех кнопок пагинации (ссылки и неактивные) */
.pagination > li > a,
.pagination > li > span {
    display: block;
    padding: 0;
    width: 44px;
    height: 44px;
    line-height: 42px;
    font-family: 'Century Gothic', sans-serif;
    text-align: center;
    text-decoration: none;
    color: #7E7E7E;
    border: 1px solid transparent;
    border-radius: 50%;      /* 50% — это гарантия круга для квадрата */
    transition: all 0.3s ease;
    font-size: 24px;
    font-weight: 400;
}

/* Стили для кнопок, на которые можно нажать */
.pagination > li > a:hover {
    background-color: #748059;
    color: #ffffff;
}

/* Стили для активной (текущей) страницы */
.pagination > li.active > span {
    color: #748059;
    border-color: #748059;
}

/* Стили для отключенных кнопок (например, "Назад" на первой странице) */
.pagination > li.disabled > span {
    background-color: #f9f9f9;
    color: #aaaaaa;
    border-color: #e0e0e0;
}

/* Страница поиска */
  .criteria-breadcrumb {
    margin-top: 30px;
    display: flex;
    list-style: none;
    gap: 8px;
    padding: 0;
  }
  .search-criteria {
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    padding: 0.5rem 0;
  }

  .search-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
  }
  .uni-catalog-controls__sort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.uni-catalog-controls__sort-label {
  font-size: 15px;
  color: #444;
  white-space: nowrap;
  font-weight: 500;
}

.uni-catalog-sort-select {
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 36px 10px 14px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%23748059'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  transition: all 0.2s ease;
}

.uni-catalog-sort-select:hover {
  border-color: #999;
}

.uni-catalog-sort-select:focus {
  border-color: #748059;
  box-shadow: 0 0 0 3px rgba(116, 128, 89, 0.2);
  outline: none;
}

.uni-catalog-controls__actions {
   display: flex;
   flex-wrap: wrap;
   gap: 1.5rem;
}

  .search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 10px;
  }

  .search-field {
    flex: 1 1 250px;
  }

  .search-input,
  .search-select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
  }

  .search-input:focus,
  .search-select:focus {
    border-color: #748059;
    box-shadow: 0 0 0 3px rgba(116, 128, 89, 0.2);
    outline: none;
  }

  .search-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 14px;
    color: #444;
  }

  .search-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #748059;
  }

  .criteria-search-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #748059;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-transform: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .criteria-search-button:hover {
    background-color: #5f684a;
    transform: translateY(-1px);
  }

  .criteria-search-button:active {
    background-color: #60694d;
    transform: translateY(0);
  }

  .criteria-search-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 128, 89, 0.3);
  }

  .search-heading {
    margin-top: 24px;
    font-size: 1.75rem;
    font-weight: 600;
    color: #222;
  }

  @media (max-width: 768px) {
    .search-row {
      flex-direction: column;
    }

    .search-field {
      flex-basis: auto;
      width: 100%;
    }

    .search-actions {
      width: 100%;
    }

    .criteria-search-button {
      width: 100%;
    }
  }
