/* ----- Стили галереи (модальное окно) ----- */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.gallery-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
    padding: 20px;
}

.image-area {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    max-height: 75vh;
    margin: 0 auto;
}

.main-image {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    user-select: none;
    /* чтобы не выделялось при свайпе */
    pointer-events: none;
    /* чтобы свайп не блокировался картинкой */
}

/* Кнопки навигации (фиксированы по центру относительно изображения) */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 30, 0.75);
    backdrop-filter: blur(8px);
    color: white;
    border: none;
    font-size: 2.2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    transform: translateY(-50%) scale(1.05);
}

.prev {
    left: -70px;
}

.next {
    right: -70px;
}

/* Кнопка закрытия */
.close-btn {
    position: fixed;
    top: 20px;
    right: 30px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: white;
    border: none;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 30;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #e74c3c;
    transform: scale(1.05);
}

/* Миниатюры снизу */
.thumbnails-area {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 25;
}

.thumbnails {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    width: fit-content;
    margin: 0 auto;
}

.thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
    border: 2px solid transparent;
}

.thumb:hover {
    opacity: 1;
    transform: scale(1.03);
}

.thumb.active {
    opacity: 1;
    border-color: white;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.info-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 8px;
}

/* Адаптив */
@media (max-width: 900px) {
    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }

    .thumb {
        width: 55px;
        height: 55px;
    }

    .close-btn {
        top: 12px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 550px) {
    .thumb {
        width: 45px;
        height: 45px;
    }

    .thumbnails {
        gap: 8px;
        padding: 8px 16px;
    }

    .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}

/* Стили для карточек проектов (оставляем как есть) */
.project-img {
    width: 320px;
    height: 240px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Небольшой индикатор свайпа (опционально) */
.swipe-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    z-index: 26;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}