* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #c9c9c9;
    font-family: 'Roboto Slab', serif;
    color: #333;
    overflow-x: hidden;
    line-height: 1.6;
}

:root {
    --rojo-principal: #D30F23;
    --rojo-oscuro: #A30B1B;
    --rojo-brillante: #E03143;
    --blanco: #ffffff;
    --gris-suave: #F2F0F1;
    --gris-claro: #E4E1E3;
    --texto-oscuro: #1F1B1C;
    --gris-texto: #6B6768;
}

/* ========= HERO SUPERIOR ========= */
.hero-habitad {
    position: relative;
    width: 100%;
    margin-top: 65px;
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--rojo-oscuro) 0%, var(--rojo-principal) 60%, var(--rojo-brillante) 100%);
    box-shadow: 0 8px 24px rgba(211,15,35,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 30px 16px 30px;
    color: var(--blanco);
}

.hero-habitad::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.hero-habitad::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    pointer-events: none;
}

.hero-info {
    text-align: center;
    z-index: 2;
}

.hero-info h1 {
    font-family: 'Roboto Slab', serif;
    font-size: 2.3rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--blanco);
}

.hero-info .hero-subtitulo {
    display: block;
    font-family: 'Roboto Slab', serif;
    font-style: italic;
    font-size: 1rem;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 400;
}

/* ========= CONTENIDO PRINCIPAL ========= */
.contenedor-pagina {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px 60px 20px;
}

/* ========= SLIDE INDIVIDUAL (VIDEO + AVES) ========= */
.carrusel-slide {
    display: none;
    opacity: 0;
    margin: 0 auto;
    padding: 0 0 60px 0;
    transition: opacity 0.6s ease;
}

.carrusel-slide.active {
    display: block;
    opacity: 1;
}

.carrusel-slide.transitioning-in {
    display: block;
    opacity: 0;
}

.carrusel-slide.transitioning-active {
    opacity: 1;
}

/* ========= VIDEO STAGE ========= */
.video-stage {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
}

.video-container {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    max-height: 700px;
    background: #000;
    overflow: hidden;
    position: relative;
}

.video-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            #c9c9c9 0%,
            rgba(201,201,201,0.8) 5%,
            rgba(201,201,201,0) 15%,
            rgba(201,201,201,0) 85%,
            rgba(201,201,201,0.8) 95%,
            #c9c9c9 100%);
    pointer-events: none;
    z-index: 2;
}

.video-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0) 35%,
        rgba(0,0,0,0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-overlay-title {
    position: absolute;
    bottom: 8%;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    padding: 0 20px;
}

.video-overlay-title .habitat-titulo {
    color: #fff;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 30px rgba(0,0,0,0.35);
    font-size: 2.6rem;
    font-family: 'Roboto Slab', serif;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
}

.video-overlay-title .habitat-titulo::before,
.video-overlay-title .habitat-titulo::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 3px;
    background: #fff;
    vertical-align: middle;
    margin: 0 15px;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* ========= INDICADORES ========= */
.carrusel-indicadores {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0 10px 0;
    pointer-events: auto;
}

.carrusel-indicador {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gris-claro);
    cursor: pointer;
    transition: all 0.35s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.carrusel-indicador:hover {
    background: var(--gris-texto);
}

.carrusel-indicador.active {
    background: var(--rojo-principal);
    border-color: var(--rojo-principal);
    transform: scale(1.35);
    box-shadow: 0 0 10px rgba(211,15,35,0.4);
}

.carrusel-contador {
    font-family: 'Roboto Slab', serif;
    color: var(--texto-oscuro);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-left: 30px;
    background: var(--blanco);
    padding: 6px 16px;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* ========= AVES ZONE ========= */
.contenido-aves-wrap {
    padding: 0;
    margin-top: 14px;
}

.aves-titulo {
    font-size: 1.5rem;
    color: var(--rojo-principal);
    margin-bottom: 30px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    position: relative;
}

.aves-titulo::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background: var(--rojo-principal);
    margin: 12px auto 0;
    border-radius: 2px;
}

.contenedor-aves {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ave-card {
    background: var(--blanco);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: cardEnter 0.9s ease-out forwards;
}

@keyframes cardEnter {
    0%   { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.ave-card:nth-child(1) { animation-delay: 0.05s; }
.ave-card:nth-child(2) { animation-delay: 0.15s; }
.ave-card:nth-child(3) { animation-delay: 0.25s; }
.ave-card:nth-child(4) { animation-delay: 0.35s; }
.ave-card:nth-child(5) { animation-delay: 0.45s; }
.ave-card:nth-child(6) { animation-delay: 0.55s; }
.ave-card:nth-child(7) { animation-delay: 0.65s; }
.ave-card:nth-child(8) { animation-delay: 0.75s; }

.ave-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 30px rgba(211,15,35,0.28);
}

.galeria-imagen-principal {
    position: relative;
    overflow: hidden;
}

.ave-imagen {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: var(--gris-claro);
    display: block;
    transition: transform 0.6s ease;
}

.ave-card:hover .ave-imagen {
    transform: scale(1.08);
}

.badge-habitat {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rojo-principal);
    color: var(--blanco);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    letter-spacing: 0.4px;
}

.ave-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ave-info h2 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 0 4px 0;
    color: var(--texto-oscuro);
}

.nombre-cientifico {
    font-family: 'Roboto Slab', serif;
    font-style: italic;
    color: var(--gris-texto);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: block;
}

.btn-mas {
    display: inline-block;
    margin-top: auto;
    background: linear-gradient(135deg, var(--rojo-oscuro), var(--rojo-principal));
    color: var(--blanco);
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Roboto Slab', serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid var(--rojo-principal);
}

.btn-mas:hover {
    background: var(--blanco);
    color: var(--rojo-principal);
}

.sin-aves {
    text-align: center;
    padding: 40px;
    color: var(--texto-oscuro);
    font-size: 1.1rem;
    background: var(--blanco);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

/* ========= FLECHAS DE NAVEGACIÓN (fixed) ========= */
.carrusel-flecha {
    position: fixed;
    top: 46vh;
    z-index: 9999;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.9);
    border: 2px solid var(--rojo-principal);
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    color: var(--rojo-principal);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    outline: none;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.carrusel-flecha:hover {
    background: var(--rojo-principal);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(211,15,35,0.35);
}

.carrusel-flecha:active {
    transform: scale(0.95);
}

.carrusel-flecha.prev { left: 24px; }
.carrusel-flecha.next { right: 24px; }

/* ========= FALLBACK VIDEO ========= */
.video-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: 2;
    padding: 20px;
}

.video-fallback-content {
    text-align: center;
    color: #fff;
    max-width: 600px;
}

.video-fallback-icono {
    font-size: 4rem;
    color: var(--rojo-principal);
    margin-bottom: 15px;
    text-shadow: 0 4px 15px rgba(211, 15, 35, 0.5);
}

.video-fallback-content h3 {
    font-family: 'Roboto Slab', serif;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.video-fallback-content p {
    font-family: 'Roboto Slab', serif;
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 1024px) {
    .contenedor-aves { grid-template-columns: repeat(2, 1fr); }
    .carrusel-flecha.prev { left: 8px; }
    .carrusel-flecha.next { right: 8px; }
}

@media (max-width: 768px) {
    .hero-info h1 { font-size: 1.8rem; }
    .video-container { height: 50vh; min-height: 320px; }
    .video-overlay-title .habitat-titulo { font-size: 1.8rem; }
    .carrusel-flecha { width: 44px; height: 44px; font-size: 1.5rem; }
    .carrusel-flecha.prev { left: 4px; }
    .carrusel-flecha.next { right: 4px; }
    .video-overlay-title .habitat-titulo::before,
    .video-overlay-title .habitat-titulo::after { width: 25px; margin: 0 8px; }
}

@media (max-width: 600px) {
    .contenedor-aves { grid-template-columns: 1fr; }
    .video-container { height: 40vh; min-height: 240px; }
    .video-overlay-title .habitat-titulo { font-size: 1.4rem; }
    .aves-titulo { font-size: 1.2rem; }
    .carrusel-flecha { width: 38px; height: 38px; font-size: 1.2rem; }
    .carrusel-flecha.prev { left: 2px; }
    .carrusel-flecha.next { right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .ave-card {
        animation: none !important;
        transition: none !important;
    }
}

*, *::before, *::after {
    font-family: 'Roboto Slab', serif !important;
}
