/* ========================================================
   VARIABLES GLOBALES
   ======================================================== */
:root {
    --primary-green: #16a34a;
    --brand-lime: #22c55e;
    --brand-purple: #7e22ce;
    --brand-light-purple: #a855f7;
    --primary-dark: #0f172a;
    --secondary-dark: #1e293b;
    --text-main: #334155;
    --text-light: #f8fafc;
    --bg-light: #f8fafc;
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.4s ease;
}

/* ========================================================
   RESET Y BASE
   ======================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================================
   PRELOADER: COLIBRÍ PICANDO CADA LETRA (SIN FONDO)
   ======================================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.hide-preloader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Escenario conjunto colibrí + texto */
.preloader-main-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
}

/* Colibrí volando */
.colibri-actor {
    position: relative;
    width: 110px;
    height: 100px;
    margin-right: -15px; /* Acerca el pico hacia el texto */
    z-index: 2;
    transform-origin: 20% 70%;
    animation: flightHover 1.8s ease-in-out infinite alternate;
}

/* Animación de picotazo activada con cada letra */
.colibri-actor.peck {
    animation: peckAction 0.15s ease-out;
}

/* Imagen del colibrí sin marco ni fondo blanco */
.colibri-actor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply; /* Elimina cualquier recuadro blanco residual */
    filter: none;
    animation: flapWings 0.12s ease-in-out infinite alternate;
}

@keyframes flightHover {
    0% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
    100% { transform: translateY(4px) rotate(-1deg); }
}

@keyframes flapWings {
    0% { transform: scaleY(1); }
    100% { transform: scaleY(0.92); }
}

@keyframes peckAction {
    0% { transform: translate(6px, -4px) rotate(-10deg) scale(1.08); }
    50% { transform: translate(14px, 2px) rotate(15deg) scale(0.98); }
    100% { transform: translate(0px, 0px) rotate(0deg) scale(1); }
}

/* Texto de la máquina de escribir */
.typewriter-container {
    display: flex;
    align-items: center;
    min-height: 60px;
    z-index: 1;
}

.typewriter-text {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.text-eco {
    color: var(--brand-purple);
}

.text-verde {
    color: var(--primary-green);
}

.cursor {
    display: inline-block;
    width: 4px;
    height: 2.6rem;
    background-color: var(--primary-green);
    margin-left: 4px;
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.preloader-subtext {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease;
}

.preloader-subtext.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================
   HEADER & NAVBAR
   ======================================================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 7%;
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo h2 {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 1px;
}

.eco-purple { color: #c084fc; }
.verde-green { color: #4ade80; }

.logo small {
    display: block;
    color: #94a3b8;
    font-size: 0.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: #4ade80;
}

.btn-nav {
    background-color: var(--primary-green);
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    color: #fff !important;
}

.btn-nav:hover {
    background-color: #15803d;
}

.btn-replay {
    background-color: transparent;
    border: 1px solid #4ade80;
    color: #4ade80;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-replay:hover {
    background-color: #4ade80;
    color: var(--primary-dark);
}

/* ========================================================
   BANNER ROTATORIO (SLIDER)
   ======================================================== */
.slider-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background-color: #0b1120;
}

.slide {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right; /* Da prioridad al lado visual derecho de la imagen */
    filter: brightness(0.65);       /* Brillo equilibrado para que no quede oscura */
}

.slide-caption {
    position: absolute;
    bottom: 45px;
    left: 60px;
    max-width: 520px;
    background: rgba(15, 23, 42, 0.82); /* Fondo oscuro elegante */
    backdrop-filter: blur(8px);         /* Difumina el fondo detrás del texto */
    -webkit-backdrop-filter: blur(8px);
    padding: 1.6rem 2rem;
    border-radius: 12px;
    border-left: 5px solid var(--primary-green);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.slide-caption .badge {
    background-color: var(--primary-green);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 0.6rem;
}

.slide-caption h2 {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.slide-caption p {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(15, 23, 42, 0.6);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
}

.nav-btn:hover {
    background-color: var(--primary-green);
}

.prev { left: 20px; }
.next { right: 20px; }

.dots-wrapper {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dot.active, .dot:hover {
    background-color: #4ade80;
    transform: scale(1.2);
}

.fade {
    animation: fadeEffect 0.8s ease-in-out;
}

@keyframes fadeEffect {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* ========================================================
   SECCIONES GENERALES Y QUIÉNES SOMOS
   ======================================================== */
.section-container {
    padding: 5rem 8%;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.subtitle {
    color: var(--primary-green);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-top: 0.3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.about-info h2 {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin: 0.3rem 0 1rem 0;
}

.about-info p {
    margin-bottom: 1rem;
    color: #475569;
}

.stats-row {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-box {
    border-left: 3px solid var(--primary-green);
    padding-left: 1rem;
}

.stat-box h4 {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.stat-box p {
    font-size: 0.85rem;
    margin: 0;
}

.about-banner-card {
    background: linear-gradient(135deg, var(--secondary-dark), var(--primary-dark));
    color: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    border-top: 5px solid #4ade80;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.about-banner-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-banner-card p {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-green);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    transition: background-color var(--transition-fast);
}

.btn-primary:hover {
    background-color: #15803d;
}

/* ========================================================
   CICLO DE VIDA
   ======================================================== */
.cycle-section {
    background-color: var(--bg-light);
    padding: 5rem 8%;
}

.cycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.cycle-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    border-top: 4px solid var(--primary-green);
    transition: transform var(--transition-fast);
}

.cycle-card:hover {
    transform: translateY(-6px);
}

.cycle-card.highlight {
    border: 2px solid var(--primary-green);
}

.step-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: #e2e8f0;
    position: absolute;
    top: 15px;
    right: 20px;
}

.card-img-placeholder {
    width: 100%;
    height: 190px;
    margin-bottom: 1.2rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.card-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cycle-card h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
}

.cycle-card p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ========================================================
   MATERIALES
   ======================================================== */
.materials-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tag {
    background-color: #e2e8f0;
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
}

/* ========================================================
   FOOTER
   ======================================================== */
.main-footer {
    background-color: var(--primary-dark);
    color: #94a3b8;
    padding: 4rem 8% 2rem 8%;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    color: #ffffff;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.footer-details h4, .footer-cta h4 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.footer-details ul {
    list-style: none;
}

.footer-details li {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    border: 1px solid #4ade80;
    color: #4ade80;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    margin-top: 1rem;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background-color: #4ade80;
    color: var(--primary-dark);
}

.footer-copy {
    text-align: center;
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    font-size: 0.85rem;
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .slide-caption h2 { font-size: 1.8rem; }
    .slider-container { height: 400px; }
}

@media (max-width: 600px) {
    .main-header { flex-direction: column; gap: 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
    .typewriter-text { font-size: 2rem; }
    .slide-caption h2 { font-size: 1.4rem; }
}

/* Adaptación para pantallas móviles */
@media (max-width: 768px) {
    .slide-caption {
        left: 20px;
        right: 20px;
        bottom: 25px;
        max-width: none;
        padding: 1.2rem;
    }
    .slide-caption h2 {
        font-size: 1.35rem;
    }
    .slide-caption p {
        font-size: 0.85rem;
    }
}