/* Основная галерея */
.des_gallery {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
    cursor: grab;
    touch-action: pan-y;
}

.des_gallery:active {
    cursor: grabbing;
}

.gallery-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.des_gallery_img {
    width: 33.33%;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    user-select: none;
    -webkit-user-drag: none;
    object-fit: cover;
}

.des_gallery_img:hover {
    opacity: 0.9;
}

/* Полноэкранная галерея */
.fullscreen-gallery {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    flex-direction: column;
}

.fullscreen-gallery.active {
    display: flex;
}

/* Заголовок */
.fullscreen-header {
    padding: 10px 20px;
    text-align: right;
    background: rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 10;
}

.fullscreen-close {
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 0 15px;
    transition: opacity 0.2s;
    line-height: 1;
}

.fullscreen-close:hover {
    opacity: 0.7;
}

/* Основное изображение */
.fullscreen-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    min-height: 0;
    background: #000;
}

#fullscreenImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Кнопки навигации */
.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 44px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 20;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.fullscreen-prev {
    left: 30px;
}

.fullscreen-next {
    right: 30px;
}

/* Контейнер миниатюр - автоматический скролл */
.thumbnail-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.thumbnail-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.5) rgba(0,0,0,0.3);
    width: 100%;
    padding: 5px 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.thumbnail-scroll::-webkit-scrollbar {
    height: 4px;
}

.thumbnail-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.thumbnail-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.thumbnail-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.thumbnail-track {
    display: flex;
    gap: 12px;
    padding: 0 30px;
    width: max-content;
}

.thumbnail-item {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.6;
    border-radius: 4px;
    overflow: hidden;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.thumbnail-item.active {
    border-color: #fff;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .thumbnail-item {
        width: 100px;
        height: 67px;
    }
}

@media (max-width: 768px) {
    .fullscreen-nav {
        width: 44px;
        height: 44px;
        font-size: 32px;
    }
    
    .fullscreen-prev {
        left: 15px;
    }
    
    .fullscreen-next {
        right: 15px;
    }
    
    .thumbnail-item {
        width: 80px;
        height: 54px;
    }
    
    .thumbnail-track {
        gap: 8px;
        padding: 0 20px;
    }
}

@media (max-width: 576px) {
    .thumbnail-item {
        width: 70px;
        height: 47px;
    }
}