/* ========================= */
/* RESET */
/* ========================= */
* {
  margin: 0; 
  /* Elimina márgenes por defecto de todos los elementos */

  padding: 0; 
  /* Elimina rellenos por defecto */

  box-sizing: border-box;
  /* Incluye padding y border dentro del tamaño total del elemento */
  /* Mejora el control de layouts (buena práctica moderna) */
}


/* ========================= */
/* BASE */
/* ========================= */
html {
  scroll-behavior: smooth;
  /* Permite desplazamiento suave al usar anclas (#inicio, etc.) */
}

body {
  font-family: Arial, sans-serif;
  /* Define tipografía principal con fallback genérico */

  line-height: 1.6;
  /* Mejora la legibilidad del texto */

  color: #f5f5f5;
  /* Color base del texto (gris oscuro, menos agresivo que negro) */
  background-color: #121212;
}


/* ========================= */
/* HERO */
/* ========================= */
header {
  position: relative;
  /* Permite posicionar elementos hijos de forma absoluta dentro */

  height: 60vh;
  /* Altura relativa al viewport (60% de la pantalla) */

  overflow: hidden;
  /* Oculta partes de imágenes que sobresalen */
}

.carousel img {
  position: absolute;
  /* Permite superponer todas las imágenes */

  width: 100%;
  height: 60vh;

  object-fit: cover;
  /* Ajusta imagen sin deformarla */

  object-position: center 60%; 

  opacity: 0;
  /* Todas las imágenes ocultas por defecto */

  transition: opacity 1s ease;
  /* Transición suave para efecto fade */

  filter: contrast(1.05) saturate(1.1) brightness(0.95);
}

.carousel img.active {
  opacity: 1;
  /* Solo la imagen activa se muestra */
}

/* CONTROLES (ACCESIBLE) */
.controles {
  position: absolute;
  width: 100%;

  top: 50%;
  transform: translateY(-50%);
  /* Centrado vertical */

  display: flex;
  justify-content: space-between;
  /* Botones en extremos */

  padding: 0 20px;
}

.controles button {
  color: white;
  font-size: 30px;

  cursor: pointer;
  /* Indica que es clicable */

  background: rgba(0,0,0,0.5);
  /* Fondo semitransparente */

  padding: 10px;
  border-radius: 50%;
  /* Forma circular */

  border: none;
  /* Elimina borde por defecto */

  transition: 0.3s;
}

.controles button:hover {
  background: rgba(0,0,0,0.8);
  /* Oscurece al pasar el ratón */
}

/* TEXTO HERO */
.hero-text {
  position: absolute;

  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Centrado perfecto (horizontal y vertical) */

  color: white;
  text-align: center;
  background: rgba(0,0,0,0.6);
  /* Fondo para mejorar contraste */

  padding: 20px;

  border: 1px solid #c9a74d;
  border-radius: 10px;
}

/* ========================= */
/* NAV */
/* ========================= */
nav {
  position: relative;
  z-index: 1000;
  background: #1e1e1e;
  /* Color verde asociado a naturaleza */
}

.menu {
  z-index: 9999;
}

.menu li a {
  color: #f5f5f5;
}

.menu li a:hover,
.menu li a.active {
  background: #c9a74d;
  color: #121212;
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
  /* Permite posicionar hamburguesa */

  padding: 30px 10px;
}


/* MENÚ */
.menu {
  display: flex;
  gap: 40px;
  /* Espaciado entre elementos */

  list-style: none;
  /* Elimina viñetas */
}

.menu li a {
  color: white;
  text-decoration: none;
  /* Quita subrayado */

  font-weight: bold;

  padding: 10px 15px;
  border-radius: 5px;

  transition: 0.3s;
}

.menu li a:hover,
.menu li a.active {
  background: #c9a74d;
  color: #121212;
  /* Inversión de colores al interactuar */
}


/* HAMBURGUESA */
.hamburger {
  display: none;
  /* Oculto en escritorio */

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  cursor: pointer;

  z-index: 1000;
  /* Prioridad visual */
}

.hamburger span {
  display: block;

  width: 30px;
  height: 3px;

  background: white;

  margin: 6px 0;

  transition: 0.4s;
}


/* ANIMACIÓN */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  /* Primera barra rota */
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  /* Barra central desaparece */
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  /* Tercera barra rota */
}

a:focus,
button:focus,
input:focus{
  outline: 2px solid #c9a74d;
  outline-offset: 3px;
}

/* ========================= */
/* CONTENEDOR GLOBAL */
/* ========================= */
.container {
  max-width: 1000px;
  /* Limita ancho del contenido */

  margin: 0 auto;
  /* Centra horizontalmente */

  padding: 0 20px;
  /* Margen lateral interno */
}

/* ========================= */
/* SECTIONS */
/* ========================= */
section {
  display: none;
  /* Oculta todas las secciones (SPA) */

  padding: 60px 0;
  /* Espaciado vertical */
}

section.active {
  display: block;
  /* Solo la sección activa se muestra */
}

/* ========================= */
/* INICIO */
/* ========================= */
.inicio-texto {
  margin-bottom: 30px;
}

.inicio-texto h2 {
  margin-bottom: 10px;
}

.inicio-texto p {
  color: #bdbdbd;
  /* Gris suave para lectura */
  margin-bottom: 15px;
}

.inicio-imagenes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Dos columnas */

  gap: 20px;
}

.inicio-imagenes img {
  width: 100%;
  border-radius: 10px;

  transition: 0.3s;
}

.inicio-imagenes img:hover {
  transform: scale(1.05);
  /* Efecto zoom */
}


/* ========================= */
/* TÍTULOS */
/* ========================= */
.titulo-seccion {
  text-align: left;
  margin-bottom: 30px;
}


/* ========================= */
/* ESPECIES */
/* ========================= */
.especies-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* TARJETAS */
.card-horizontal {
  display: flex;
  align-items: center;

  gap: 20px;

  background: #1e1e1e;
   color: #f5f5f5;

  padding: 20px;

  border-radius: 15px;

  box-shadow: 0 5px 20px rgba(0,0,0,0.6);
  /* Sombra ligera */

  transition: 0.3s;
}

.card-horizontal:hover {
  transform: translateY(-5px);
  /* Efecto elevación */
}

.card-horizontal img {
  width: 150px;
  height: 150px;

  border-radius: 50%;
  /* Imagen circular */

  object-fit: cover;
}

.info h3 {
  margin-bottom: 8px;
}

.info p {
  color: #bdbdbd;
}


/* ========================= */
/* GALERÍA */
/* ========================= */
.imagen-principal {
  margin-bottom: 20px;
}

.imagen-principal img {
  width: 100%;
  max-height: 500px;

  object-fit: cover;
  border-radius: 15px;

  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  filter: contrast(1.05) saturate(1.1);
}

.thumbnails {
  display: flex;
  justify-content: center;

  gap: 15px;

  flex-wrap: wrap;
  /* Permite salto de línea */
}

.thumbnails img {
  width: 110px;
  height: 75px;

  object-fit: cover;
  border-radius: 8px;

  cursor: pointer;
  transition: 0.3s;
  opacity: 0.85;
}

.thumbnails img:hover {
  opacity: 1;
  transform: scale(1.1);
}

.thumbnails img.active {
  border: 3px solid #c9a74d;
  opacity: 1;
}


/* ========================= */
/* CONTACTO */
/* ========================= */
.contacto-container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

.form-box {
  padding: 15px;
  background: #1e1e1e;
  border-radius: 10px;
}

.form-titulo {
  margin-bottom: 15px;
}

.formulario {
  display: flex;
  flex-direction: column;
  gap: 20px;

  padding: 20px;

  border-radius: 15px;

  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.grupo {
  border: 2px solid #c9a74d;
  border-radius: 10px;
  padding: 20px;
}

.grupo legend {
  padding: 0 10px;
  font-size: 14px;
  color: #555;
}

.campo {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.campo label {
  margin-bottom: 5px;
  font-weight: bold;
}

.campo input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.campo input:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 5px rgba(46,125,50,0.3);
}

.error {
  color: red;
  font-size: 12px;
  height: 14px;
}

input.error-input {
  border: 2px solid red;
}

.formulario button {
  background: #c9a74d;
  color: #121212;

  border: none;

  padding: 12px;

  border-radius: 8px;

  cursor: pointer;

  width: 150px;
}

.formulario button:hover {
  background: #a8892f;
}

.campo.obligatorio label::after {
  content: " *";
  color: red;
}

.success-message{
  color: #4caf50;
  font-weight: bold;
  margin-top: 10px;
}

.error-input{
  border: 2px solid red;
}

.campo input.valid{
  border: 2px solid #4caf50;
}

/* ========================= */
/* FOOTER */
/* ========================= */
footer {
  text-align: center;
  padding: 20px;
  background: #1e1e1e;
}


/* ========================= */
/* RESPONSIVE */
/* ========================= */
@media (max-width:768px){
  /* Adaptación a móviles */

  .menu {
    position: absolute;
    top: 90px;
    left: 0;
    width: 100%;

    background: #121212;

    display: none;
    flex-direction: column;
    align-items: center;

    gap: 25px;
    padding: 25px 0;

    animation: fadeIn 0.3s ease;
  }

  .menu li a {
    width: 100%;
    text-align: center;
    padding: 15px;
  }

  .menu li a:hover {
    background: #c9a74d;
    color: #121212;
    letter-spacing: 1px; /* efecto refinado */
  }

  .menu.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .inicio-imagenes {
    grid-template-columns: 1fr;
  }

  .card-horizontal {
    flex-direction: column;
    text-align: center;
  }

  .imagen-principal img {
    max-height: 250px;
  }

  .thumbnails img {
    width: 70px;
    height: 50px;
  }
}


/* ANIMACIÓN */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}