/* -----------------------------------------------------------------------------
 * Landing Etani - Hoja de estilos principal
 * Estandar de documentacion aplicado:
 * - Variables globales en :root (design tokens)
 * - Bloques comentados por componente
 * - Media queries agrupadas al final
 * --------------------------------------------------------------------------- */

/* Design tokens: colores, superficies y sombras */
:root {
  --bg: #f6f7f1;
  --surface: #ffffff;
  --surface-soft: #edf0e4;
  --text: #14181c;
  --muted: #4e5549;
  --line: #d6ddcc;
  --green-900: #44561c;
  --green-700: #6f8e2a;
  --green-500: #99bf40;
  --shadow: 0 16px 40px rgba(47, 61, 22, 0.16);
}

/* Reset basico de caja para predecibilidad de layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Base del documento */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  /* Fondo de puntitos uniforme */
  background-color: #f8f8f8;
  background-image: radial-gradient(circle at 1px 1px, rgba(120, 120, 120, 0.36) 0.65px, transparent 0.75px);
  background-size: 4px 4px;
}

/* Contenedor principal centrado */
.page {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 1.3rem auto 2rem;
}

/* Separacion vertical entre secciones */
.section {
  margin-bottom: 1.8rem;
}

/* -----------------------------------------------------------------------------
 * HERO
 * --------------------------------------------------------------------------- */

/* Tarjeta principal del hero */
.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fafbf7 100%);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(43, 55, 23, 0.08);
}

/* Fondo decorativo superior tipo red/patron tecnico */
.hero-tech-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 170px;
  background:
    radial-gradient(circle at 80% 25%, rgba(169, 196, 82, 0.34), transparent 42%),
    radial-gradient(circle at 18% 8%, rgba(128, 152, 48, 0.3), transparent 46%),
    linear-gradient(135deg, #596f23 0%, #89a936 47%, #4b6120 100%);
}

/* Capas decorativas del patron */
.hero-tech-pattern::before,
.hero-tech-pattern::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 42px 42px;
}

/* Mallado suave de puntos y lineas */
.hero-tech-pattern::before {
  background-image:
    radial-gradient(circle at 5px 5px, rgba(255, 255, 255, 0.3) 1.4px, transparent 0),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  opacity: 0.7;
}

/* Degradado de oscurecimiento para legibilidad */
.hero-tech-pattern::after {
  background: linear-gradient(180deg, rgba(38, 46, 16, 0.2), rgba(38, 46, 16, 0));
}

/* Fila superior con logo */
.hero-top {
  position: relative;
  z-index: 2;
  padding: 1rem 1.3rem;
}

/* Pastilla del logo */
.logo-wrap {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(218, 227, 186, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* Tamano del logo */
.logo {
  width: 170px;
  height: auto;
  display: block;
}

/* Distribucion de contenido del hero (texto + foto) */
.hero-content {
  position: relative;
  z-index: 2;
  padding: 1rem 1.4rem 1.6rem;
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 1.3rem;
  align-items: stretch;
}

/* Ajuste fino del bloque de texto */
.hero-copy {
  margin-top: 1.15rem;
}

/* Titulo principal */
h1 {
  margin: 0 0 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.55rem, 2.1vw, 2.45rem);
}

/* Subtitulo tecnico */
.subtitle {
  margin: 0;
  font-size: clamp(1.06rem, 1.8vw, 1.66rem);
  font-weight: 700;
  color: var(--green-700);
}

/* Texto descriptivo en hero */
.summary {
  margin: 0.95rem 0 0;
  max-width: 57ch;
  color: var(--muted);
  font-size: clamp(0.97rem, 1.25vw, 1.1rem);
  line-height: 1.45;
}

/* Marco visual de la foto de perfil */
.hero-photo {
  position: relative;
  overflow: hidden;
  justify-self: end;
  width: min(250px, 100%);
  border-radius: 1rem;
  border: 1px solid #d6dfc7;
  background:
    radial-gradient(circle at 50% 42%, rgba(153, 191, 64, 0.24), rgba(153, 191, 64, 0) 64%),
    linear-gradient(160deg, #f5f7f0, #edf0e4 55%, #eef2e6),
    var(--surface-soft);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(43, 59, 22, 0.08);
  display: grid;
  place-items: center;
  min-height: 155px;
  padding: 0.45rem;
}

.hero-photo::before {
  content: "";
  position: absolute;
  width: 90%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(153, 191, 64, 0.22), rgba(153, 191, 64, 0) 72%);
}

/* Imagen de perfil */
.hero-photo img {
  position: relative;
  z-index: 1;
  width: min(185px, 88%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 24%;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.78),
    0 10px 22px rgba(73, 92, 29, 0.16);
  -webkit-mask-image: radial-gradient(circle at center, #000 62%, #000 74%, transparent 84%);
  mask-image: radial-gradient(circle at center, #000 62%, #000 74%, transparent 84%);
}

/* Cabeceras de seccion (alineacion horizontal) */
.section-title-wrap,
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.2rem 0.55rem;
}

/* Titulos secundarios */
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  letter-spacing: -0.01em;
}

/* -----------------------------------------------------------------------------
 * CARRUSELES
 * --------------------------------------------------------------------------- */

/* Bloque visual de cada seccion de carrusel */
.carousel-section {
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.9rem 0.8rem 0.75rem;
}

/* Estructura de carrusel: boton izq + viewport + boton der */
.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

/* Ventana visible del track */
.carousel-viewport {
  overflow: hidden;
}

/* Track horizontal desplazable */
.carousel-track {
  --per-view: 3;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(100% / var(--per-view));
  transition: transform 320ms ease;
}

/* Tarjeta oscura (carrusel superior) */
.carousel-card {
  margin: 0.25rem 0.4rem;
  border-radius: 0.95rem;
  border: 1px solid #5f7725;
  color: #f8fefb;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)),
    linear-gradient(130deg, var(--green-900) 0%, var(--green-700) 50%, #5a7224 100%);
  padding: 0.95rem 0.95rem 1rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: var(--shadow);
}

/* Variante clara (carrusel inferior) */
.carousel-card.soft {
  border-color: #d4dcc5;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 240, 0.9)),
    linear-gradient(135deg, #ffffff, #f4f7ec);
  box-shadow: 0 10px 22px rgba(49, 60, 24, 0.08);
}

/* Contenedor de icono */
.icon-wrap {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Variante de icono en superficies claras */
.carousel-card.soft .icon-wrap,
.core-card .icon-wrap {
  background: #eef4de;
  border: 1px solid #d4e0b8;
}

/* Tamano de SVG de iconos */
.icon-wrap svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* Estilo de trazo de iconos */
.icon-wrap path {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Titulos de tarjetas */
.carousel-card h3,
.core-card h3 {
  margin: 0.1rem 0 0.15rem;
  font-size: 1.1rem;
}

/* Texto de tarjetas */
.carousel-card p,
.core-card p {
  margin: 0;
  line-height: 1.35;
  font-size: 0.95rem;
}

/* Ajuste de color en tarjeta clara */
.carousel-card.soft p {
  color: var(--muted);
}

/* Botones de navegacion del carrusel */
.carousel-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid #c4d09f;
  background: #f5f8ed;
  color: #586d21;
  font-size: 1.7rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 160ms ease;
}

/* Estado deshabilitado */
.carousel-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Estado hover */
.carousel-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #eff4e1;
}

/* Contenedor de dots de paginacion */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

/* Dot inactivo */
.dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  border: 0;
  background: #c9d3b1;
}

/* Dot activo */
.dot.active {
  background: var(--green-700);
}

/* -----------------------------------------------------------------------------
 * BLOQUE CENTRAL DE TARJETAS
 * --------------------------------------------------------------------------- */

.cards-section {
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.95rem;
}

/* Grid modular de tarjetas */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

/* Tarjeta central */
.core-card {
  border-radius: 0.9rem;
  border: 1px solid #dbe3cb;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 239, 0.9)),
    #fff;
  padding: 0.95rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

/* Color de icono en tarjeta central */
.core-card .icon-wrap {
  color: var(--green-700);
}

/* Color de texto en tarjeta central */
.core-card p {
  color: var(--muted);
}

/* Fondo de seccion inferior */
.bottom-carousel {
  background: linear-gradient(180deg, #fcfdfb 0%, #f7faef 100%);
}

/* -----------------------------------------------------------------------------
 * FOOTER
 * --------------------------------------------------------------------------- */

.footer {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto 2rem;
  padding: 1rem 0.25rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Bloque izquierdo del footer (copyright + creditos) */
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

/* Texto legal/copyright */
.footer-copy {
  margin: 0;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--muted);
}

/* Credito tecnico del desarrollo */
.footer-credit {
  margin: 0;
  font-size: 0.82rem;
  color: #687258;
  letter-spacing: 0.01em;
}

/* Lista de enlaces del footer */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Enlaces footer */
.footer-links a {
  color: var(--green-900);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
}

/* Hover de enlaces footer */
.footer-links a:hover {
  border-bottom-color: var(--green-700);
}

/* -----------------------------------------------------------------------------
 * BANNER DE COOKIES
 * --------------------------------------------------------------------------- */

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(16px);
  width: min(720px, calc(100% - 1.4rem));
  border: 1px solid #cad5ad;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(5px);
  box-shadow: 0 14px 34px rgba(47, 61, 22, 0.18);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

/* Estado visible del banner */
.cookie-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Texto principal del banner */
.cookie-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

/* Agrupacion de botones */
.cookie-actions {
  display: flex;
  gap: 0.5rem;
}

/* Estilo base de botones */
.cookie-btn {
  border: 1px solid #bfcda2;
  border-radius: 0.55rem;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 150ms ease;
}

/* Boton secundario (rechazar) */
.cookie-btn.secondary {
  background: #f6f9ef;
  color: #566a23;
}

/* Boton primario (aceptar) */
.cookie-btn.primary {
  background: var(--green-700);
  color: #ffffff;
  border-color: #688428;
}

/* Hover de botones */
.cookie-btn:hover {
  transform: translateY(-1px);
}

/* -----------------------------------------------------------------------------
 * ANIMACIONES
 * --------------------------------------------------------------------------- */

/* Aparicion suave vertical */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplicacion de animacion a bloques principales */
.hero-copy,
.hero-photo,
.carousel-section,
.cards-section {
  animation: rise 420ms ease both;
}

/* -----------------------------------------------------------------------------
 * RESPONSIVE
 * --------------------------------------------------------------------------- */

/* Desktop medio */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Tablet */
@media (max-width: 840px) {
  .page,
  .footer {
    width: min(1120px, calc(100% - 1.4rem));
  }

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

  .hero-copy {
    margin-top: 0.45rem;
  }

  .hero-photo {
    justify-self: center;
    width: min(275px, 100%);
    min-height: 185px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Movil */
@media (max-width: 560px) {
  .page {
    margin-top: 0.8rem;
    margin-bottom: 1.35rem;
  }

  .hero-tech-pattern {
    height: 145px;
  }

  .hero-content {
    padding: 0.7rem 0.8rem 1rem;
  }

  .hero-copy {
    margin-top: 0.2rem;
  }

  .logo {
    width: 138px;
  }

  .hero-photo {
    width: min(235px, 100%);
    min-height: 165px;
    padding: 0.4rem;
  }

  .hero-photo img {
    width: min(170px, 90%);
  }

  .carousel-section,
  .cards-section {
    padding: 0.75rem 0.45rem 0.65rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .carousel-card,
  .core-card {
    min-height: 128px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.85rem;
  }

  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    bottom: 0.7rem;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
  }
}
