/**
 * Sticker Preview - Calcos Zoom
 * Product ID: 23718
 * Version: 2.3.0
 */


/* ============================================================
   PRODUCT GALLERY
   ============================================================ */

body.postid-23718 .woocommerce-product-gallery {
    position: relative !important;

    overflow: hidden !important;

    border-radius: 18px !important;

    background: #d8d8d8;
}


/* Imagen original Woo */
body.postid-23718 .woocommerce-product-gallery__wrapper {
    position: relative;

    z-index: 5;

    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}


/* Cuando hay preview, desaparece la foto original */
body.postid-23718
.woocommerce-product-gallery.has-sticker-preview
.woocommerce-product-gallery__wrapper {
    opacity: 0 !important;

    visibility: hidden !important;

    pointer-events: none !important;
}


/* Lupa Woo */
body.postid-23718
.woocommerce-product-gallery.has-sticker-preview
.woocommerce-product-gallery__trigger {
    display: none !important;
}


/* ============================================================
   LIVE PREVIEW WRAPPER
   ============================================================ */

/*
 * IMPORTANTE:
 *
 * Sin diseño cargado NO existe visualmente.
 * Así evitamos cualquier bleed detrás de la foto.
 */
body.postid-23718 #sticker-preview-wrapper {
    display: none !important;

    position: absolute !important;

    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    z-index: 20;

    overflow: hidden;

    border-radius: inherit;
}


/*
 * Solamente aparece cuando el JS agrega
 * .has-sticker-preview a la galería.
 */
body.postid-23718
.woocommerce-product-gallery.has-sticker-preview
#sticker-preview-wrapper {
    display: block !important;
}


/* ============================================================
   PREVIEW STAGE
   ============================================================ */

body.postid-23718 #sticker-preview-stage {
    position: absolute !important;

    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 42%,
            #dedede 0%,
            #d3d3d3 58%,
            #c9c9c9 100%
        );

    border-radius: inherit;

    perspective: 1000px;
}


/* ============================================================
   CANVAS
   ============================================================ */

body.postid-23718 #sticker-preview {
    display: block;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain;

    transform:
        perspective(1000px)
        rotateX(0deg)
        rotateY(0deg)
        scale(1);

    transform-style: preserve-3d;

    transition:
        transform 160ms ease-out;

    will-change: transform;
}


/* ============================================================
   PREVIEW INFO
   ============================================================ */

.sticker-preview-info {
    position: absolute;

    z-index: 30;

    top: 20px;
    left: 22px;

    display: flex;

    flex-direction: column;

    gap: 3px;

    pointer-events: none;
}


.sticker-preview-eyebrow {
    font-size: 10px;

    line-height: 1.2;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.16em;

    opacity: 0.72;
}


.sticker-preview-subtitle {
    font-size: 9px;

    line-height: 1.2;

    text-transform: uppercase;

    letter-spacing: 0.13em;

    opacity: 0.42;
}


/* ============================================================
   HINT
   ============================================================ */

.sticker-preview-hint {
    position: absolute;

    z-index: 30;

    left: 0;
    right: 0;
    bottom: 16px;

    padding: 0 20px;

    font-size: 10px;

    line-height: 1.4;

    text-align: center;

    opacity: 0.35;

    pointer-events: none;
}


/* ============================================================
   APF GENERAL
   ============================================================ */

body.postid-23718 .wapf-field-container {
    margin-bottom: 18px;
}


body.postid-23718 .wapf-product-totals {
    margin-top: 22px;
}


body.postid-23718 form.cart {
    margin-top: 24px;
}


/* ============================================================
   MATERIAL SWATCHES
   Field: 13f79a4
   ============================================================ */

body.postid-23718 .field-13f79a4 .wapf-image-swatch-wrapper {
    --wapf-col-width: 92px !important;

    display: grid !important;

    grid-template-columns:
        repeat(4, 92px) !important;

    gap: 14px !important;

    justify-content: start;
}


body.postid-23718 .field-13f79a4 .wapf-swatch {
    width: 92px !important;

    min-width: 0 !important;
}


body.postid-23718 .field-13f79a4 .apf-pick-box {
    width: 82px !important;
    height: 82px !important;

    margin: 0 auto !important;

    overflow: hidden;
}


body.postid-23718 .field-13f79a4 .apf-pick-box img {
    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;
}


/* Boost MUY sutil del swatch holográfico */
body.postid-23718
.field-13f79a4
label[aria-label*="Holog"]
.apf-pick-box {
    filter:
        saturate(1.20)
        contrast(1.08)
        brightness(1.02);
}


/* Nombre del material */
body.postid-23718 .field-13f79a4 .wapf-swatch-label {
    display: block !important;

    width: 92px !important;

    margin-top: 6px !important;

    font-size: 11px !important;
    line-height: 1.2 !important;

    text-align: center !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: unset !important;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 780px) {

    body.postid-23718 .field-13f79a4 .wapf-image-swatch-wrapper {
        grid-template-columns:
            repeat(2, minmax(70px, 92px)) !important;

        gap: 8px !important;
    }


    .sticker-preview-info {
        top: 14px;
        left: 16px;
    }


    .sticker-preview-hint {
        display: none;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    #sticker-preview {
        transition: none !important;

        transform: none !important;
    }

}