/**
 * Animaciones y transiciones optimizadas
 */

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.scroll-reveal-init {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal-init.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Variantes de animación */
.scroll-reveal-init[data-delay="100"] { transition-delay: 0.1s; }
.scroll-reveal-init[data-delay="200"] { transition-delay: 0.2s; }
.scroll-reveal-init[data-delay="300"] { transition-delay: 0.3s; }
.scroll-reveal-init[data-delay="400"] { transition-delay: 0.4s; }

/* ========================================
   Page Loader
   ======================================== */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hide-this {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#page-loader .container-mid {
    text-align: center;
}

#page-loader img {
    max-width: 200px;
    height: auto;
}

/* Spinner */
.css-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color, #AF997F);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Sticky Navigation
   ======================================== */
.navigation-main {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navigation-main.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* ========================================
   Parallax Elements
   ======================================== */
.dzsparallaxer {
    position: relative;
    overflow: hidden;
}

.dzsparallaxer--target,
.divimage {
    will-change: transform;
    backface-visibility: hidden;
}

/* ========================================
   Scroll to Top Button
   ======================================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.scroll-top-inner {
    width: 50px;
    height: 50px;
    background: var(--primary-color, #AF997F);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    color: #fff;
}

.scroll-top-inner.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-inner:hover {
    background: var(--primary-color-dark, #8a7a64);
    transform: translateY(-3px);
}

/* ========================================
   Form Styles
   ======================================== */
.form-control.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ========================================
   Tabs Animation
   ======================================== */
.tab-pane {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    opacity: 1;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    animation: kenburns 20s ease-in-out infinite alternate;
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* ========================================
   Reduce Motion for Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal-init {
        opacity: 1;
        transform: none;
    }

    .hero .bg-image {
        animation: none;
    }
}
