/* =========================
   Общий overlay
========================= */
.bxgallery-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.bxgallery-img{
    transition: transform .35s ease;
    will-change: transform;
    /*cursor: zoom-in;*/
}

/* =========================
   Основной слайдер
========================= */
.bxgallery-stage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 75%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bxgallery-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.bxgallery-slide.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 10;
}

.bxgallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    user-select: none;
}


/* =========================
   Мини-изображения
========================= */
.bxgallery-thumbs {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 85%;
    padding: 5px;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.5) transparent; /* Firefox */
}

/* Для Webkit (Chrome, Edge, Safari) */
.bxgallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.bxgallery-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.bxgallery-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
}

.bxgallery-thumbs::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.8);
}

.bxgallery-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 40px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
}

.bxgallery-thumb.active {
    border-color: #fff;
    transform: scale(1.05);
}

.bx-swiper-top{
    margin-bottom:10px;
}

.bx-swiper-top img{
    width:100%;
    height:420px;
    object-fit:cover;
    border-radius:12px;
}

.bx-swiper-thumbs img{
    height:80px;
    object-fit:cover;
    cursor:pointer;
    opacity:.6;
    border-radius:8px;
}

.bx-swiper-thumbs .swiper-slide-thumb-active img{
    opacity:1;
    outline:2px solid #3b82f6;
}

.bx-caption {
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
    color: gray;
}


/* =========================
   Панель управления справа сверху
========================= */
.bxgallery-top-right {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bxgallery-btn,
.bxgallery-share-btn {
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background 0.2s;
}

.bxgallery-btn:hover,
.bxgallery-share-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* =========================
   Социальные сети
========================= */
.bxgallery-socials {
    display: none;
    flex-direction: column;
    margin-top: 5px;
    gap: 4px;
    background: rgba(0,0,0,0.7);
    padding: 5px 8px;
    border-radius: 4px;
}

.bxgallery-socials a {
    display: flex;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
    text-align: center;
    gap: 10px;
}

.bxgallery-socials a:hover {
    background: rgba(255,255,255,0.25);
}

.bxgallery-social-item img {
    width: 22px;
    height: 22px;
    /*border-radius: 50%;*/
}

/* =========================
   Стрелки навигации
========================= */
.bxgallery-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.bxgallery-arrow {
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 40px;
    border: none;
    width: 60px;
    height: 60px;
    /*border-radius: 50%;*/
    pointer-events: all;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.3s ease;
    transform: translateX(0);
    user-select: none;
}

.bxgallery-arrow.left {
    margin-left: 10px;
    transform: translateX(-20px);
}

.bxgallery-arrow.right {
    margin-right: 10px;
    transform: translateX(20px);
}

.bxgallery-overlay:hover .bxgallery-arrow {
    opacity: 1;
    transform: translateX(0);
    background: rgba(0,0,0,0.5);
}

.bxgallery-arrow:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.1);
}

/* =========================
   Подпись изображения
========================= */
.bxgallery-caption {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    max-width: 80%;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.bxgallery-control-top-left {
    position: absolute;
    right: 10px;
    top: 15px;
}

.bxgallery-overlay i{
    pointer-events: none;
}

/* =========================
   Блок галереи с мини-слайдами — современный стиль
========================= */

.bx-gallery-block .swiper-wrapper {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.bx-gallery-block .swiper-slide {
    flex-shrink: 0;
    width: 120px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
}

.bx-gallery-block .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.bx-gallery-block .swiper-slide img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Стрелки навигации — минимализм */
.bx-gallery-block .swiper-button-prev,
.bx-gallery-block .swiper-button-next {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    pointer-events: all;
    transition: transform 0.2s ease, color 0.2s ease;
    padding:5px;
}

.bx-gallery-block .swiper-button-prev:hover,
.bx-gallery-block .swiper-button-next:hover {
    /*transform: scale(1.2);*/
    background: #0000008f;
    color: #fffc;
}

.bx-gallery-block .swiper-button-prev {
    left: 0;
}

.bx-gallery-block .swiper-button-next {
    right: 0;
}

/* Скрываем ненужные элементы Swiper */
.bx-gallery-block .swiper-notification {
    display: none;
}

/* Горизонтальный скролл мини-слайдов */
.bx-gallery-block::-webkit-scrollbar {
    height: 6px;
}

.bx-gallery-block::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.bx-gallery-block::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.bx-gallery-block::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

.bx-gallery-block .swiper.bx-swiper-thumbs.swiper-initialized.swiper-horizontal.swiper-watch-progress.swiper-thumbs {
    padding: 5px;
}
.bx-gallery-block .bx-swiper-thumbs .swiper-slide-thumb-active img {
    outline: 2px solid #7e7e7e;
}
/* =========================
   Адаптив
========================= */
@media (max-width: 1024px){
    .bx-gallery-block .swiper-slide {
        /*width: 100px;
        height: 70px;*/
    }
}

@media (max-width: 768px){
    .bx-gallery-block .bx-swiper-top .swiper-slide {
        height: 250px;
    }
    .bx-gallery-block .bx-swiper-top .swiper-slide img {
        object-fit: contain;
    }
    .bx-gallery-block .swiper-button-prev,
    .bx-gallery-block .swiper-button-next {
        font-size: 24px;
    }

    .bxgallery-stage { width: 95%; height: 60%; }
    .bxgallery-thumb { width: 40px; height: 28px; }
    .bxgallery-arrow { width: 40px; height: 40px; font-size: 28px; }
    .bxgallery-caption { font-size: 14px; bottom: 70px; }
    .bxgallery-thumb {
        width: 45px;
        height: 30px;
    }

    .bxgallery-thumbs {
        gap: 6px;
        max-width: 90%;
    }

    .bxgallery-arrow {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
}