/* ============================================================
   BioEnergías Agropecuarias — hoja de estilos estática
   Reconstrucción fiel del diseño original (WordPress + Elementor,
   tema Hello Elementor). Sin frameworks. Colores tomados del kit
   de Elementor del sitio original.
   ============================================================ */

/* ---------- Tipografías autohospedadas (variables, latin) ---------- */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/roboto-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/rubik-var-latin.woff2') format('woff2');
}

/* ---------- Variables de diseño (kit Elementor original) ---------- */
:root {
  --c-primary: #6EC1E4;    /* celeste: títulos por defecto, menú, "Contacto" */
  --c-secondary: #54595F;  /* gris oscuro: fondos de tarjetas y contacto */
  --c-text: #7A7A7A;       /* gris de textos */
  --c-accent: #61CE70;     /* verde: hover del menú, "Nuestra Historia", botón */
  --c-body: #333;          /* color de texto base del tema Hello */
  --c-link: #c36;          /* color de links por defecto del tema Hello (footer) */
  --sombra: 0 0 10px 0 rgba(0, 0, 0, 0.5);
  --fuente-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* ---------- Reset básico ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--fuente-base);
  background-color: #fff;
  color: var(--c-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; background: none; border: none; cursor: pointer; }

.hidden { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
  max-width: 1140px;
  margin-inline: auto;
  width: 100%;
}
@media (max-width: 1180px) {
  .container { padding-inline: 20px; }
}

/* Videos de fondo (hero y productos) */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   HEADER (plantilla Elementor 521 del original)
   ============================================================ */
.site-header {
  position: relative;
  background-color: #FEFEFE;
  box-shadow: var(--sombra);
  z-index: 100;
}
.header-inner {
  max-width: 1140px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
}
.header-logo img {
  height: 65px;
  width: auto;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  align-items: center;
}
.main-nav a {
  display: block;
  position: relative;
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--c-primary);
  padding: 13px 5px;
  margin-inline: 10px;
}
/* hover: subrayado verde con fade (e--pointer-underline del original) */
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 2px;
  background-color: var(--c-accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.main-nav a:hover { color: var(--c-accent); }
.main-nav a:hover::after { opacity: 1; }

/* Botón hamburguesa (verde, como el toggle del original) */
.menu-toggle {
  display: none;
  color: var(--c-accent);
  padding: 0.25rem;
  line-height: 0;
}

/* Menú mobile: dropdown blanco pegado al header, sin huecos */
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 99;
}
.mobile-menu ul { padding: 4px 0 8px; }
.mobile-menu li + li a { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.mobile-menu a {
  display: block;
  padding: 15px 24px;
  font-family: 'Rubik', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: #3c3f42;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mobile-menu a:hover, .mobile-menu a:active {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  background: rgba(97, 206, 112, 0.08);
}
@media (prefers-reduced-motion: no-preference) {
  .mobile-menu:not(.hidden) { animation: menu-in 0.22s ease; }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1024px) {
  .header-inner { padding: 17px; }
  .main-nav { display: none; }
  .menu-toggle { display: block; }
}
@media (max-width: 767px) {
  .header-inner { padding: 15px; }
}

/* ============================================================
   HERO (#Hero)
   ============================================================ */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px;
  overflow: hidden;
  /* fallback si el video no carga (bkg-principal-1.jpg del original) */
  background: url('../img/hero-fondo.jpg') 50% 50% / cover no-repeat;
  background-image: image-set(
    url('../img/hero-fondo.webp') type('image/webp'),
    url('../img/hero-fondo.jpg') type('image/jpeg')
  );
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--c-primary);
  opacity: 0.2;
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-line1 {
  color: #EFEFEF;
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 20px;
}
.hero-line2 {
  color: #EFEFEF;
  font-family: 'Rubik', sans-serif;
  font-size: 51px;
  font-weight: 500;
  line-height: 1.2;
}
@media (max-width: 1024px) {
  .hero { padding: 20px; }
}
@media (max-width: 767px) {
  .hero { min-height: 58vh; padding: 15px; }
  .hero-line1 { margin-bottom: 5px; }
  .hero-line2 { font-size: 24px; }
}

/* ============================================================
   NUESTRA HISTORIA (#Historia)
   ============================================================ */
.historia { padding: 4em 0; }

.historia-row {
  display: flex;
  flex-direction: row-reverse; /* video a la derecha, texto a la izquierda */
  align-items: center;
  gap: 20px;
}
.historia-video {
  width: 50%;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
}
.historia-video video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.historia-text { flex: 1; min-width: 0; }
.historia-text h2 {
  color: var(--c-accent);
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: capitalize;
  text-align: left;
  margin: 0 0 20px 20px;
}

/* Carrusel de historia (reemplazo vanilla del Swiper original) */
.historia-slider { width: 100%; }
.historia-slides {
  position: relative;
  overflow: hidden;
  display: flex;
}
.historia-slide {
  flex: 0 0 100%;
  min-width: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  margin-right: -100%;
}
.historia-slide.active { opacity: 1; position: relative; z-index: 1; }
.historia-slide p {
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--c-text);
  padding: 20px;
}
.historia-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.historia-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--c-primary);
  transition: background-color 0.3s;
}
.historia-dots button.active { background-color: var(--c-accent); }

@media (max-width: 1024px) {
  .historia-row { flex-direction: column; }
  .historia-video { width: 100%; }
  .historia-text { width: 100%; }
  .historia-text h2 { text-align: center; font-size: 25px; margin-left: 0; }
}
@media (max-width: 767px) {
  .historia-row { flex-direction: column-reverse; }
  .historia-text h2 { font-size: 22px; }
}

/* ============================================================
   NUESTROS PRODUCTOS (#Productos)
   ============================================================ */
.productos {
  position: relative;
  padding: 4rem 0;
  overflow: hidden;
  /* fallback del video de fondo (Group-271.jpg del original) */
  background: var(--c-secondary) url('../img/fondo-productos.jpg') 50% 50% / cover no-repeat;
  background-image: image-set(
    url('../img/fondo-productos.webp') type('image/webp'),
    url('../img/fondo-productos.jpg') type('image/jpeg')
  );
}
.productos-inner { position: relative; z-index: 1; }

.productos-titulo {
  color: var(--c-secondary);
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 30px; /* 10px del contenedor + 20px de espaciado de widgets */
}

.prod-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.prod-row + .prod-row { margin-top: 20px; }

.prod-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: var(--c-secondary);
  border-radius: 5px;
  box-shadow: var(--sombra);
  padding: 20px;
}
.prod-card img { width: 48px; height: 48px; margin-bottom: 20px; }
.prod-card h3 {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  color: var(--c-primary); /* color de título por defecto del kit */
}
.prod-row-2 .prod-card { min-height: 190px; }
@media (min-width: 768px) {
  .prod-row-2 .prod-card-ancha { flex: 0 0 52.768%; }
}

@media (max-width: 1024px) {
  .productos { padding: 50px 0; }
  .productos-titulo { font-size: 25px; }
}
@media (max-width: 767px) {
  .productos-titulo { font-size: 22px; }
  /* en móvil las tarjetas se apilan a lo ancho, como el original */
  .prod-row { flex-direction: column; align-items: stretch; }
  .prod-row .prod-card { flex: 1 1 auto; width: 100%; min-height: 0; }
}

/* ============================================================
   NUESTRA PLANTA (#Planta)
   ============================================================ */
.planta {
  background-color: #FFFFFF;
  padding: 4rem 0;
}
.planta-titulo {
  color: var(--c-text);
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 15px;
}
.planta-sub {
  color: var(--c-text);
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
  text-align: center;
  max-width: 65%;
  margin: 0 auto 30px; /* 10px del contenedor + 20px de widgets */
}
.planta-fotos {
  display: flex;
  align-items: center;
  gap: 20px;
}
.planta-fotos .foto-1 { flex: 0 0 42.054%; }
.planta-fotos .foto-2 { flex: 1; min-width: 0; }
.planta-fotos img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.19);
}
@media (max-width: 1024px) {
  .planta { padding: 50px 0; }
  .planta-titulo { font-size: 25px; margin-bottom: 0; }
  .planta-sub { font-size: 16px; line-height: 1.5em; }
}
@media (max-width: 767px) {
  .planta-titulo { font-size: 22px; }
  .planta-sub { font-size: 14px; max-width: 100%; }
  .planta-fotos { flex-direction: column; justify-content: center; }
  .planta-fotos .foto-1 { flex: 0 0 auto; width: 100%; }
  .planta-fotos img { border-radius: 5px; }
}

/* ============================================================
   MAPA (iframe de Google Maps, en blanco y negro como el original)
   ============================================================ */
.mapa iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  filter: brightness(100%) contrast(100%) saturate(0%) blur(0px) hue-rotate(0deg);
}
@media (max-width: 1024px) {
  .mapa iframe { height: 295px; }
}
@media (max-width: 767px) {
  .mapa iframe { height: 280px; }
}

/* ============================================================
   SUSTENTABILIDAD
   ============================================================ */
.sustentabilidad {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: url('../img/fondo-sustentabilidad.jpg') center center / cover no-repeat;
  background-image: image-set(
    url('../img/fondo-sustentabilidad.webp') type('image/webp'),
    url('../img/fondo-sustentabilidad.jpg') type('image/jpeg')
  );
  padding: 20px 0;
}
.sust-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  background-color: var(--c-accent);
  border-radius: 10px;
  box-shadow: var(--sombra);
  padding: 30px;
}
.sust-icon { width: 124px; height: 124px; flex-shrink: 0; }
.sust-text { flex: 1 1 60%; min-width: 260px; }
.sust-text h2 {
  color: #54595F;
  font-family: 'Rubik', sans-serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 20px;
}
.sust-text p {
  color: var(--c-secondary);
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 400;
}
.sust-text p + p { margin-top: 0; }
@media (max-width: 1024px) {
  .sust-text h2 { font-size: 18px; }
  .sust-text p { font-size: 14px; }
}
@media (max-width: 767px) {
  .sust-card { padding: 10px; }
  .sust-icon { width: 65%; height: auto; max-width: 124px; }
  .sust-text h2 { text-align: center; line-height: 1.2em; }
  .sust-text p { text-align: center; }
}

/* ============================================================
   BOTÓN VOLVER ARRIBA (fijo, solo desktop, como el original)
   ============================================================ */
.volver-arriba {
  position: fixed;
  right: 20px;
  bottom: 150px;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #2C2C2C;
  box-shadow: var(--sombra);
}
.volver-arriba svg { fill: var(--c-secondary); display: block; }
@media (max-width: 1024px) {
  .volver-arriba { display: none; }
}

/* ============================================================
   CONTACTO (#Contacto)
   ============================================================ */
.contacto {
  min-height: 532px;
  background-color: var(--c-secondary);
  display: flex;
}
.contacto-inner {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  padding: 60px;
  position: relative;
  z-index: 2;
}
.contacto-info { width: 37.09%; }
.contacto-info h2 {
  color: var(--c-primary);
  font-family: 'Rubik', sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 20px;
}
.info-card {
  display: flex;
  flex-direction: column;
  gap: 40px;
  background-color: #292929;
  border-radius: 20px;
  padding: 30px;
}
.icon-box {
  display: flex;
  align-items: flex-start;
}
.icon-box-icon {
  flex-shrink: 0;
  color: #FFFFFF;
  fill: #FFFFFF;
  margin-right: 15px;
}
.icon-box h3 {
  color: #FFFFFF;
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0;
}
.icon-box p {
  /* color "secondary" del kit sobre tarjeta oscura: así está en el original */
  color: var(--c-secondary);
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 400;
}

.contacto-form { width: 32%; }
.contact-form .form-control {
  display: block;
  width: 100%;
  background: #fff;
  color: var(--c-body);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  border: none;
  border-radius: 0;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.contact-form .form-control:focus {
  box-shadow: none !important;
  border: none;
  outline: none;
}
.contact-form textarea { resize: vertical; }
.btn-enviar {
  display: block;
  width: 100%;
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px;
  font-size: 1rem !important;
  margin: 0 auto;
  transition: opacity 0.2s;
}
.btn-enviar:hover { background: var(--c-accent); opacity: 0.9; }
.btn-enviar:disabled { opacity: 0.6; cursor: default; }
.contact-form .turnstile-field { min-height: 65px; margin-bottom: 1rem; }

/* Honeypot anti-spam */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Mensajes de estado del formulario */
.form-status {
  display: none;
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.form-status.ok { display: block; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-status.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

@media (max-width: 1024px) {
  .contacto { min-height: 606px; }
  .contacto-inner { flex-direction: column; padding: 50px; }
  .contacto-info { width: 100%; max-width: 500px; }
  .contacto-form { width: 100%; max-width: 500px; }
}
@media (max-width: 767px) {
  .contacto-inner { min-height: 275px; gap: 20px; padding: 20px; }
  .contacto-info h2 { font-size: 28px; text-align: center; margin-bottom: 10px; }
  .info-card { gap: 30px; }
  .icon-box h3 { font-size: 18px; }
  .icon-box p { font-size: 12px; }
  .icon-box:last-child { flex-direction: column; align-items: center; text-align: center; }
  .icon-box:last-child .icon-box-icon { margin-right: 0; margin-bottom: 15px; }
}

/* ============================================================
   FOOTER (footer del tema Hello Elementor)
   ============================================================ */
.site-footer {
  background-color: #fff;
  padding-block: 1rem;
  position: relative;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-inline: 20px;
}
.footer-logo img { display: block; }
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  display: block;
  padding: 5px 15px;
  color: var(--c-link); /* color de link por defecto del tema Hello */
  text-decoration: underline;
}
.footer-copy { margin: 0; }
@media (max-width: 576px) {
  .footer-logo, .footer-nav, .footer-copy { width: 100%; text-align: center; }
  .footer-logo img { margin-inline: auto; }
  .footer-copy { margin-top: 0.5rem; }
}

/* ============================================================
   Animaciones de entrada (fadeIn de Elementor → IntersectionObserver)
   ============================================================ */
[data-aos] {
  opacity: 0;
  transition: opacity 1s ease;
}
[data-aos].aos-animate { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-aos] { opacity: 1; transition: none; }
  .historia-slide { transition: none; }
}
