/* Карточки каталога Bagatelle — отдельные стили для темы Lightshop.
 * Только плиточные режимы: main / main-four / main-five. */
.catalogue__products-lists .catalogue__products-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

.catalogue__products-lists,
.catalogue__content-lists {
    border: 0 !important;
    box-shadow: none !important;
}

/* Тема использует разные классы контейнера для режимов плитки. */
.catalogue__products-lists:not(.catalogue__products-list--four):not(.catalogue__products-list--five) .catalogue__products-list-item {
    display: block !important;
    flex: 0 0 calc((100% - 20px) / 3) !important;
    width: calc((100% - 20px) / 3) !important;
}

.catalogue__products-lists.catalogue__products-list--four .catalogue__products-list-item {
    display: block !important;
    flex: 0 0 calc((100% - 30px) / 4) !important;
    width: calc((100% - 30px) / 4) !important;
}

.catalogue__products-lists.catalogue__products-list--five .catalogue__products-list-item {
    display: block !important;
    flex: 0 0 calc((100% - 40px) / 5) !important;
    width: calc((100% - 40px) / 5) !important;
}

.catalogue__products-lists .catalogue__products-list-item {
    min-width: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Планшеты: по 2 карточки в строке во всех режимах плитки. */
@media (max-width: 991px) {
    .catalogue__products-lists:not(.catalogue__products-list--four):not(.catalogue__products-list--five) .catalogue__products-list-item,
    .catalogue__products-lists.catalogue__products-list--four .catalogue__products-list-item,
    .catalogue__products-lists.catalogue__products-list--five .catalogue__products-list-item {
        flex: 0 0 calc((100% - 10px) / 2) !important;
        width: calc((100% - 10px) / 2) !important;
    }
}

/* Телефоны: по 1 карточке в строке во всех режимах плитки. */
@media (max-width: 575px) {
    .catalogue__products-lists:not(.catalogue__products-list--four):not(.catalogue__products-list--five) .catalogue__products-list-item,
    .catalogue__products-lists.catalogue__products-list--four .catalogue__products-list-item,
    .catalogue__products-lists.catalogue__products-list--five .catalogue__products-list-item {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
}

.catalogue__products-lists .products-list__link {
    display: block !important;
    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 20px 23px !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.catalogue__products-lists .products-list__img.js-simple-slider {
    position: relative !important;
    box-sizing: border-box !important;
    width: calc(100% + 40px) !important;
    max-width: none !important;
    margin: 0 -20px !important;
    padding: 0 !important;
    border: 0 !important;
    aspect-ratio: 1 / 1 !important;
    height: var(--bagatelle-photo-size, auto) !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.catalogue__products-lists .products-list__img .slick-list {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    clip-path: inset(0) !important;
}

.catalogue__products-lists .products-list__img .slick-track,
.catalogue__products-lists .products-list__img .slick-slide {
    height: 100% !important;
}

.catalogue__products-lists .products-list__img-item {
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.catalogue__products-lists .products-list__img-item img {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
    margin: 0 !important;
}

.catalogue__products-lists .products-list__img .slick-slide:not(.slick-current):not(.bagatelle-visible) {
    visibility: hidden !important;
    opacity: 0 !important;
}

.catalogue__products-lists .products-list__img .slick-current,
.catalogue__products-lists .products-list__img .slick-slide.bagatelle-visible {
    visibility: visible !important;
    opacity: 1 !important;
}

.catalogue__products-lists .products-list__img .slick-prev,
.catalogue__products-lists .products-list__img .slick-next {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 50% !important;
    width: 32px !important;
    height: 32px !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer !important;
}

.catalogue__products-lists .products-list__img .slick-prev { left: 8px !important; right: auto !important; }

.catalogue__products-lists .products-list__img .slick-next { right: 8px !important; left: auto !important; }

.catalogue__products-lists .products-list__img .slick-prev svg,
.catalogue__products-lists .products-list__img .slick-next svg { width: 18px !important; height: 18px !important; }

.catalogue__products-lists .products-list__caption { position: relative !important; height: auto !important; }

.catalogue__products-lists .bagatelle-resize-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
    background: #f4f3f1;
    opacity: 1;
    transition: opacity 300ms ease-in-out;
}

.catalogue__products-lists .bagatelle-resize-overlay img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center;
}

.catalogue__products-lists .products-list__img.bagatelle-resizing .slick-list {
    visibility: hidden !important;
}

/* Расширяем штатное мобильное оформление широкого списка с 479 до 575 пикселей.*
 * Применяется только к карточкам полного списка, а не к другим элементам страницы. */
@media (min-width: 480px) and (max-width: 575px) {
    .products-full-list__description {
        display: block !important;
        width: 100% !important;
    }

    .products-full-list__img {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0 0 20px !important;
    }

    .products-full-list__price .catalogue__price {
        font-size: 25px !important;
    }

    .products-full-list .catalogue__product-name {
        font-size: 14px !important;
        line-height: 16px !important;
    }
}

/* Bagatelle — отступы и типографика подписей карточек каталога */
.catalogue__products-lists .products-list__caption {
    margin-top: 15px !important;
}

.catalogue__products-lists .products-list__caption > .catalogue__price {
    display: block !important;
    margin-top: 15px !important;
    font-size: 25px !important;
    line-height: 30px !important;
}

/* Мобильная одноколоночная сетка: 15 пикселей между карточками и вокруг списка.*
 * 480–575 пикселей: внешний контейнер Lightshop уже имеет боковые отступы по 15 пикселей. */
@media (min-width: 480px) and (max-width: 575px) {
    .catalogue__products-lists ul.catalogue__products-list {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 15px !important;
        padding: 15px 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

/* До 479 пикселей включительно: тема убирает внешние боковые отступы, поэтому задаём их списку. */
@media (max-width: 479px) {
    .catalogue__products-lists ul.catalogue__products-list {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 15px !important;
        padding: 15px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 575px) {
    .catalogue__products-lists ul.catalogue__products-list > li.catalogue__products-list-item {
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .catalogue__products-lists .catalogue__products-list-item > .products-list__link {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

/* ===========================================================*
 * Bagatelle V2 — отдельная панель кнопок; штатные элементы остаются в DOM.*
 * На десктопе кнопки появляются при наведении, на сенсорных устройствах отображаются постоянно.*
 * =========================================================== */
.catalogue__products-lists .products-list__link.bagatelle-v2-card {
    position: relative !important;
    overflow: hidden !important;
}

/* Штатные кнопки Lightshop скрыты визуально, но доступны для вызова действий. */
.catalogue__products-lists .bagatelle-v2-card > .products-list__action,
.catalogue__products-lists .bagatelle-v2-card > .products-list__like {
    display: none !important;
}

.catalogue__products-lists .bagatelle-v2-panel {
    box-sizing: border-box !important;
    z-index: 50 !important;
}

.catalogue__products-lists .bagatelle-v2-button {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #222 !important;
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 4px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    cursor: pointer !important;
    transition: background-color 250ms ease, border-color 250ms ease, color 250ms ease !important;
}

.catalogue__products-lists .bagatelle-v2-button svg {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    pointer-events: none;
    transition: stroke 250ms ease !important;
}

.catalogue__products-lists .bagatelle-v2-button:hover {
    background: #f4f3f1 !important;
}

/* Сохраняем яркость фотографии при наведении: отключаем прозрачность и фильтры темы. */
.catalogue__products-lists .bagatelle-v2-card:hover .products-list__img,
.catalogue__products-lists .bagatelle-v2-card:hover .products-list__img img,
.catalogue__products-lists .bagatelle-v2-card .products-list__img:hover,
.catalogue__products-lists .bagatelle-v2-card .products-list__img:hover img {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
}

.catalogue__products-lists .bagatelle-v2-card .products-list__img::before,
.catalogue__products-lists .bagatelle-v2-card .products-list__img::after,
.catalogue__products-lists .bagatelle-v2-card::before,
.catalogue__products-lists .bagatelle-v2-card::after {
    background: transparent !important;
    box-shadow: none !important;
}

.catalogue__products-lists .bagatelle-v2-card .products-list__caption {
    text-align: center !important;
}

@media (min-width: 576px) and (hover: hover) and (pointer: fine) {
    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-panel {
        position: absolute !important;
        top: calc(var(--bagatelle-v2-photo-center, 120px) + 125px) !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, var(--bagatelle-scaled-size, 44px)) !important;
        gap: var(--bagatelle-scaled-gap, 8px) !important;
        width: min(var(--bagatelle-scaled-width, 148px), calc(100% - 12px)) !important;
        height: var(--bagatelle-scaled-height, 96px) !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: translate(-50%, -50%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 250ms ease !important;
    }

    /* Вертикальные смещения в зависимости от выбранного режима плитки Lightshop.*
 * Три значения можно изменять независимо друг от друга. */
    /* 3 товара в ряд */
    html:not(.bagatelle-touch-device) .catalogue__products-lists:not(.catalogue__products-list--four):not(.catalogue__products-list--five)
    .bagatelle-v2-card .bagatelle-v2-panel {
        top: calc(var(--bagatelle-v2-photo-center, 120px) + 125px) !important;
    }

    /* 4 товара в ряд */
    html:not(.bagatelle-touch-device) .catalogue__products-lists.catalogue__products-list--four
    .bagatelle-v2-card .bagatelle-v2-panel {
        top: calc(var(--bagatelle-v2-photo-center, 120px) + 90px) !important;
    }

    /* 5 товаров в ряд */
    html:not(.bagatelle-touch-device) .catalogue__products-lists.catalogue__products-list--five
    .bagatelle-v2-card .bagatelle-v2-panel {
        top: calc(var(--bagatelle-v2-photo-center, 120px) + 70px) !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card:hover > .bagatelle-v2-panel,
    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card:focus-within > .bagatelle-v2-panel {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-button {
        width: 100% !important;
        height: var(--bagatelle-scaled-size, 44px) !important;
        min-width: 0 !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-heart { grid-column: 1; grid-row: 1; }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-compare { grid-column: 2; grid-row: 1; }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-eye { grid-column: 3; grid-row: 1; }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-cart {
        grid-column: 1 / 4;
        grid-row: 2;
        background: #222 !important;
        border-color: #222 !important;
        color: #fff !important;
        font-size: var(--bagatelle-scaled-font, 13px) !important;
        font-weight: 500 !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-button svg {
        width: var(--bagatelle-scaled-icon, 21px) !important;
        height: var(--bagatelle-scaled-icon, 21px) !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-cart svg { display: none !important; }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-cart::after { content: "В корзину"; }

    /* Корзина: при наведении бежево-коричневый фон, надпись остаётся белой. */
    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-cart:hover {
        background: #a38c76 !important;
        border-color: #a38c76 !important;
        color: #fff !important;
    }

    /* Дополнительные кнопки: белый фон, при наведении меняется только цвет иконки. */
    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card
    .bagatelle-v2-button:is(.bagatelle-v2-heart, .bagatelle-v2-compare, .bagatelle-v2-eye):hover {
        background: #fff !important;
        color: #a38c76 !important;
    }

    html:not(.bagatelle-touch-device) .catalogue__products-lists .bagatelle-v2-card
    .bagatelle-v2-button:is(.bagatelle-v2-heart, .bagatelle-v2-compare, .bagatelle-v2-eye):hover svg {
        stroke: #a38c76 !important;
    }
}

@media (max-width: 575px), (pointer: coarse), (hover: none) and (pointer: none) {
    .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-panel {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 15px 0 0 !important;
        padding: 0 !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-button {
        flex: 0 1 50px !important;
        width: 50px !important;
        max-width: 50px !important;
        min-width: 0 !important;
        height: 50px !important;
    }
}

/* Сенсорные устройства: учитываем основной тип указателя, а не только наличие сенсорного экрана. */
html.bagatelle-touch-device .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-panel {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 15px 0 0 !important;
        padding: 0 !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    html.bagatelle-touch-device .catalogue__products-lists .bagatelle-v2-card .bagatelle-v2-button {
        flex: 0 1 50px !important;
        width: 50px !important;
        max-width: 50px !important;
        min-width: 0 !important;
        height: 50px !important;
    }

/* Bagatelle — корзина поверх стрелок слайдера */
/* Шапка выше каталога */
header,
.header,
.header__wrapper {
    z-index: 1000 !important;
}

/* Корзина выше карточек */
.js-cart-call,
.js-cart-btn,
.cart,
.cart-popup,
.cart-dropdown {
    z-index: 1001 !important;
}

/* Стрелки Slick ниже открытой корзины */
.catalogue__products-lists .products-list__img .slick-prev,
.catalogue__products-lists .products-list__img .slick-next {
    z-index: 2 !important;
}

/* Bagatelle V2.6 — стрелки Slick без фона и рамки, исходная толщина SVG сохраняется. */
.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next),
.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next):is(:hover, :focus, :active) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Сохраняем исходные SVG-стрелки; псевдоэлементы FontAwesome не используем. */
.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next) svg {
    display: block !important;
    transition: color 250ms ease !important;
}

.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next)::after {
    content: none !important;
}

/* Меняем только цвет стрелки, не увеличивая толщину её контура. */
.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next):hover {
    color: #a38c76 !important;
}

.catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next):hover svg {
    fill: currentColor !important;
    stroke: none !important;
}


/* Bagatelle V2.7 — стрелки показываются только при наведении на фото.
   Для телефонов и планшетов сохраняем исходную доступность стрелок. */
@media (min-width: 576px) and (hover: hover) and (pointer: fine) {
    html:not(.bagatelle-touch-device)
    .catalogue__products-lists .products-list__img :is(.slick-prev, .slick-next) {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 250ms ease, visibility 250ms ease !important;
    }

    html:not(.bagatelle-touch-device)
    .catalogue__products-lists .products-list__img:hover :is(.slick-prev, .slick-next) {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}
