/* Custom CSS, deduped & fixed – совместимо с Tailwind runtime */

/* ========== Root variables ========== */
:root {
    --primary: #0156FF;
    --secondary: #666666;

    /* Chat widget sizes */
    --chat-w: 22.5rem; /* 360px */
    --chat-h: 36rem; /* 576px */
}

/* ========== Typography ========== */
body {
    font-family: 'Roboto', sans-serif;
}

/* ========== Product card hover effect ========== */
.product-card {
    transition: transform .24s ease, box-shadow .24s ease, opacity .24s ease;
}

.product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
    transform: translateY(-4px);
}

/* ========== Number input: hide spinners ========== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ========== Custom checkbox ========== */
.custom-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 20px;
    width: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    margin-right: .75rem;
}

.custom-checkbox input:checked ~ .checkmark {
    background: #0156FF;
    border-color: #0156FF;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* ========== Favorites: remove animation ========== */
.favorite-item-remove {
    transition: all .3s ease;
}

.favorite-item.removing {
    opacity: 0;
    transform: translateX(30px);
}

/* ========== Notifications ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown .3s ease-out;
}

/* ========== Scroll helpers ========== */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

/* ========== Switch "Только в наличии" ========== */
.custom-switch {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
}

.custom-switch .switch-ui {
    display: inline-block;
    width: 44px;
    height: 24px;
    border-radius: 9999px;
    background: #e5e7eb;
    position: relative;
    vertical-align: middle;
    transition: background .2s ease;
}

.custom-switch .switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    transition: left .2s ease;
}

.custom-switch input.peer:checked + .switch-ui {
    background: #0156FF;
}

.custom-switch input.peer:checked + .switch-ui::after {
    left: 22px;
}

.custom-switch.whitespace-nowrap {
    white-space: nowrap;
}

/* ========== Filters: double range (overlay) ========== */
.range-container {
    --thumb-size: 18px;
    --thumb-half: calc(var(--thumb-size) / 2);
    position: relative;
    height: 32px;
    color: #0156FF;
    padding-inline: var(--thumb-half);
}

.slider-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 9999px;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-range {
    position: absolute;
    top: 50%;
    height: 4px;
    border-radius: 9999px;
    background: currentColor;
    transform: translateY(-50%);
    z-index: 2;
}

.custom-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 32px;
    background: transparent;
    outline: none;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
    z-index: 3;
    accent-color: auto;
}

.custom-range::-webkit-slider-thumb,
.custom-range::-moz-range-thumb {
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 9999px;
    background: #fff;
    border: 2px solid currentColor;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    z-index: 5;
}

.custom-range::-webkit-slider-runnable-track,
.custom-range::-moz-range-track {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.custom-range::-ms-track {
    background: transparent !important;
    border-color: transparent !important;
    color: transparent !important;
}

.custom-range::-moz-range-progress, .custom-range::-ms-fill-lower, .custom-range::-ms-fill-upper {
    background: transparent !important;
    border: 0 !important;
}

.custom-range:focus {
    outline: none !important;
}

.custom-range::-moz-focus-outer {
    border: 0;
}

#priceMinRange {
    z-index: 4;
}

#priceMaxRange {
    z-index: 5;
}

[data-results-anchor] {
    scroll-margin-top: 24px;
}

/* ========== Водяной знак ========== */
.product-page .wm {
    position: relative;
}

.product-page .wm::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--wm);
    background-repeat: repeat;
    background-size: 200px auto;
    opacity: .08;
    pointer-events: none;
}

/* Общие watermark-слои */
.wm-layer, .wm--thumb {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: var(--wm-opacity, .12);
    transform: rotate(var(--wm-rotate, -18deg));
    transform-origin: center;
}

.wm-img, .wm-text {
    background-image: var(--wm), var(--wm);
    background-repeat: repeat, repeat;
    background-position: 0 0, calc(var(--wm-x, 240px) / 2) calc(var(--wm-y, 240px) / 2);
    background-size: var(--wm-x, 240px) var(--wm-y, 240px), var(--wm-x, 240px) var(--wm-y, 240px);
}

.wm--thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--wm);
    background-repeat: repeat;
    background-size: 160px auto;
    opacity: .08;
}

/* ========== Лайтбокс ========== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483000 !important;
}

.lightbox.open {
    display: flex;
}

.lightbox__stage {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 64px;
    pointer-events: auto;
    z-index: 2147483002 !important;
}

.lightbox__imgwrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 96vw;
    max-height: 96vh;
    width: 96vw;
    height: 96vh;
    overflow: hidden;
    touch-action: none;
    pointer-events: auto;
}

.lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: opacity .16s ease, transform .06s linear;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    pointer-events: none;
}

.lightbox__wm {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: var(--wm), var(--wm);
    background-repeat: repeat, repeat;
    background-position: 0 0, calc(var(--wm-x, 240px) / 2) calc(var(--wm-y, 240px) / 2);
    background-size: var(--wm-x, 240px) var(--wm-y, 240px), var(--wm-x, 240px) var(--wm-y, 240px);
    opacity: var(--wm-opacity, .12);
    transform: rotate(var(--wm-rotate, -18deg));
    transform-origin: center;
    display: none;
    z-index: 5;
}

.lightbox__wm.is-on {
    display: block;
}

.lightbox__chrome {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 44px;
    pointer-events: auto;
    z-index: 2147483004 !important;
}

.lightbox__chrome .lb-spacer {
    flex: 1 1 auto;
}

.lb-counter {
    color: #fff;
    font-size: 14px;
    opacity: .85;
    padding: 0 8px;
}

.lb-btn {
    appearance: none !important;
    min-width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: #000 !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
}

.lb-btn:hover {
    background: #111 !important;
}

.lb-btn:active {
    transform: translateY(1px);
}

.lb-btn--zoom-in, .lb-btn--zoom-out, .lb-btn--close {
    cursor: pointer;
}

.lb-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 96px;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2147483003 !important;
    padding: 0;
    margin: 0;
}

.lb-nav--prev {
    left: 0;
    border-left: 0;
    border-right: 1px solid rgba(255, 255, 255, .18);
}

.lb-nav--next {
    right: 0;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

.lb-nav__icon {
    font-size: 38px;
    line-height: 1;
    color: #fff;
    user-select: none;
    pointer-events: none;
}

.lb-nav:hover {
    background: rgba(0, 0, 0, .7);
}

/* Запрет «легкого» сохранения */
.lightbox img, .product-page .js-prod-gallery img {
    -webkit-user-drag: none;
    user-select: none;
}

/* ========== line-clamp fallback ========== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== UI bits ===== */
.ui-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    padding: 1rem;
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: #f3f4f6;
}

.ui-btn:hover {
    background: #e5e7eb;
}

.ui-btn--primary {
    background: var(--primary);
    color: #fff;
}

.ui-input {
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ui-table th {
    font-weight: 600;
    background: #f9fafb;
}

.ui-table th, .ui-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid #eef2f7;
}

.ui-badge {
    display: inline-block;
    padding: .125rem .5rem;
    background: #f3f4f6;
    border-radius: .375rem;
    font-size: .75rem;
}

/* ========= Chat widget ========= */
#chatPanel {
    width: min(92vw, var(--chat-w));
    height: min(85vh, var(--chat-h));
    position: relative; /* для модалки контактов */
}

.cs-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cs-chat.hidden {
    display: none !important;
}

#chatLog {
    position: relative;
}

.cs-chat__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 12px;
    position: relative;
}

.cs-chat__footer {
    flex: 0 0 auto;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid #eee;
}

#chatForm > .flex {
    align-items: flex-end;
}

#chatForm .cs-chat__actions > * {
    box-sizing: border-box;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#chatForm .cs-chat__actions > button {
    border: 1px солид transparent;
}

.cs-chat__actions {
    display: grid;
    grid-auto-flow: row;
    align-content: end;
    row-gap: .375rem;
}

/* пузырь */
.cs-bubble {
    display: block;
    max-width: 75%;
    min-width: clamp(9rem, 42%, 24rem);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cs-chat__body .group > :first-child {
    display: block;
    max-width: 80%;
}

.cs-chat__body [data-role="me"] .group > :first-child {
    margin-left: auto;
}

.cs-chat__body [data-role="them"] .group > :first-child {
    margin-right: auto;
}

@media (max-width: 420px) {
    .cs-bubble {
        min-width: clamp(8rem, 66vw, 22rem);
        max-width: 85%;
    }
}

/* textarea */
.cs-chat__textarea, #chatForm textarea#chatText {
    min-height: 3.5rem;
    max-height: 30vh;
    resize: none;
}

/* Превью изображений */
.cs-attach-img {
    display: block;
    max-width: min(70vw, 320px);
    max-height: 192px;
    border-radius: 12px;
    margin-top: .25rem;
    background: #f8fafc;
}

/* Dropzone */
.cs-drop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #93c5fd;
    background: rgba(29, 78, 216, .06);
    color: #1d4ed8;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    pointer-events: none;
}

/* Сепаратор дат */
.cs-date {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0;
    color: #6b7280;
    font-size: .75rem;
}

.cs-date::before, .cs-date::after {
    content: "";
    height: 1px;
    background: #e5e7eb;
    flex: 1 1 auto;
}

.cs-date > span {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: .125rem .5rem;
    line-height: 1.25rem;
    white-space: nowrap;
}

/* Плавающий бейдж даты */
.cs-date-float {
    position: absolute;
    top: 8px;
    left: 5.5vw;
    right: 5.5vw;
    z-index: 99999;
    text-align: center;
    background: rgba(255, 255, 255, .5);
    border-radius: 25px;
    padding: 2px 10px;
    font-size: 14px;
    line-height: 20px;
    color: #111827;
    border: 1px solid rgba(0, 0, 0, .06);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

/* Модалка контактов поверх чата */
.cs-chat-lead {
    position: absolute;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
}

/* показываем flex только когда класс hidden убран (Tailwind .hidden даёт display:none) */
.cs-chat-lead:not(.hidden) {
    display: flex;
}

.cs-chat-lead__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8); /* ~80% затемнение */
}

.cs-chat-lead__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.85rem 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* ========= BESTSELLERS (desktop) ========= */
[data-carousel="bestsellers"] [data-car-viewport] {
    padding-left: 24px;
    padding-right: 24px;
}

[data-carousel="bestsellers"] [data-car-track] {
    display: flex;
    gap: 24px;
}

[data-carousel="bestsellers"] [data-car-slide] {
    flex: 0 0 25%;
}

/* ====== MOBILE ADAPTATION LAYER ====== */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

button, [role="button"], .ui-btn, .btn {
    min-height: 44px;
}

@media (max-width: 640px) {
    :root {
        --chat-w: 100vw;
        --chat-h: 80vh;
    }

    #chatPanel {
        width: 100vw;
        height: min(85vh, var(--chat-h));
    }

    .cs-chat__actions {
        display: grid;
        grid-auto-flow: column;
        column-gap: .375rem;
        row-gap: 0;
        justify-content: end;
    }

    #chatForm > .flex {
        flex-wrap: wrap;
        gap: .5rem;
    }

    #chatForm textarea#chatText {
        flex: 1 1 100%;
        min-height: 3.25rem;
    }
}

/* Hover выключаем на тачевых */
@media (hover: none) {
    .product-card {
        transform: none !important;
    }
}

/* Переключатель «Только в наличии» — крупнее */
@media (max-width: 480px) {
    .custom-switch {
        gap: .5rem;
    }

    .custom-switch .switch-ui {
        width: 42px;
        height: 26px;
    }

    .custom-switch .switch-ui::after {
        width: 22px;
        height: 22px;
        top: 2px;
        left: 2px;
    }

    .custom-switch input.peer:checked + .switch-ui::after {
        left: 18px;
    }
}

/* Диапазон цен — больше «пипетки» */
@media (max-width: 480px) {
    .range-container {
        --thumb-size: 22px;
    }
}

/* Watermark плитка меньше на мобиле */
@media (max-width: 480px) {
    .wm-img, .wm-text {
        background-size: var(--wm-x, 180px) var(--wm-y, 180px), var(--wm-x, 180px) var(--wm-y, 180px);
        background-position: 0 0, calc(var(--wm-x, 180px) / 2) calc(var(--wm-y, 180px) / 2);
    }

    .wm--thumb::before {
        background-size: 120px авто;
    }
}

/* Lightbox — плотнее на телефонах */
@media (max-width: 640px) {
    .lightbox__stage {
        padding: 16px;
    }

    .lightbox__imgwrap {
        max-width: 100vw;
        max-height: 92vh;
        width: 100vw;
        height: 92vh;
    }

    .lb-nav {
        width: 64px;
    }

    .lightbox__chrome {
        top: 6px;
        left: 6px;
        right: 6px;
        height: 40px;
    }

    .lb-btn {
        min-width: 36px !important;
        height: 36px !important;
        border-radius: .75rem !important;
    }
}

/* Таблицы — горизонтальный скролл */
@media (max-width: 640px) {
    .ui-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ui-table {
        min-width: 640px;
    }
}

/* Чекбоксы — больше зона клика */
@media (max-width: 480px) {
    .checkmark {
        width: 22px;
        height: 22px;
        margin-right: .5rem;
    }
}

/* Плавающий бейдж дат — не перекрывать контент */
@media (max-width: 480px) {
    .cs-date-float {
        left: 4vw;
        right: 4vw;
        font-size: 13px;
        line-height: 18px;
    }
}

/* Кламп — безопаснее на iOS */
@supports (-webkit-line-clamp: 2) {
    .line-clamp-2 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
}

/* ==== BESTSELLERS touch-mode (<1024px) ==== */
@media (max-width: 1023.98px) {
    [data-carousel="bestsellers"] [data-car-prev],
    [data-carousel="bestsellers"] [data-car-next] {
        display: none !important;
    }

    [data-carousel="bestsellers"] [data-car-viewport] {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-left: 16px;
        padding-right: 16px;
    }

    [data-carousel="bestsellers"] [data-car-track] {
        gap: 16px;
        transform: none !important;
    }

    [data-carousel="bestsellers"] [data-car-slide] {
        flex: 0 0 92%;
        scroll-snap-align: center;
    }
}

/* ноутбуки: 3 в кадре */
@media (min-width: 1024px) and (max-width: 1279.98px) {
    [data-carousel="bestsellers"] [data-car-slide] {
        flex: 0 0 33.333%;
    }
}

/* десктоп ≥1280px: 4 в кадре */
@media (min-width: 1280px) {
    [data-carousel="bestsellers"] [data-car-slide] {
        flex: 0 0 25%;
    }
}

/* ===== Мобильные фиксы ===== */
html, body {
    overflow-x: hidden;
}

/* Выпадающее меню "Кабинет": по клику, без hover на тачах */
[data-account-dropdown] {
    display: none;
}

[data-account-dropdown].is-open {
    display: block;
}

/* Pages menu (офканвас) */
#pagesMenu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
}

#pagesMenu[data-open="1"] {
    display: block;
}

/* Мелкие безопасные дефолты */
* {
    min-width: 0;
}

/* ===== Tabbar (мобильное нижнее меню) ===== */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.tabbar__list {
    margin: 0 auto;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 0;
    padding: 2px 10px;
    list-style: none;
}

.tabbar__item {
    display: flex;
    justify-content: center;
    align-items: end;
    position: relative;
    min-width: 0;
}

.tabbar__btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: 92px;
    height: 64px;
    padding: 6px 4px;
    border-radius: 12px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    line-height: 1;
    transition: background .15s ease, color .15s ease;
    position: relative;
}

.tabbar__btn i {
    font-size: 20px;
    line-height: 1;
}

.tabbar__btn:hover {
    background: #f5f7fb;
    color: #374151;
}

.tabbar__btn:active {
    transform: translateY(1px);
}

.tabbar__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 22px);
    transform: translateX(50%);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 10px;
    border-radius: 9999px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tabbar__badge.is-hidden {
    display: none;
}

.tabbar__item--center {
    align-items: center;
}

/* под FAB */
.tabbar__fab {
    width: 62px;
    height: 62px;
    border-radius: 9999px;
    background: var(--primary);
    color: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 8px 24px rgba(1, 86, 255, .28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-22px);
}

.tabbar__fab i {
    font-size: 24px;
    line-height: 1;
}

.tabbar__fab:hover {
    filter: brightness(1.05);
}

.tabbar__fab:active {
    transform: translateY(-20px);
}

@media (max-width: 1023.98px) {
    .tabbar__list {
        grid-template-columns: 1fr 1fr auto 1fr 1fr;
    }
}

/* безопасная зона для таббара на iOS */
@media (max-width: 1023.98px) {
    body {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }
}

/* ==== Centered pages menu (popover) ==== */
#pagesMenu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
}

#pagesMenu[data-open="1"] {
    display: block;
}

.pagesMenu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .45);
    backdrop-filter: blur(2px);
}

.pagesMenu__panel {
    position: relative;
    margin: 10vh auto 0 auto;
    width: min(92vw, 360px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    border: 1px solid rgba(0, 0, 0, .06);
    padding: 12px 0 6px 0;
    animation: menuPop .18s ease-out;
}

@keyframes menuPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.pagesMenu__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 8px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.pagesMenu__header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.pagesMenu__close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.pagesMenu__close:hover {
    background: #f1f5f9;
}

.pagesMenu__nav ul {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.pagesMenu__nav li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 10px;
    text-decoration: none;
    color: #111827;
    font-size: 15px;
}

.pagesMenu__nav li a:hover {
    background: #f5f7fb;
    color: #0f172a;
}

@media (min-width: 1024px) {
    .pagesMenu__panel {
        width: 420px;
        margin-top: 12vh;
    }
}

/* ===== Mobile gallery: previews instead of main photo (<1024px) ===== */
@media (max-width: 1023.98px) {
    .product-card .js-prod-gallery > img {
        display: none !important;
    }

    .product-card .js-prod-gallery .pgm-vp {
        position: absolute;
        inset: 0;
        display: block;
        overflow: hidden;
    }

    .product-card .js-prod-gallery .pgm-track {
        display: flex;
        height: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
    }

    .product-card .js-prod-gallery .pgm-slide {
        flex: 0 0 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        scroll-snap-align: center;
    }

    .product-card .js-prod-gallery .pgm-slide > img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        -webkit-user-drag: none;
        user-select: none;
    }

    .product-card .js-prod-gallery .pgm-dots {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 6px;
        display: flex;
        gap: 6px;
        justify-content: center;
        align-items: center;
        pointer-events: auto;
        overflow: hidden;
        white-space: nowrap;
    }

    .product-card .js-prod-gallery .pgm-dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 9999px;
        background: rgba(0, 0, 0, .25);
        line-height: 0;
        vertical-align: middle;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        transition: transform .12s ease, background .12s ease;
    }

    .product-card .js-prod-gallery .pgm-dot::after {
        content: "";
        position: absolute;
        inset: -6px;
    }

    .product-card .js-prod-gallery .pgm-dot.is-active {
        background: var(--primary, #0156FF);
        transform: scale(1.35);
    }

    .product-card .js-prod-gallery .pgm-dot:focus-visible {
        outline: 2px solid rgba(1, 86, 255, .6);
        outline-offset: 2px;
    }

    .product-card .pg-thumbs {
        display: none !important;
    }
}

/* Выпадающее меню аккаунта в таббаре: открываем НАД таббаром */
.tabbar__dropdown {
    position: absolute;
    right: 0;
    bottom: 100%;
}

/* === MOBILE PERFORMANCE PRESET === */
@media (max-width: 768px) {
    .product-card {
        transition: transform .18s ease, opacity .18s ease;
        will-change: transform;
    }

    .product-card:hover {
        box-shadow: none !important;
        transform: translateY(-2px);
    }

    .lb-btn,
    .tabbar__fab,
    .pagesMenu__panel {
        box-shadow: 0 4px 12px rgba(0, 0, 0, .14) !important;
    }

    .pagesMenu__backdrop {
        backdrop-filter: none !important;
    }

    .lightbox__wm.is-on,
    .wm-layer,
    .wm--thumb::before {
        opacity: .06 !important;
    }
}

/* Если пользователь просит меньше анимации — почти всё отключаем */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* === LIGHTBOX PERF === */
.lightbox__imgwrap {
    contain: paint layout style;
    will-change: transform;
}

.lightbox__img {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: opacity .16s ease, transform .06s linear !important;
}

.lb-nav, .lightbox__chrome {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* === CARD MOBILE GALLERY PERF === */
.product-card .js-prod-gallery .pgm-track {
    scroll-behavior: smooth;
    will-change: scroll-position;
    overscroll-behavior-x: contain;
}

.product-card .js-prod-gallery .pgm-slide > img {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.product-card .js-prod-gallery .pgm-dot {
    transition: transform .12s ease, background .12s ease;
    box-shadow: none !important;
}

/* === CONTENT VISIBILITY: отложенная отрисовка тяжёлых секций === */
[data-carousel], [data-grid], .pg-thumbs, .product-card {
    content-visibility: auto;
    contain-intrinsic-size: 600px 400px;
}

/* Скрыть полосы прокрутки, но оставить скролл */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.product-description p {
    margin-bottom: 0.75rem;
}

.product-description ul,
.product-description ol {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.product-description ul {
    list-style: disc;
}

.product-description ol {
    list-style: decimal;
}

.product-description h2,
.product-description h3,
.product-description h4 {
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-description b,
.product-description strong {
    font-weight: 600;
}

.product-description em,
.product-description i {
    font-style: italic;
}

#chatForm[data-sending="1"] [data-chat-send-label] {
    opacity: .5;
    pointer-events: none;
}