/**
 * Product Gallery Slider for WooCommerce - Estilos
 */

/* =============================================
   PRODUCT GALLERY SLIDER
   ============================================= */
.pgs-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: 20px;
    box-sizing: border-box;
}

.pgs-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.pgs-main-image-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pgs-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pgs-slide.active {
    opacity: 1;
    visibility: visible;
}

.pgs-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pgs-arrow {
    --pgs-arrow-size: 50px;
    --pgs-icon-size: 20px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: var(--pgs-arrow-size);
    height: var(--pgs-arrow-size);
    padding: 0 !important;
    margin: 0;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box !important;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    flex-grow: 0;
}

.pgs-arrow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--pgs-icon-size);
    height: var(--pgs-icon-size);
    line-height: 1;
    flex-shrink: 0;
}

.pgs-arrow-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.pgs-arrow:hover {
    background-color: #333333;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.pgs-arrow:focus {
    outline: 2px solid #333333;
    outline-offset: 2px;
}

.pgs-arrow-prev {
    left: 10px;
}

.pgs-arrow-next {
    right: 10px;
}

.pgs-thumbnails {
    display: flex;
    justify-content: safe center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.pgs-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.pgs-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

.pgs-thumbnail {
    width: 70px;
    height: 70px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.pgs-thumbnail:hover {
    border-color: #cccccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pgs-thumbnail.active {
    border-color: #333333;
}

.pgs-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.pgs-editor-notice,
.pgs-no-images {
    padding: 30px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    text-align: center;
}

/* =============================================
   VÍDEO
   ============================================= */
.pgs-video {
    position: relative;
    width: 100%;
    height: 100%;
}

.pgs-video iframe,
.pgs-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background-color: #000000;
}

.pgs-video-thumb {
    background-color: #1a1a1a;
}

.pgs-video-thumb img {
    opacity: 0.8;
}

.pgs-video-thumb-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    height: 40%;
    color: #ffffff;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.pgs-video-thumb-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

/* =============================================
   FLECHAS A LOS LADOS DE LAS MINIATURAS
   ============================================= */
.pgs-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.pgs-bottom-nav .pgs-thumbnails {
    margin-top: 0;
    min-width: 0;
}

.pgs-arrows-beside .pgs-arrow {
    position: static;
    top: auto;
    transform: none;
    flex-shrink: 0;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.pgs-zoomable {
    cursor: zoom-in;
}

.pgs-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.9);
}

.pgs-lightbox.open {
    display: flex;
}

.pgs-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
}

.pgs-lightbox-video {
    width: min(92vw, calc(88vh * 16 / 9));
    max-width: 92vw;
    max-height: 88vh;
    aspect-ratio: 16 / 9;
    background: #000000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pgs-lightbox-video .pgs-video {
    width: 100%;
    height: 100%;
}

.pgs-lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

.pgs-lightbox-close,
.pgs-lightbox-arrow {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    line-height: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pgs-lightbox-close:hover,
.pgs-lightbox-arrow:hover {
    opacity: 0.7;
}

.pgs-lightbox-close {
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
}

.pgs-lightbox-close svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.pgs-lightbox-arrow {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.pgs-lightbox-arrow:hover {
    transform: translateY(-50%) scale(1.1);
}

.pgs-lightbox-arrow svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.pgs-lightbox-prev {
    left: 16px;
}

.pgs-lightbox-next {
    right: 16px;
}

.pgs-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

body.pgs-lightbox-open {
    overflow: hidden;
}

@media screen and (max-width: 768px) {
    .pgs-lightbox {
        padding: 16px;
    }

    .pgs-lightbox-arrow {
        width: 40px;
        height: 40px;
    }

    .pgs-lightbox-img {
        max-width: 96vw;
        max-height: 82vh;
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media screen and (max-width: 768px) {
    .pgs-container {
        padding: 20px;
    }

    .pgs-main-image-wrapper {
        height: 300px;
    }

    .pgs-thumbnail {
        width: 55px;
        height: 55px;
    }
}

@media screen and (max-width: 480px) {
    .pgs-container {
        padding: 15px;
    }

    .pgs-main-image-wrapper {
        height: 250px;
    }

    .pgs-thumbnail {
        width: 45px;
        height: 45px;
    }
}

/* =============================================
   ACCESIBILIDAD
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .pgs-slide,
    .pgs-arrow,
    .pgs-thumbnail {
        transition: none;
    }
}
