/* ===== ГАЛЕРЕЯ ===== */
.gallery-page {
    padding: 120px 0 80px;
    text-align: center;
    background: none;
}

.gallery-title {
    font-size: 64px;
    font-weight: 400;
    color: #f4f4f4;
    margin-bottom: 60px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1;
}

.gallery-title::after {
    content: '';
    width: 50px;
    height: 3px;
    background-color: #ff3333;
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== MASONRY СЕТКА ===== */
.gallery-masonry {
    columns: 3;
    column-gap: 16px;
    margin-bottom: 50px;
}

.gallery-masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    /* Анимация появления */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.gallery-masonry-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-masonry-item::after {
    content: '🔍';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.gallery-masonry-item:hover::after {
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
}

.gallery-masonry-item:hover {
    box-shadow: 0 8px 30px rgba(255, 51, 51, 0.3);
    transform: translateY(-3px);
}

.gallery-masonry-item.visible:hover {
    transform: translateY(-3px);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-masonry-item:hover .gallery-img {
    transform: scale(1.04);
}

.gallery-back-btn {
    margin-top: 10px;
    display: inline-block;
}

/* ===== ЛАЙТБОКС ===== */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.gallery-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-close:hover {
    background: #ff3333;
    border-color: #ff3333;
}

.gallery-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-arrow:hover {
    background: #ff3333;
    border-color: #ff3333;
}

.gallery-lightbox-prev { left: 20px; }
.gallery-lightbox-next { right: 20px; }

.gallery-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Мобильные */
@media (max-width: 900px) {
    .gallery-masonry { columns: 2; }
    .gallery-title { font-size: 44px; }
    .gallery-lightbox-arrow { display: none; }
}

@media (max-width: 500px) {
    .gallery-masonry { columns: 1; }
    .gallery-title { font-size: 36px; }
}


@media (max-width: 768px) {
    .gallery-page { padding: 80px 10px 40px; }
}
.gallery-loading {
    text-align: center;
    color: rgba(255,255,255,0.5);
    padding: 40px 0;
}