/* ========================================
   GALLERY SECTION - Galería
   ======================================== */

.gallery-section {
    position: relative;
    background-color: #010F20;
    padding: 120px 0;
    z-index: 1;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 80px;
}

/* ========================================
   TITLE
   ======================================== */
.gallery-title {
    font-family: 'Sora', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 110%;
    text-align: center;
    margin: 0 0 60px 0;
}

/* ========================================
   GALLERY GRID
   ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 440px);
    gap: 30px;
    margin-bottom: 50px;
    justify-content: center;
}

.gallery-item {
    position: relative;
    width: 440px;
    height: 440px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #1E1E1E;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center calc(50% - 25px);
    transition: opacity 0.3s ease;
    transform: scale(1.12);
}

.gallery-item:hover img {
    opacity: 0.8;
}

/* ========================================
   PAGINATION
   ======================================== */
.gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
}

.gallery-page {
    width: 50px;
    height: 50px;
    border: 2px solid #FFFFFF;
    background: transparent;
    color: #FFFFFF;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-page:hover {
    background: rgba(255, 255, 255, 0.1);
}

.gallery-page.active {
    background: #FFFFFF;
    color: #010F20;
}

/* ========================================
   DESKTOP - ESQUINAS RECTAS
   ======================================== */
@media screen and (min-width: 1025px) {
    .gallery-item {
        border-radius: 0;
    }

    .gallery-page {
        border-radius: 0;
    }
}

/* ========================================
   RESPONSIVE - TABLET (1024px y menos)
   ======================================== */
@media screen and (max-width: 1024px) {
    .gallery-section {
        padding: 350px 0 60px 0;
        min-height: auto;
    }

    .gallery-container {
        padding: 0 60px;
    }

    .gallery-title {
        font-size: 40px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .gallery-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL (768px y menos)
   ======================================== */
@media screen and (max-width: 768px) {
    .gallery-section {
        padding: 1080px 0 50px 0;
    }

    .gallery-container {
        padding: 0 30px;
    }

    .gallery-title {
        font-size: 32px;
        text-align: left;
        margin-bottom: 40px;
        padding-top: 45px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .gallery-page {
        width: 45px;
        height: 45px;
        font-size: 15px;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL PEQUEÑO (480px y menos)
   ======================================== */
@media screen and (max-width: 480px) {
    .gallery-section {
        padding: 1130px 0 40px 0;
    }

    .gallery-container {
        padding: 0 20px;
    }

    .gallery-title {
        font-size: 28px;
        padding-top: 65px;
    }

    .gallery-grid {
        gap: 15px;
    }

    .gallery-page {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* ========================================
   LIGHTBOX - Ampliar imágenes
   ======================================== */
body.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.gallery-lightbox.active {
    display: block;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 15, 32, 0.75);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-lightbox.active .gallery-lightbox__backdrop {
    opacity: 1;
}

.gallery-lightbox__content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gallery-lightbox__panel {
    position: relative;
    width: min(92vw, 900px);
    height: min(90vh, 900px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-lightbox.active .gallery-lightbox__panel {
    opacity: 1;
    transform: translateY(0);
}

.gallery-lightbox__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    cursor: zoom-out;
}

.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(1, 15, 32, 0.65);
    color: #FFFFFF;
    font-size: 34px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gallery-lightbox__nav:focus {
    outline: none;
}

.gallery-lightbox__nav:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox__nav--prev {
    left: 12px;
}

.gallery-lightbox__nav--next {
    right: 12px;
}

@media screen and (min-width: 769px) {
    .gallery-lightbox__nav {
        position: fixed;
    }

    .gallery-lightbox__nav--prev {
        left: max(16px, calc(50% - min(46vw, 450px) - 64px));
    }

    .gallery-lightbox__nav--next {
        right: max(16px, calc(50% - min(46vw, 450px) - 64px));
    }

    .gallery-lightbox .gallery-lightbox__close {
        position: fixed;
        top: max(16px, calc(50% - min(45vh, 450px) - 12px));
        right: max(0px, calc(50% - min(46vw, 450px) - 56px));
    }
}

.gallery-lightbox__nav:hover {
    background: rgba(1, 15, 32, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.gallery-lightbox__nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

.gallery-lightbox__nav[disabled]:hover {
    background: rgba(1, 15, 32, 0.65);
    transform: translateY(-50%);
}

.gallery-lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(1, 15, 32, 0.65);
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gallery-lightbox__close:focus {
    outline: none;
}

.gallery-lightbox__close:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox__close:hover {
    background: rgba(1, 15, 32, 0.9);
    transform: scale(1.05);
}

@media screen and (max-width: 768px) {
    .gallery-lightbox__content {
        padding: 12px;
    }

    .gallery-lightbox__nav {
        display: none;
    }
}

@media screen and (min-width: 1025px) {
    .gallery-lightbox__image,
    .gallery-lightbox__nav,
    .gallery-lightbox__close {
        border-radius: 0;
    }
}
