.neo-flex-slider {
    position: relative;
    padding: 0px 50px;
    overflow: hidden;
}

.neo-flex-slider,
.neo-flex-slider * {
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10+ */
}

.neo-flex-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.neo-flex-container {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
    width: max-content; /* Ключевое свойство */
}

.neo-flex-item {
    flex: 0 0 auto;
    margin-right: 20px;
}


/* Остальные стили остаются без изменений */
.neo-flex-prev, .neo-flex-next {
    display: flex;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
}


.neo-flex-prev span, .neo-flex-next span{
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.neo-flex-prev span:before,
.neo-flex-next span:before,
.neo-flex-prev span:after,
.neo-flex-next span:after{
    position: relative;
    content: '';
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 70%;
    height: 3px;
    background: #0a7aff;
}

.neo-flex-prev span:after{transform: rotate(45deg); top: -3px}
.neo-flex-prev span:before{transform: rotate(-45deg); top: 3px}

.neo-flex-next span:after{transform: rotate(-45deg); top: -3px}
.neo-flex-next span:before{transform: rotate(45deg); top: 3px}



.neo-flex-prev { left: 5px; }
.neo-flex-next { right: 5px; }

.neo-flex-pagination{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.neo-flex-pagination .neo-flex-bullet{
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e4e4e4;
}

.neo-flex-pagination .neo-flex-bullet.active{
    background: #333;
}


/* === GALLERY MODE === */
.neo-gallery-main {
    width: 100%;
    min-width: 100%;
    height: 500px;
    aspect-ratio: 16 / 9;            /* можно поправить под себя */
    background: #f4f4f4;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.neo-gallery-main-img {
    width: auto;
    height: 100%;
    object-fit: contain;               /* «картинка на всю ширину/высоту» */
    display: flex;
    justify-content: center;
}

.neo-gallery-thumbs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(60px, 100px);
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.neo-gallery-thumbs .neo-thumb {
    border: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    outline: none;
}

.neo-gallery-thumbs .neo-thumb.active {
    opacity: 1;
    box-shadow: 0 0 0 2px #0a7aff inset;
}

.neo-gallery-thumbs .neo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* в режиме галереи кнопки навигации остаются теми же */


/* БАЗА: горизонтальная полоса миниатюр со скроллом */
.neo-gallery-thumbs{
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;              /* плавная прокрутка */
    -webkit-overflow-scrolling: touch;    /* инерция на iOS */
    padding-bottom: 6px;                  /* чтобы скроллбар не налезал */
}

/* Миниатюры не сжимаются, фикс ширина/высота */
.neo-gallery-thumbs .neo-thumb{
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: .75;
    transition: opacity .2s, transform .2s;
}
.neo-gallery-thumbs .neo-thumb.active{
    opacity: 1;
    transform: scale(1.04);
    box-shadow: 0 0 0 2px #0a7aff inset;
}
.neo-gallery-thumbs .neo-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 1) ТОНКИЙ СКРОЛЛБАР (WebKit/Chromium) */
.neo-gallery-thumbs::-webkit-scrollbar{
    height: 6px;           /* толщина полосы */
}
.neo-gallery-thumbs::-webkit-scrollbar-track{
    background: transparent;
}
.neo-gallery-thumbs::-webkit-scrollbar-thumb{
    background: rgba(0,0,0,.18);
    border-radius: 4px;
}
.neo-gallery-thumbs:hover::-webkit-scrollbar-thumb{
    background: rgba(0,0,0,.35);
}

/* 2) Firefox */
.neo-gallery-thumbs{
    scrollbar-width: thin;                      /* thin | auto | none */
    scrollbar-color: rgba(0,0,0,.35) transparent;
}

/* 3) ПОКАЗЫВАТЬ ТОЛЬКО ПРИ НАВЕДЕНИИ (опционально) */
.neo-gallery-thumbs{
    --sb-thumb: rgba(0,0,0,.2);
    --sb-thumb-hover: rgba(0,0,0,.4);
}
.neo-gallery-thumbs::-webkit-scrollbar-thumb{
    background: transparent;
}
.neo-gallery-thumbs:hover::-webkit-scrollbar-thumb{
    background: var(--color-primary-hover);
}
@supports not selector(:has(*)) {
    /* для Firefox: имитируем — делаем тоньше по умолчанию,
       и чуть контрастнее при hover контейнера */
    .neo-gallery-thumbs{
        scrollbar-color: transparent transparent;
    }
    .neo-gallery-thumbs:hover{
        scrollbar-color: var(--color-primary-hover) transparent;
    }
}

/* 4) СНАП К МИНИАТЮРАМ (опционально: эластичная «защёлка») */
.neo-gallery-thumbs{
    scroll-snap-type: x proximity; /* или mandatory для жёсткой защёлки */
}
.neo-gallery-thumbs .neo-thumb{
    scroll-snap-align: start; /* или center, если хочешь центровку */
}

/* 5) ГРАДИЕНТНЫЕ «ЗАТУХАЮЩИЕ» КРАЯ (опционально, красиво)
   даёт ощущение, что полоса «обрезается» по краям */
.neo-gallery-thumbs{
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
}

/* 6) ТЁМНАЯ ТЕМА (если используешь prefers-color-scheme) */
@media (prefers-color-scheme: dark){
    .neo-gallery-thumbs{
        --sb-thumb: rgba(255,255,255,.25);
        --sb-thumb-hover: rgba(255,255,255,.4);
        scrollbar-color: var(--color-primary) transparent;
    }
    .neo-gallery-thumbs:hover{
        scrollbar-color: var(--color-primary-hover) transparent;
    }
    .neo-gallery-thumbs::-webkit-scrollbar-thumb{
        background: var(--color-primary);
    }
    .neo-gallery-thumbs:hover::-webkit-scrollbar-thumb{
        background: var(--color-primary-hover);
    }
}
