/* ==========================================
   HOME 3D ENHANCEMENTS — FRONTERA VIVA
   Estilos para Three.js scenes, tilt cards,
   parallax diorama y microinteracciones.
   ========================================== */

/* ===== HERO 3D CANVAS ===== */
.hero--3d {
    position: relative;
    overflow: hidden;
}

.hero-3d-canvas {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero--3d.fv-3d-active .hero-3d-canvas {
    opacity: 1;
}

.hero--3d.fv-3d-active .hero-image-col--fallback {
    display: none;
}

.hero-content--layered {
    position: relative;
    z-index: 3;
}

/* ===== WORD-SPLIT TEXT ANIMATION ===== */
.hero-title-3d .fv-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px) scale(0.88);
    will-change: transform, opacity;
}

.hero-title-3d .fv-word.fv-word-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== CTA BUTTON 3D DEPTH + GLOW ===== */
.hero-cta--3d {
    transform-style: preserve-3d;
    perspective: 600px;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;
}

.hero-cta--3d::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hero-cta--3d:hover {
    transform: translateY(-4px) translateZ(10px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(0, 163, 224, 0.35),
        0 0 60px rgba(0, 51, 153, 0.15),
        inset 0 -2px 6px rgba(255, 255, 255, 0.1);
}

.hero-cta--3d:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== MINI GLOBE (Featured Section) ===== */
.section-header-with-globe {
    display: flex;
    align-items: center;
    gap: 16px;
}

.globe-mini-canvas {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 163, 224, 0.2);
}

/* ===== TOUR CARDS 3D TILT ===== */
.tours-grid {
    perspective: 1200px;
}

.tour-card[data-tilt] {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.tour-card[data-tilt] .card-badge {
    transform: translateZ(30px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
}

.tour-card[data-tilt]:hover .card-badge {
    transform: translateZ(45px) scale(1.1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tour-card[data-tilt] .card-info {
    transform: translateZ(20px);
    transition: transform 0.3s ease;
}

.tour-card[data-tilt]:hover .card-info {
    transform: translateZ(30px);
}

/* Tilt glare overlay */
.tour-card .js-tilt-glare {
    border-radius: var(--border-radius-card, 20px);
}

/* ===== PARALLAX DIORAMA (Why Choose Us) ===== */
.why-choose-us--diorama {
    position: relative;
}

.choose-img-wrapper--parallax {
    perspective: 800px;
    transform-style: preserve-3d;
    overflow: visible;
}

.choose-img-wrapper--parallax .choose-img {
    transition: transform 0.12s ease-out;
    will-change: transform;
    border-radius: 20px;
}

/* Micro hover scale on the image */
.choose-img-wrapper--parallax:hover .choose-img {
    box-shadow: 0 20px 60px rgba(10, 17, 40, 0.15);
}

/* ===== SECTION TRANSITION GRADIENT ===== */
.why-choose-us--diorama::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 17, 40, 0.03) 40%,
        rgba(10, 17, 40, 0.08) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* ===== FEATURE ITEMS — ScrollTrigger targets ===== */
.feature-item.fv-st-hidden {
    opacity: 0;
    transform: translateX(-50px);
}

.feature-item.fv-st-visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-3d-canvas,
    .globe-mini-canvas {
        display: none !important;
    }

    .hero--3d.fv-3d-active .hero-image-col--fallback {
        display: block;
    }

    .hero-title-3d .fv-word {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-cta--3d:hover {
        transform: none;
        box-shadow: none;
    }

    .tour-card[data-tilt] {
        transform: none !important;
    }

    .choose-img-wrapper--parallax .choose-img {
        transform: none !important;
        transition: none;
    }

    .feature-item.fv-st-hidden {
        opacity: 1;
        transform: none;
    }
}
