/* ============================================================
   Galeria Ficha Producto — galeria-ficha-producto.css
   Prefijo: pgfp-
   ============================================================ */

.pgfp-wrap {
    font-family: "Montserrat", sans-serif;
    max-width: 100%;
}

.pgfp-wrap * {
    box-sizing: border-box;
}

/* ── Placeholder sin imágenes ──────────────────────────────── */

.pgfp-placeholder {
    aspect-ratio: var(--pgfp-ratio, 7 / 5);
    overflow: hidden;
    background: #f4f4f4;
}

.pgfp-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Carrusel principal ────────────────────────────────────── */

.pgfp-carousel {
    position: relative;
    overflow: hidden;
    background: #f4f4f4;
    user-select: none;
}

.pgfp-carousel-track {
    position: relative;
}

.pgfp-slide {
    display: none;
    position: relative;
    aspect-ratio: var(--pgfp-ratio, 7 / 5);
    overflow: hidden;
}

.pgfp-slide.is-active {
    display: block;
}

.pgfp-slide-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    line-height: 0;
}

.pgfp-slide-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Botones de navegación ─────────────────────────────────── */

.pgfp-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(32, 39, 117, .75);
    color: #fff;
    line-height: 1;
    font-size: 22px;
    cursor: pointer;
    z-index: 2;
}

.pgfp-nav:hover {
    background: rgba(32, 39, 117, .95);
}

.pgfp-prev { left: 10px; }
.pgfp-next { right: 10px; }

/* ── Contador ──────────────────────────────────────────────── */

.pgfp-counter {
    position: absolute;
    bottom: 10px;
    right: 14px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 2px;
    pointer-events: none;
    letter-spacing: .3px;
}

/* ── Miniaturas ────────────────────────────────────────────── */

.pgfp-thumbs-nav {
    position: relative;
    margin-top: 8px;
}

.pgfp-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}

.pgfp-thumbs::-webkit-scrollbar {
    display: none;
}

.pgfp-thumbs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Flechas de miniaturas — aparecen en hover */

.pgfp-tnav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(32, 39, 117, .75);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.pgfp-thumbs-nav:hover .pgfp-tnav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

.pgfp-tnav:hover {
    background: rgba(32, 39, 117, .95);
}

.pgfp-tnav:disabled {
    opacity: 0 !important;
    pointer-events: none;
}

.pgfp-tnav-prev { left: 4px; }
.pgfp-tnav-next { right: 4px; }

.pgfp-thumb-btn {
    flex: 0 0 auto;
    width: 80px;
    height: 90px;
    padding: 0;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s ease;
    border-radius: 0;
}

.pgfp-thumb-btn:hover {
    opacity: .75;
}

.pgfp-thumb-btn.is-active {
    outline: 2px solid #202775;
    outline-offset: -2px;
}

.pgfp-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Lightbox ──────────────────────────────────────────────── */

html.pgfp-lb-active,
body.pgfp-lb-active {
    overflow: hidden !important;
    height: 100%;
}

.pgfp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s ease;
}

.pgfp-lightbox.is-open {
    visibility: visible;
    opacity: 1;
}

.pgfp-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .90);
    cursor: pointer;
}

.pgfp-lb-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pgfp-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
    overflow: hidden;
}

.pgfp-lb-img {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    transform-origin: center center;
}

/* Barra de controles */

.pgfp-lb-controls {
    position: absolute;
    top: 14px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.pgfp-lb-ctrl {
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .2s ease;
    padding: 0;
    flex-shrink: 0;
}

.pgfp-lb-ctrl:hover {
    background: rgba(255, 255, 255, .30);
}

.pgfp-lb-ctrl svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.pgfp-lb-close {
    font-size: 28px;
    line-height: 1;
}

/* Flechas en el lightbox */

.pgfp-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .18);
    border: none;
    color: #fff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .2s ease;
    z-index: 2;
}

.pgfp-lb-nav:hover {
    background: rgba(255, 255, 255, .32);
}

.pgfp-lb-prev { left: 16px; }
.pgfp-lb-next { right: 16px; }

/* Contador lightbox */

.pgfp-lb-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    pointer-events: none;
    white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 640px) {
    .pgfp-lb-nav {
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .pgfp-lb-prev { left: 6px; }
    .pgfp-lb-next { right: 6px; }

    .pgfp-lb-close {
        top: 8px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 26px;
    }
}
