/* ========== ГАЛЕРЕИ ========== */

.gallery-layout {
    display: flex;
    gap: 50px;
    align-items: stretch;
    width: 100%;
}

.gallery-left {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.gallery-text {
    margin-bottom: 30px;
}

.gallery-text .section-title {
    margin-bottom: 20px;
    line-height: 1.15;
}

.gallery-text .section-desc {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.5;
}

.gallery-right {
    flex: 0 0 calc(65% - 51px);
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e7e1d8;
    border-radius: 24px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
    border-radius: 24px;
}

.main-image:hover {
    transform: scale(1.01);
}

/* ========== МИНИАТЮРЫ ========== */

.thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    width: 100%;
}

.thumb-prev,
.thumb-next {
    display: flex;
    background: #ece6dd;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.thumb-prev:hover,
.thumb-next:hover {
    background: #ddd5c8;
    transform: scale(1.05);
}

.thumb-prev:active,
.thumb-next:active {
    transform: scale(0.98);
}

.thumbnails-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.thumbnails-row {
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease-in-out;
    width: max-content;
}

/* Десктоп: миниатюры 170px */
.thumbnails-row img,
.thumb-placeholder {
    width: 170px;
    height: 170px;
    object-fit: cover;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.thumb-placeholder {
    background: #e0d8ce;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a7e6e;
    font-size: 14px;
    cursor: default;
}

.thumbnails-row img:hover {
    transform: scale(1.03);
    border-color: #bbb;
}

.thumbnails-row img.active-thumb {
    border-color: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Адаптив для планшетов */
@media (max-width: 900px) {
    .gallery-layout {
        flex-direction: column;
        gap: 40px;
    }
    
    .gallery-left {
        flex: auto;
        width: 100%;
    }
    
    .gallery-right {
        flex: auto;
        width: 100%;
        aspect-ratio: 16 / 10;
    }
    
    .thumbnails-wrapper {
        margin-top: 30px;
    }
    
    .thumbnails-row img,
    .thumb-placeholder {
        width: 85px;
        height: 85px;
        border-radius: 14px;
    }
    
    .thumb-prev,
    .thumb-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Мобильные (до 640px) */
@media (max-width: 640px) {
    .gallery-layout {
        gap: 30px;
    }
    
    .gallery-right {
        aspect-ratio: 1 / 1;
    }
    
    .thumbnails-wrapper {
        gap: 8px;
        margin-top: 20px;
    }
    
    .thumbnails-row img,
    .thumb-placeholder {
        width: 75px;
        height: 75px;
        border-radius: 12px;
    }
    
    .thumb-prev,
    .thumb-next {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .thumbnails-row img,
    .thumb-placeholder {
        width: 65px;
        height: 65px;
        border-radius: 10px;
    }
    
    .thumb-prev,
    .thumb-next {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}