/* ==========================================================================
   DEFAULT GALLERY - Slider Swiper con lightbox para plantilla default
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. CONTENEDOR PRINCIPAL
   --------------------------------------------------------------------------- */

.defaultGallery {
    padding: 64px 64px 0;
}

.defaultGallery__container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
}

.defaultGallery .swiperNav {
    margin-bottom: 0;
}

/* Swiper anade swiper-button-lock cuando todos los slides caben:
   no hay nada que navegar, ocultamos la barra entera para que
   no reserve margin-top */
.defaultGallery .swiperNav:has(.swiper-button-lock) {
    display: none;
}

/* ---------------------------------------------------------------------------
   2. SLIDER
   --------------------------------------------------------------------------- */

.defaultGallery__slider {
    overflow: hidden;
}

.defaultGallery__slide {
    cursor: pointer;
}

.defaultGallery__slide picture {
    display: block;
}

.defaultGallery__slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ---------------------------------------------------------------------------
   3. LIGHTBOX
   --------------------------------------------------------------------------- */

.defaultGallery__lightbox {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.defaultGallery__lightbox.active {
    opacity: 1;
    visibility: visible;
}

.defaultGallery__lightbox .defaultGallery__lightbox-swiper {
    width: 100%;
    height: 100%;
}

.defaultGallery__lightbox .swiper-wrapper {
    align-items: center;
}

.defaultGallery__lightbox .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.defaultGallery__lightbox .swiper-slide img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

/* Boton cerrar */
.defaultGallery__lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1060;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.defaultGallery__lightbox-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.defaultGallery__lightbox-close-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 20px;
    height: 20px;
}

.defaultGallery__lightbox-close-icon::before,
.defaultGallery__lightbox-close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
}

.defaultGallery__lightbox-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.defaultGallery__lightbox-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Flechas lightbox */
.defaultGallery__lightbox-prev,
.defaultGallery__lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.defaultGallery__lightbox-prev {
    left: 24px;
}

.defaultGallery__lightbox-next {
    right: 24px;
}

.defaultGallery__lightbox-nav-icon {
    display: block;
    width: 64px;
    height: 64px;
}

.defaultGallery__lightbox-prev:hover,
.defaultGallery__lightbox-next:hover {
    opacity: 0.7;
}

.defaultGallery__lightbox-prev.swiper-button-disabled,
.defaultGallery__lightbox-next.swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* No scroll en body cuando lightbox abierto */
body.no-scroll {
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
   4. RESPONSIVE — Desktop grande (>1920px)
   --------------------------------------------------------------------------- */

@media (min-width: 1921px) {
    .defaultGallery {
        padding: 72px 64px 0;
    }
}

/* ---------------------------------------------------------------------------
   5. RESPONSIVE — Desktop (1366px - 1500px)
   --------------------------------------------------------------------------- */

@media (min-width: 1366px) and (max-width: 1500px) {
    .defaultGallery {
        padding: 56px 15px 0;
    }
}

/* ---------------------------------------------------------------------------
   6. RESPONSIVE — Desktop / iPad Pro (961px - 1365px)
   --------------------------------------------------------------------------- */

@media (min-width: 961px) and (max-width: 1365px) {
    .defaultGallery {
        padding: 48px 24px 0;
    }
}

/* ---------------------------------------------------------------------------
   7. RESPONSIVE — Tablet (768px - 960px)
   --------------------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 960px) {
    .defaultGallery {
        padding: 40px 15px 0;
    }
}

/* ---------------------------------------------------------------------------
   8. RESPONSIVE — Movil (<768px)
   --------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .defaultGallery {
        padding: 32px 15px 0;
    }

    .defaultGallery .swiperNav {
        display: none;
    }

    .defaultGallery__lightbox-prev,
    .defaultGallery__lightbox-next {
        display: none;
    }

    .defaultGallery__lightbox .swiper-slide img {
        max-width: 95vw;
        max-height: 80vh;
    }

    .defaultGallery__lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .defaultGallery__lightbox-close-icon {
        width: 16px;
        height: 16px;
    }

    .defaultGallery__lightbox-close-icon::before,
    .defaultGallery__lightbox-close-icon::after {
        width: 16px;
    }
}
