.sef-gallery-pro{--sef-gallery-bg:#F3EEE5;width:100%;max-width:100%;min-width:0;margin:0;padding:0;background:var(--sef-gallery-bg)}
.sef-gallery-pro__desktop{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;width:100%}
.sef-gallery-pro__item{position:relative;width:100%;min-width:0;margin:0;overflow:hidden;background:var(--sef-gallery-bg)}
.sef-gallery-pro__item--full{grid-column:1/-1;aspect-ratio:4/5}
.sef-gallery-pro__item--half{grid-column:span 1;aspect-ratio:4/5}
.sef-gallery-pro__item--orphan{grid-column:1/-1}
.sef-gallery-pro__button{display:block;width:100%;height:100%;margin:0;padding:0;border:0;background:transparent;overflow:hidden;cursor:zoom-in}
.sef-gallery-pro__image{display:block;width:100%;height:100%;max-width:100%;margin:0;object-fit:contain;object-position:50% 50%;background:var(--sef-gallery-bg);transform:scale(1);transform-origin:var(--sef-x,50%) var(--sef-y,50%);transition:transform 430ms cubic-bezier(.22,.61,.36,1);will-change:transform,transform-origin}
.sef-gallery-pro__item--full.is-sef-zooming .sef-gallery-pro__image{transform:scale(1.34)}
.sef-gallery-pro__item--half.is-sef-zooming .sef-gallery-pro__image{transform:scale(1.26)}
.sef-gallery-pro__mobile{display:none}
.sef-gallery-pro__track{display:flex;width:100%;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.sef-gallery-pro__track::-webkit-scrollbar{display:none}
.sef-gallery-pro__slide{flex:0 0 100%;width:100%;margin:0;scroll-snap-align:start;background:var(--sef-gallery-bg)}
.sef-gallery-pro__mobile-image{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;background:var(--sef-gallery-bg)}
.sef-gallery-pro__mobile-meta{display:flex;justify-content:center;gap:5px;padding:10px 0 2px;font-size:12px;letter-spacing:.08em}
.sef-gallery-pro__lightbox{position:fixed;inset:0;z-index:9999999;display:grid;grid-template-columns:72px 1fr 72px;align-items:center;background:rgba(245,241,234,.98)}
.sef-gallery-pro__lightbox[hidden]{display:none!important}
.sef-gallery-pro__lightbox-stage{display:flex;align-items:center;justify-content:center;width:100%;height:100vh;padding:32px;overflow:hidden}
.sef-gallery-pro__lightbox-image{display:block;max-width:100%;max-height:calc(100vh - 64px);width:auto;height:auto;object-fit:contain}
.sef-gallery-pro__lightbox-close{position:absolute;top:18px;right:22px;width:44px;height:44px;border:0;background:transparent;font-size:38px;line-height:1;cursor:pointer}
.sef-gallery-pro__lightbox-nav{width:52px;height:52px;justify-self:center;border:0;border-radius:50%;background:rgba(255,255,255,.75);font-size:40px;line-height:1;cursor:pointer}
@media(max-width:768px){.sef-gallery-pro__desktop{display:none}.sef-gallery-pro__mobile{display:block}.sef-gallery-pro__lightbox{grid-template-columns:44px 1fr 44px}.sef-gallery-pro__lightbox-stage{padding:18px}.sef-gallery-pro__lightbox-nav{width:38px;height:38px;font-size:30px}}
@media(prefers-reduced-motion:reduce){.sef-gallery-pro__image{transition:none}}


/* =========================================================
   SEF GALLERY PRO v1.0.1
   AJUSTE DE LAYOUT SOLO ESCRITORIO
========================================================= */

@media (min-width:1024px){

    .single-product .wp-block-columns:has(.sef-gallery-pro){
        width:92vw !important;
        max-width:1600px !important;
        margin-left:auto !important;
        margin-right:auto !important;
        gap:44px !important;
        align-items:flex-start !important;
        box-sizing:border-box !important;
    }

    .single-product .wp-block-columns:has(.sef-gallery-pro) > .wp-block-column:first-child{
        flex:0 0 calc(60% - 22px) !important;
        width:calc(60% - 22px) !important;
        max-width:calc(60% - 22px) !important;
        min-width:0 !important;
    }

    .single-product .wp-block-columns:has(.sef-gallery-pro) > .wp-block-column:last-child{
        flex:0 0 calc(40% - 22px) !important;
        width:calc(40% - 22px) !important;
        max-width:calc(40% - 22px) !important;
        min-width:0 !important;
        padding-top:8px !important;
    }

    .single-product .sef-gallery-pro,
    .single-product .sef-gallery-pro__desktop{
        width:100% !important;
        max-width:none !important;
    }

    .single-product .sef-gallery-pro__item--full{
        width:100% !important;
    }
}


/* =========================================================
   SEF GALLERY PRO v1.0.2
   INTERACCIÓN:
   - Escritorio: solo hover zoom, clic no hace nada.
   - Móvil: toque simple no hace nada.
   - Móvil: pellizcar con dos dedos amplía la foto en el mismo lugar.
========================================================= */

.sef-gallery-pro__button{
    cursor:default !important;
}

@media (min-width:1024px){
    .sef-gallery-pro__button{
        cursor:zoom-in !important;
    }
}

@media (max-width:768px){

    .sef-gallery-pro__slide{
        overflow:hidden !important;
    }

    .sef-gallery-pro__button{
        cursor:default !important;
        touch-action:pan-y !important;
    }

    .sef-gallery-pro__mobile-image{
        transform:translate3d(0,0,0) scale(1);
        transform-origin:50% 50%;
        transition:transform 180ms ease-out;
        will-change:transform;
        user-select:none;
        -webkit-user-drag:none;
    }

    .sef-gallery-pro__slide.is-sef-pinching .sef-gallery-pro__button{
        touch-action:none !important;
    }

    .sef-gallery-pro__slide.is-sef-pinching .sef-gallery-pro__mobile-image{
        transition:none !important;
    }
}

/* El lightbox antiguo queda desactivado visualmente. */
.sef-gallery-pro__lightbox{
    display:none !important;
}


/* =========================================================
   SEF GALLERY PRO v1.0.3
   MÓVIL:
   - Una sola foto por pantalla.
   - Deslizamiento lateral elegante.
   - Toque abre visor grande con X.
   - Escritorio conserva exactamente el comportamiento actual.
========================================================= */

@media (max-width:768px){

    .sef-gallery-pro{
        width:100% !important;
        max-width:100% !important;
        overflow:hidden !important;
    }

    .sef-gallery-pro__desktop{
        display:none !important;
    }

    .sef-gallery-pro__mobile{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        overflow:hidden !important;
    }

    .sef-gallery-pro__track{
        display:flex !important;
        flex-wrap:nowrap !important;
        width:100% !important;
        max-width:100% !important;
        overflow-x:auto !important;
        overflow-y:hidden !important;
        scroll-snap-type:x mandatory !important;
        scroll-behavior:smooth !important;
        scrollbar-width:none !important;
        -webkit-overflow-scrolling:touch !important;
        touch-action:pan-x !important;
    }

    .sef-gallery-pro__track::-webkit-scrollbar{
        display:none !important;
    }

    .sef-gallery-pro__slide{
        flex:0 0 100% !important;
        width:100% !important;
        min-width:100% !important;
        max-width:100% !important;
        margin:0 !important;
        padding:0 !important;
        scroll-snap-align:start !important;
        scroll-snap-stop:always !important;
        overflow:hidden !important;
        background:var(--sef-gallery-bg) !important;
    }

    .sef-gallery-pro__button{
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        width:100% !important;
        height:auto !important;
        margin:0 !important;
        padding:0 !important;
        border:0 !important;
        background:transparent !important;
        overflow:hidden !important;
        touch-action:pan-x !important;
        cursor:pointer !important;
    }

    .sef-gallery-pro__mobile-image{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        height:auto !important;
        max-height:none !important;
        object-fit:contain !important;
        object-position:center !important;
        margin:0 auto !important;
        transform:none !important;
        transition:none !important;
        background:var(--sef-gallery-bg) !important;
        user-select:none !important;
        -webkit-user-drag:none !important;
    }

    .sef-gallery-pro__mobile-meta{
        display:flex !important;
        justify-content:center !important;
        align-items:center !important;
        gap:5px !important;
        padding:12px 0 18px !important;
        font-size:14px !important;
        letter-spacing:.08em !important;
    }

    .sef-gallery-pro__lightbox{
        position:fixed !important;
        inset:0 !important;
        z-index:99999999 !important;
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        background:rgba(243,238,229,.98) !important;
        padding:22px !important;
    }

    .sef-gallery-pro__lightbox[hidden]{
        display:none !important;
    }

    .sef-gallery-pro__lightbox-stage{
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        width:100% !important;
        height:100% !important;
        padding:0 !important;
        overflow:hidden !important;
    }

    .sef-gallery-pro__lightbox-image{
        display:block !important;
        width:auto !important;
        height:auto !important;
        max-width:100% !important;
        max-height:92vh !important;
        object-fit:contain !important;
        touch-action:pinch-zoom !important;
        user-select:none !important;
        -webkit-user-drag:none !important;
    }

    .sef-gallery-pro__lightbox-close{
        position:absolute !important;
        top:18px !important;
        right:18px !important;
        z-index:3 !important;
        width:44px !important;
        height:44px !important;
        border:0 !important;
        background:rgba(255,255,255,.78) !important;
        border-radius:50% !important;
        font-size:34px !important;
        line-height:1 !important;
        cursor:pointer !important;
    }

    .sef-gallery-pro__lightbox-nav{
        display:none !important;
    }
}

@media (min-width:769px){
    .sef-gallery-pro__lightbox{
        display:none !important;
    }
}


/* =========================================================
   SEF GALLERY PRO v1.0.4
   CORRECCIÓN SCROLL MÓVIL
========================================================= */
@media (max-width:768px){
    .sef-gallery-pro,
    .sef-gallery-pro__mobile,
    .sef-gallery-pro__track,
    .sef-gallery-pro__slide,
    .sef-gallery-pro__button,
    .sef-gallery-pro__mobile-image{
        touch-action:auto !important;
    }

    .sef-gallery-pro__track{
        overscroll-behavior-x:contain !important;
        overscroll-behavior-y:auto !important;
    }
}


/* =========================================================
   SEF GALLERY PRO v1.0.5
   ESCRITORIO: MOSAICO CONTINUO SIN FRANJAS / ESPACIOS
   - Elimina la relación 4:5 forzada.
   - Cada imagen usa su proporción real.
   - 0px entre filas y columnas.
   - NO modifica móvil.
========================================================= */

@media (min-width:1024px){

    .single-product .sef-gallery-pro__desktop{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:0 !important;
        row-gap:0 !important;
        column-gap:0 !important;
        align-items:start !important;
        line-height:0 !important;
    }

    .single-product .sef-gallery-pro__item,
    .single-product .sef-gallery-pro__item--full,
    .single-product .sef-gallery-pro__item--half,
    .single-product .sef-gallery-pro__item--orphan{
        aspect-ratio:auto !important;
        height:auto !important;
        min-height:0 !important;
        margin:0 !important;
        padding:0 !important;
        line-height:0 !important;
        overflow:hidden !important;
    }

    .single-product .sef-gallery-pro__item--full{
        grid-column:1 / -1 !important;
    }

    .single-product .sef-gallery-pro__item--half{
        grid-column:span 1 !important;
    }

    .single-product .sef-gallery-pro__button{
        display:block !important;
        width:100% !important;
        height:auto !important;
        min-height:0 !important;
        margin:0 !important;
        padding:0 !important;
        line-height:0 !important;
        border:0 !important;
    }

    .single-product .sef-gallery-pro__image{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        height:auto !important;
        min-height:0 !important;
        margin:0 !important;
        padding:0 !important;
        object-fit:initial !important;
        object-position:center !important;
        vertical-align:top !important;
    }
}


/* =========================================================
   SEF GALLERY PRO v1.0.6
   AJUSTE FINAL ESCRITORIO:
   - Mosaico continuo sin huecos.
   - Primera foto alineada visualmente con la columna derecha.
   - No modifica móvil.
========================================================= */

@media (min-width:1024px){

    /* Elimina cualquier margen superior heredado del bloque shortcode */
    .single-product .wp-block-shortcode:has(.sef-gallery-pro),
    .single-product .wp-block-column > .wp-block-shortcode:has(.sef-gallery-pro){
        margin-top:0 !important;
        margin-block-start:0 !important;
        padding-top:0 !important;
    }

    /* La galería arranca exactamente desde el borde superior disponible */
    .single-product .sef-gallery-pro{
        margin-top:0 !important;
        padding-top:0 !important;
    }

    /* Evita que algún contenedor interno agregue separación arriba */
    .single-product .sef-gallery-pro__desktop,
    .single-product .sef-gallery-pro__item:first-child,
    .single-product .sef-gallery-pro__item--full:first-child{
        margin-top:0 !important;
        padding-top:0 !important;
    }

    /* Mantiene la alineación superior del layout de producto */
    .single-product .sef-product-layout{
        align-items:flex-start !important;
    }

    /* Compensa el offset visual del bloque derecho para que
       título y primera foto empiecen en la misma línea */
    .single-product .sef-product-info-sticky{
        margin-top:0 !important;
        padding-top:0 !important;
    }
}

/* =========================================================
   SEF 1.0.7 - LIMPIEZA DE ESPACIO MÓVIL
   Solo afecta la salida de SEF Gallery Pro en <= 768px.
   NO modifica escritorio, tamaños de imágenes, zoom ni lightbox.
========================================================= */
@media (max-width:768px){

    /* WordPress puede inyectar un <p> vacío dentro de la salida
       del shortcode, justo antes de los datos JSON. No pertenece
       a la galería y generaba espacio vertical. */
    .sef-gallery-pro > p,
    .sef-gallery-pro > p:empty,
    .sef-gallery-pro > br{
        display:none !important;
        width:0 !important;
        height:0 !important;
        min-height:0 !important;
        margin:0 !important;
        padding:0 !important;
        line-height:0 !important;
    }

    /* La galería termina justo después de la navegación móvil. */
    .sef-gallery-pro,
    .sef-gallery-pro__mobile{
        margin-bottom:0 !important;
        padding-bottom:0 !important;
    }

    /* Mantener la navegación/puntos pegada a la foto.
       Mobile Product Polish puede sustituir el 1/N por puntos
       y estas reglas siguen siendo compatibles. */
    .sef-gallery-pro__mobile-meta{
        margin:0 !important;
        padding-top:7px !important;
        padding-bottom:2px !important;
        min-height:0 !important;
    }
}

