/* ========================================
   RASTI - Hero Section & Carousel Styles
   ======================================== */

.hero {
    min-height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 2rem 0;
    background: var(--white);
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

/* Hero Decorations - Floating SVG elements */
.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.hero-decor {
    position: absolute;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* =========================================
   ICONOS PRINCIPALES - Figuras grandes
   ========================================= */

/* Tren - Lado izquierdo inferior */
.decor-train {
    top: 75%;
    left: 3%;
    width: 100px;
    animation: floatDecor1 9s ease-in-out infinite;
}

/* Tren largo - Arriba al centro-izquierda */
.decor-train-long {
    top: 5%;
    left: 15%;
    width: 130px;
    animation: floatDecor2 10s ease-in-out infinite 0.5s;
}

/* Castillo - Lado derecho superior */
.decor-castle {
    top: 8%;
    right: 8%;
    width: 85px;
    animation: floatDecor1 8s ease-in-out infinite 1s;
}

/* Conejo - Lado derecho inferior */
.decor-rabbit {
    top: 70%;
    right: 5%;
    width: 75px;
    animation: floatDecor3 7s ease-in-out infinite 0.3s;
}

/* Niño bajo hongo - Centro inferior */
.decor-mushroom {
    top: 80%;
    left: 45%;
    width: 70px;
    animation: floatDecor1 8s ease-in-out infinite 0.8s;
}

/* Cohete - Superior centro-derecha */
.decor-rocket {
    top: 12%;
    right: 25%;
    width: 65px;
    animation: floatDecor2 7.5s ease-in-out infinite 0.4s;
}

/* =========================================
   ICONOS MEDIANOS - Estrellas y luna
   ========================================= */

/* Estrella dorada - Izquierda superior */
.decor-star-1 {
    top: 15%;
    left: 5%;
    width: 45px;
    animation: floatDecor1 8s ease-in-out infinite;
}

/* Luna creciente - Centro izquierda */
.decor-moon {
    top: 40%;
    left: 6%;
    width: 50px;
    animation: floatDecor2 7s ease-in-out infinite 0.5s;
}

/* Estrella pequeña - Centro superior */
.decor-star-2 {
    top: 3%;
    left: 45%;
    width: 38px;
    animation: floatDecor3 6s ease-in-out infinite 0.2s;
}

/* Sparkle - Derecha media */
.decor-star-3 {
    top: 45%;
    right: 8%;
    width: 42px;
    animation: floatDecor1 7s ease-in-out infinite 0.7s;
}

/* Estrella - Izquierda inferior */
.decor-star-4 {
    top: 85%;
    left: 25%;
    width: 40px;
    animation: floatDecor2 8s ease-in-out infinite 0.4s;
}

/* =========================================
   ICONOS PEQUEÑOS - Sparkles/puntos
   ========================================= */

/* Sparkle - Superior derecha */
.decor-sparkle-1 {
    top: 25%;
    right: 22%;
    width: 32px;
    animation: floatDecor3 5s ease-in-out infinite;
}

/* Sparkle - Inferior centro */
.decor-sparkle-2 {
    top: 88%;
    right: 30%;
    width: 30px;
    animation: floatDecor1 6s ease-in-out infinite 0.3s;
}

/* Sparkle pequeño - Izquierda media */
.decor-sparkle-3 {
    top: 55%;
    left: 8%;
    width: 22px;
    animation: floatDecor2 5.5s ease-in-out infinite 0.6s;
}

/* Floating animations for decorations */
@keyframes floatDecor1 {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-12px) rotate(5deg);
    }
}

@keyframes floatDecor2 {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(-3deg);
    }
}

@keyframes floatDecor3 {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-6px) scale(1.05);
    }
}

/* Social Proof Badge */
.social-proof-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #7ee8e8;
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    border: none;
}

.social-proof-number {
    font-weight: 700;
    color: var(--white);
    font-size: 1.1rem;
}

.social-proof-text {
    color: var(--white);
    font-size: 0.95rem;
}

.social-proof-sparkle {
    color: var(--white);
    margin-left: 0.25rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(242, 158, 120, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    width: 100%;
    overflow: visible;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    transform: translateX(0);
}

/* Entry positions (before animation starts) */
.hero-slide.slide-enter-left {
    opacity: 0;
    position: absolute;
    transform: translateX(-100%);
    pointer-events: none;
}

.hero-slide.slide-enter-right {
    opacity: 0;
    position: absolute;
    transform: translateX(100%);
    pointer-events: none;
}

/* Entering animation (in progress) */
.hero-slide.slide-entering {
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Exit animations */
.hero-slide.slide-exit-left {
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    transform: translateX(-100%);
    opacity: 0;
}

.hero-slide.slide-exit-right {
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    transform: translateX(100%);
    opacity: 0;
}

/* Centered Institutional Slide */
.hero-centered-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hero-content-centered {
    max-width: 800px;
    text-align: center;
    padding: 2rem;
}

.hero-title-centered {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.hero-subtitle-centered {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions-centered {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Left Content */
.hero-content {
    max-width: 540px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.hero-accent {
    color: var(--primary);
    position: relative;
}

.hero-tagline {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-800);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* Hero Collage */
.hero-collage {
    position: relative;
    width: 520px;
    height: 450px;
    overflow: visible;
}

/* Collage Background SVG */
.collage-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: auto;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

/* Navigation Arrows - Positioned at hero edges */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.6rem 0.5rem;
    min-width: auto;
    z-index: 100;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
}

.nav-arrow svg {
    display: block;
}

.nav-arrow-left {
    left: 1rem;
}

.nav-arrow-right {
    right: 1rem;
}

.nav-arrow:hover {
    transform: translateY(-50%) scale(1.1);
    background-color: var(--primary);
    color: white;
}

.nav-arrow-left:hover {
    transform: translateY(-50%) translateX(-3px) scale(1.1);
}

.nav-arrow-right:hover {
    transform: translateY(-50%) translateX(3px) scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-grid {
        gap: 3rem;
    }

    .hero-collage {
        width: 500px;
        height: 450px;
    }

    /* Reduce decoration opacity on tablet */
    .hero-decor {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {

    /* Keep some decorations on mobile */
    .hero-decorations {
        display: block;
        opacity: 0.55;
    }

    .hero-decor {
        opacity: 0.55;
        transform: scale(0.75);
    }

    .decor-train-long,
    .decor-mushroom,
    .decor-star-2,
    .decor-star-3,
    .decor-star-4,
    .decor-sparkle-1,
    .decor-sparkle-2,
    .decor-sparkle-3 {
        display: none;
    }

    .hero {
        min-height: auto;
        margin-top: var(--navbar-height);
        padding: 1rem 0 2rem;
    }

    .social-proof-badge {
        order: 3;
        margin-bottom: 1rem;
    }

    .hero::before {
        width: 400px;
        height: 400px;
        top: -30%;
        right: -20%;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(3rem, 8vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding: 0 0.5rem;
    }

    .hero-actions {
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-actions .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        flex: 1;
        min-width: 140px;
    }

    /* Collage - Mobile floating style like desktop */
    .hero-collage {
        display: block;
        position: relative;
        width: 100%;
        height: 280px;
        max-width: 320px;
        margin: -1rem auto 1rem auto;
        overflow: visible;
        order: 3;
        /* After subtitle, before buttons */
    }

    .collage-img {
        position: absolute !important;
    }

    /* Imagen 1: Libro abierto (destacado - más grande) */
    .collage-img-1 {
        top: -18px !important;
        left: 0 !important;
        right: auto !important;
        width: 220px !important;
        animation: float1 7s ease-in-out infinite !important;
        z-index: 4 !important;
    }

    /* Imagen 2: Arriba derecha */
    .collage-img-2 {
        top: 20px !important;
        right: -5px !important;
        left: auto !important;
        width: 185px !important;
        animation: float2 8s ease-in-out infinite !important;
        z-index: 3 !important;
    }

    /* Imagen 3: Abajo centro */
    .collage-img-3 {
        top: 125px !important;
        left: 15% !important;
        right: auto !important;
        width: 155px !important;
        animation: float3 6.5s ease-in-out infinite !important;
        z-index: 2 !important;
    }

    /* Reorder hero elements for mobile */
    .hero-grid {
        display: flex;
        flex-direction: column;
    }

    .hero-content {
        display: contents;
    }

    .hero-title {
        order: 1;
        margin-bottom: 0;
    }

    .hero-subtitle {
        order: 2;
    }

    .hero-actions {
        order: 4;
    }

    .collage-img-inner {
        /* Usamos drop-shadow de collage.css que sigue la forma del PNG */
        border-radius: 0;
        box-shadow: none;
    }

    /* Mobile floating animations with rotations */
    @keyframes float1 {

        0%,
        100% {
            transform: rotate(-2deg) translateY(0);
        }

        50% {
            transform: rotate(0deg) translateY(-12px);
        }
    }

    @keyframes float2 {

        0%,
        100% {
            transform: rotate(4deg) translateY(0);
        }

        50% {
            transform: rotate(4deg) translateY(-18px);
        }
    }

    @keyframes float3 {

        0%,
        100% {
            transform: rotate(-3deg) translateY(0);
        }

        50% {
            transform: rotate(-3deg) translateY(-10px);
        }
    }

    /* Centered slide optimization */
    .hero-centered-wrapper {
        min-height: 400px;
    }

    .hero-content-centered {
        padding: 1.5rem 1rem;
    }

    .hero-title-centered {
        font-size: clamp(2rem, 7vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-subtitle-centered {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .hero-actions-centered {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions-centered .btn-primary,
    .hero-actions-centered .btn-outline {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }

    /* Hide navigation arrows on mobile - use swipe instead */
    .nav-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-bottom: 0;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn-large {
        width: 100%;
        min-width: unset;
    }

    .nav-arrow-left {
        left: 0.5rem;
    }

    .nav-arrow-right {
        right: 0.5rem;
    }
}
