.photo-gallery {
    padding: 100px 0;
}

.photo-gallery__heading {
    text-align: center;
    margin-bottom: 40px;
}

.photo-gallery__viewport {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}

.photo-gallery__viewport:active {
    cursor: grabbing;
}

.photo-gallery__track {
    display: flex;
    gap: 24px;
    transition: transform 0.4s ease;
    will-change: transform;
    touch-action: pan-y pinch-zoom;
}

.photo-gallery__slide {
    flex: 0 0 calc(33.333% - 16px);
}

.photo-gallery__media {
    display: block;
    border: none;
    padding: 0;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.photo-gallery__media img {
    display: block;
    width: 100%;
    height: 420px;
    object-fit: cover;
}

.photo-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: #afd173;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.photo-gallery__nav::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top: none;
    border-right: none;
}

.photo-gallery__nav--prev {
    left: 0;
}

.photo-gallery__nav--prev::before {
    transform: rotate(45deg);
}

.photo-gallery__nav--next {
    right: 0;
}

.photo-gallery__nav--next::before {
    transform: rotate(225deg);
}

.photo-gallery__nav:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.photo-gallery__dots {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.photo-gallery__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.photo-gallery__dot.is-active {
    background: #afd173;
    transform: scale(1.1);
}

@media (max-width: 1200px) {
    .photo-gallery__slide {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 640px) {
    .photo-gallery {
        padding: 80px 0;
    }

    .photo-gallery__slide {
        flex: 0 0 100%;
    }

    .photo-gallery__media img {
        height: 320px;
    }

    .photo-gallery__nav {
        display: none;
    }

    .photo-gallery__dots {
        gap: 8px;
    }
}

.photo-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.photo-modal.is-open {
    display: flex;
}

.photo-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.85);
}

.photo-modal__content {
    position: relative;
    margin: 0;
    max-width: min(90vw, 1200px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 1;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-modal.is-dragging .photo-modal__content {
    cursor: grabbing;
}

.photo-modal__content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-modal__close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.photo-modal__nav {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    color: #afd173;
    cursor: pointer;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
    box-sizing: border-box;
}

.photo-modal__nav::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top: none;
    border-right: none;
}

.photo-modal__nav--prev::before {
    transform: rotate(45deg);
}

.photo-modal__nav--next::before {
    transform: rotate(225deg);
}

@media (max-width: 960px) {
    .photo-modal__nav {
        display: none;
    }
}

@media (max-width: 600px) {
    .photo-modal__content {
        flex-direction: column;
        gap: 12px;
    }

    .photo-modal__close {
        top: -40px;
    }

    .photo-modal__nav {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
    }
}

