/* ===== ГАЛЕРЕЯ ===== */
.gallery {
    background-color: #ffffff;
    padding: 0;
    width: 100%;
    overflow: hidden;
    font-family: 'Roboto', Arial, sans-serif;
}

.gallery__container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
}

.gallery__grid {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

/* Элемент сетки (изображение) */
.gallery__item {
    cursor: zoom-in;
    overflow: hidden;
    transition: opacity 0.2s ease;
    flex: 1 1 auto;
    min-width: 150px;
    max-width:560px;
}

.gallery__item:hover {
    opacity: 0.95;
}

.gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
   
}

.gallery__item:hover .gallery__image {
    transform: scale(1.02);
}

/* Базовая высота для десктопа (1920px) */
.gallery__item {
    height: 321px;
}

/* Пропорциональное уменьшение высоты при уменьшении экрана */
@media screen and (max-width: 1680px) {
    .gallery__item { height: 280px; }
}

@media screen and (max-width: 1440px) {
    .gallery__item { height: 250px; }
}

@media screen and (max-width: 1280px) {
    .gallery__item { height: 220px; }
}

@media screen and (max-width: 1024px) {
    .gallery__item { height: 200px; }
}

@media screen and (max-width: 768px) {
    .gallery__item { height: 180px; }
    .gallery__grid { gap: 8px; }
}

@media screen and (max-width: 640px) {
    .gallery__item { height: 160px; }
}

@media screen and (max-width: 480px) {
    .gallery__item { 
        height: 140px;
        min-width: 120px;
    }
    .gallery__grid { gap: 5px; }
    .gallery__container { padding: 5px; }
}

/* ===== ЗУМЕР ===== */
.gallery-zoomer__wrapper {
    bottom: 0;
    display: none;
    left: 0;
    opacity: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: transform 0.3s ease-out;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: -1;
}

.gallery-zoomer__show .gallery-zoomer__wrapper {
    -webkit-animation: showZoomerWrapper 0.3s ease-in-out both;
    animation: showZoomerWrapper 0.3s ease-in-out both;
    display: block;
    z-index: 10000001;
}

@-webkit-keyframes showZoomerWrapper {
    0% { opacity: 0; }
    to { opacity: 1; }
}

@keyframes showZoomerWrapper {
    0% { opacity: 0; }
    to { opacity: 1; }
}

.gallery-zoomer__container {
    text-align: center;
    top: 0;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    z-index: 99999999;
}

.gallery-zoomer__bg {
    background: #fff;
    
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.gallery-zoomer__carousel {
    bottom: 15px;
    left: 15px;
    overflow: hidden;
    position: absolute;
    right: 15px;
    top: 15px;
}

.gallery-zoomer__track {
    -webkit-backface-visibility: hidden;
    bottom: 0;
    position: absolute;
    top: 0;
    -webkit-transform-style: preserve-3d;
    transition-duration: 0.25s;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.29, 0.39, 0.2, 0.96);
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.gallery-zoomer__item {
    -ms-flex-negative: 0;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    height: 100%;
    width: 100vw;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.gallery-zoomer__img {
    -webkit-backface-visibility: hidden;
    display: block;
    margin: auto;
    max-height: calc(100vh - 30px);
    max-width: 100%;
    object-fit: contain;
    overflow: auto;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

/* Увеличенное изображение */
.gallery-zoomer__img--zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

/* Скрываем стрелки при увеличении */
.scale-active .gallery-zoomer__control {
    display: none;
}

/* Кнопка закрытия */
.gallery-zoomer__close {
    cursor: pointer;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    height: auto;
    padding: 10px;
    position: fixed;
    right: 25px;
    top: 5px;
    transition: opacity 0.3s ease-in-out;
    width: auto;
    z-index: 999999999999;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
}

.gallery-zoomer__close:hover {
    opacity: 0.7;
}

.gallery-zoomer__close-line {
    background-color: #222;
    height: 26px;
    left: 15px;
    position: absolute;
    width: 2px;
}

.gallery-zoomer__close-line-first {
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

.gallery-zoomer__close-line-second {
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

/* Стрелки навигации */
.gallery-zoomer__control {
    bottom: 50px;
    cursor: pointer;
    left: 0;
    position: absolute;
    top: 50px;
    transition: opacity 0.3s ease-in-out;
    width: 15%;
    z-index: 99;
}

.gallery-zoomer__control:hover {
    opacity: 0.6;
}

.gallery-zoomer__control--right {
    left: auto;
    right: 0;
}

.gallery-zoomer__arrow {
    background: transparent;
    height: 18px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    width: 18px;
}

.gallery-zoomer__arrow-wrapper {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%) scale(0.8);
    transform: translateY(-50%) scale(0.8);
}

/* Фон под стрелками */
.gallery-zoomer__arrow-wrapper::before {
    background: none;
    border-radius: 50%;
    content: "";
    height: 36px;
    padding: 10px;
    position: absolute;
    top: calc(50% - 18px);
    width: 36px;
    transition: background 0.3s ease;
}

.gallery-zoomer__arrow-wrapper:hover::before {
    background: none
}

.gallery-zoomer__arrow-wrapper--left::before {
    left: calc(50% - 26px);
}

.gallery-zoomer__arrow-wrapper--right::before {
    right: calc(50% - 21px);
}

.gallery-zoomer__arrow--right {
    border-right: 2px solid #000;
    border-top: 2px solid #000;
}

.gallery-zoomer__arrow--left {
    border-bottom: 2px solid #000;
    border-left: 2px solid #000;
}

.gallery-zoomer__arrow-wrapper--right {
    right: 20px;
}

.gallery-zoomer__arrow-wrapper--left {
    left: 20px;
}

.t-body_scroll-locked {
    left: 0;
    position: fixed;
    width: 100%;
    overflow: hidden;
}

/* ===== АДАПТИВНОСТЬ ЗУМЕРА ===== */
@media screen and (max-width: 768px) {
    .gallery-zoomer__carousel {
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
    }
    
    /* Улучшение видимости стрелок на мобильных */
    .gallery-zoomer__arrow-wrapper::before {
        background: none;
        height: 40px;
        width: 40px;
        top: calc(50% - 20px);
    }
    
    .gallery-zoomer__arrow-wrapper--left::before {
        left: calc(50% - 20px);
    }
    
    .gallery-zoomer__arrow-wrapper--right::before {
        right: calc(50% - 20px);
    }
    
    .gallery-zoomer__arrow {
        height: 20px;
        width: 20px;
        border-width: 3px;
        border-color: #000;
    }
    
    .gallery-zoomer__arrow--left {
        border-bottom: 3px solid #ffffff;
        border-left: 3px solid #ffffff;
    }
    
    .gallery-zoomer__arrow--right {
        border-right: 3px solid #ffffff;
        border-top: 3px solid #ffffff;
    }
    
    .gallery-zoomer__control .gallery-zoomer__arrow {
        height: 20px;
        width: 20px;
    }
}

@media screen and (max-width: 480px) {
    .gallery-zoomer__arrow-wrapper::before {
        height: 36px;
        width: 36px;
        top: calc(50% - 18px);
        background: none
    }
    
    .gallery-zoomer__arrow-wrapper--left::before {
        left: calc(50% - 18px);
    }
    
    .gallery-zoomer__arrow-wrapper--right::before {
        right: calc(50% - 18px);
    }
    
    .gallery-zoomer__arrow {
        height: 16px;
        width: 16px;
        border-width: 3px;
    }
}