/**
 * Display Animate - Estilos Base
 */

/* Reset de animaciones para prevenir FOUC */
.wpme-fade-in,
.wpme-fade-up,
.wpme-fade-down,
.wpme-fade-left,
.wpme-fade-right,
.wpme-fade-blur,
.wpme-scale-in,
.wpme-zoom-in,
.wpme-rotate-in {
    opacity: 0;
    visibility: hidden;
}

.wpme-fade-blur:not([data-wpme-animated]) {
    filter: blur(10px);
}

/* Cuando JS está activo, mostrar para que el observer funcione */
.js .wpme-fade-in,
.js .wpme-fade-up,
.js .wpme-fade-down,
.js .wpme-fade-left,
.js .wpme-fade-right,
.js .wpme-fade-blur,
.js .wpme-scale-in,
.js .wpme-zoom-in,
.js .wpme-rotate-in {
    visibility: visible;
}

/* Evitar que transitions de Elementor u otros builders interfieran con animaciones JS */
.wpme-fade-in,
.wpme-fade-up,
.wpme-fade-down,
.wpme-fade-left,
.wpme-fade-right,
.wpme-fade-blur,
.wpme-scale-in,
.wpme-zoom-in,
.wpme-rotate-in,
[class*="wpme-slide"],
[class*="wpme-rotate"],
[class*="wpme-parallax"],
[class*="wpme-background-scroll"],
[class*="wpme-image-sequence"],
[class*="wpme-typewriter"],
[class*="wpme-scramble"],
[class*="wpme-reveal"],
[class*="wpme-highlight-opacity"],
[class*="wpme-highlight-background"],
[class*="wpme-draw-highlight"],
[class*="wpme-text-path"] {
    transition: none !important;
    animation: none !important;
}

/* Draw Highlight — SVG orgánico inyectado */
.wpme-draw-highlight {
    position: relative;
}

/* Palabra/frase dentro de un párrafo */
span.wpme-draw-highlight {
    display: inline-block;
}

/* Si la clase va en el bloque entero: caber al contenido y permitir centrado */
p.wpme-draw-highlight,
h1.wpme-draw-highlight,
h2.wpme-draw-highlight,
h3.wpme-draw-highlight,
h4.wpme-draw-highlight,
h5.wpme-draw-highlight,
h6.wpme-draw-highlight,
div.wpme-draw-highlight {
    display: block;
    width: fit-content;
    max-width: 100%;
}

p.wpme-draw-highlight.has-text-align-center,
h1.wpme-draw-highlight.has-text-align-center,
h2.wpme-draw-highlight.has-text-align-center,
h3.wpme-draw-highlight.has-text-align-center,
h4.wpme-draw-highlight.has-text-align-center,
h5.wpme-draw-highlight.has-text-align-center,
h6.wpme-draw-highlight.has-text-align-center,
div.wpme-draw-highlight.has-text-align-center {
    margin-left: auto;
    margin-right: auto;
}

p.wpme-draw-highlight.has-text-align-right,
h1.wpme-draw-highlight.has-text-align-right,
h2.wpme-draw-highlight.has-text-align-right,
h3.wpme-draw-highlight.has-text-align-right,
h4.wpme-draw-highlight.has-text-align-right,
h5.wpme-draw-highlight.has-text-align-right,
h6.wpme-draw-highlight.has-text-align-right,
div.wpme-draw-highlight.has-text-align-right {
    margin-left: auto;
    margin-right: 0;
}

.wpme-draw-highlight-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}

.wpme-draw-highlight-svg--circle {
    z-index: 2;
}

.wpme-draw-highlight-svg path {
    fill: none;
}

/* Image Sequence — galería como frames apilados */
.wpme-image-sequence.wpme-image-sequence-ready {
    position: relative;
    overflow: hidden;
    display: block !important;
}

.wpme-image-sequence.wpme-image-sequence-ready .blocks-gallery-grid,
.wpme-image-sequence.wpme-image-sequence-ready .elementor-gallery__container,
.wpme-image-sequence.wpme-image-sequence-ready .e-gallery-container,
.wpme-image-sequence.wpme-image-sequence-ready .gallery,
.wpme-image-sequence.wpme-image-sequence-ready .elementor-widget-container {
    display: block !important;
    position: relative;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    columns: auto !important;
    grid-template-columns: none !important;
}

.wpme-image-sequence.wpme-image-sequence-ready .wp-block-image,
.wpme-image-sequence.wpme-image-sequence-ready .blocks-gallery-item,
.wpme-image-sequence.wpme-image-sequence-ready .gallery-item,
.wpme-image-sequence.wpme-image-sequence-ready .e-gallery-item,
.wpme-image-sequence.wpme-image-sequence-ready .elementor-gallery-item,
.wpme-image-sequence.wpme-image-sequence-ready figure {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

.wpme-image-sequence.wpme-image-sequence-ready .wp-block-image:has(.wpme-seq-frame.is-active),
.wpme-image-sequence.wpme-image-sequence-ready .blocks-gallery-item:has(.wpme-seq-frame.is-active),
.wpme-image-sequence.wpme-image-sequence-ready .gallery-item:has(.wpme-seq-frame.is-active),
.wpme-image-sequence.wpme-image-sequence-ready .e-gallery-item:has(.wpme-seq-frame.is-active),
.wpme-image-sequence.wpme-image-sequence-ready .elementor-gallery-item:has(.wpme-seq-frame.is-active),
.wpme-image-sequence.wpme-image-sequence-ready figure:has(> .wpme-seq-frame.is-active) {
    position: relative !important;
}

.wpme-image-sequence.wpme-image-sequence-ready .wpme-seq-frame,
.wpme-image-sequence.wpme-image-sequence-ready img.wpme-seq-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}

.wpme-image-sequence.wpme-image-sequence-ready .wpme-seq-frame.is-active {
    position: relative;
    opacity: 1;
}

.wpme-image-sequence.wpme-image-sequence-ready figcaption,
.wpme-image-sequence.wpme-image-sequence-ready .elementor-gallery__title,
.wpme-image-sequence.wpme-image-sequence-ready .elementor-gallery__description {
    display: none !important;
}

/* Highlight Opacity Text — letra a letra */
.wpme-highlight-opacity-text .wpme-char {
    display: inline-block;
    will-change: opacity;
}

/* Highlight Background — marcador letra a letra */
.wpme-highlight-background-text .wpme-highlight-bg-char {
    display: inline-block;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    padding: 0.05em 0;
    will-change: background-color;
}

/* Typewriter — letras pre-renderizadas invisibles */
.wpme-typewriter .wpme-type-char {
    display: inline-block;
}

/* Text Path — marquee sobre onda SVG */
.wpme-text-path {
    position: relative;
    width: 100%;
    min-height: clamp(180px, 26vw, 260px);
    height: clamp(180px, 26vw, 260px);
    overflow: hidden;
    opacity: 1;
    visibility: visible;
}

.wpme-text-path svg,
.wpme-text-path .wpme-text-path-svg {
    display: block;
    width: 100%;
    height: 100%;
    shape-rendering: geometricPrecision;
}

.wpme-text-path text {
    user-select: none;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

/* Cursor typewriter */
.wpme-cursor {
    display: inline-block;
    margin-left: 2px;
    font-weight: 100;
    color: currentColor;
}

@keyframes wpme-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Reduce motion - Respetar preferencias del usuario */
@media (prefers-reduced-motion: reduce) {
    .wpme-fade-in,
    .wpme-fade-up,
    .wpme-fade-down,
    .wpme-fade-left,
    .wpme-fade-right,
    .wpme-fade-blur,
    .wpme-scale-in,
    .wpme-zoom-in,
    .wpme-rotate-in {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    
    .wpme-parallax,
    .wpme-parallax-slow,
    .wpme-rotate-scroll,
    .wpme-scale-scroll,
    .wpme-background-scroll {
        transform: none !important;
        background-color: transparent !important;
    }

    .wpme-image-sequence.wpme-image-sequence-ready .wpme-seq-frame {
        opacity: 0 !important;
    }

    .wpme-image-sequence.wpme-image-sequence-ready .wpme-seq-frame.is-active,
    .wpme-image-sequence.wpme-image-sequence-ready .wpme-seq-frame:first-of-type {
        opacity: 1 !important;
    }

    .wpme-highlight-opacity-text .wpme-char {
        opacity: 1 !important;
    }

    .wpme-highlight-background-text .wpme-highlight-bg-char {
        background-color: transparent !important;
    }

    .wpme-draw-highlight-svg path {
        stroke-dashoffset: 0 !important;
    }

    .wpme-typewriter .wpme-type-char {
        opacity: 1 !important;
        transform: none !important;
    }

    .wpme-is-pinned {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
    }
}

/* Utilidades */
.wpme-hidden {
    opacity: 0;
}

.wpme-visible {
    opacity: 1;
}

/* Pin al scroll */
[data-wpme-pin="true"] {
    position: relative;
    z-index: 1;
}

.wpme-is-pinned {
    z-index: 10;
    transition: none !important;
}

/* Stagger delays predefinidos */
.wpme-stagger-1 { --wpme-delay: 0.1s; }
.wpme-stagger-2 { --wpme-delay: 0.2s; }
.wpme-stagger-3 { --wpme-delay: 0.3s; }
.wpme-stagger-4 { --wpme-delay: 0.4s; }
.wpme-stagger-5 { --wpme-delay: 0.5s; }