/* =========================================================
   VARIABLES
   ========================================================= */
:root {
  --verde: #2e4d38;
  --verde-suave: #486f56;
  --naranja: #e8872f;
  --naranja-suave: #f3a55d;
  --gris-claro: #f5f5f5;
  --gris-texto: #444;

  --max-width: 1200px;
  --radius: 10px;

  /* Ajustes responsive */
  --pad-x: clamp(16px, 4vw, 28px);
  --section-y: clamp(46px, 6vw, 78px);
  --header-h: 72px; /* usado para evitar saltos con header fixed */
}

/* =========================================================
   BASE + RESET
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--gris-texto);
  background: #fff;
  line-height: 1.6;
  font-size: 16px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(100% - (var(--pad-x) * 2), var(--max-width));
  margin-inline: auto;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

p {
  margin: 0 0 14px;
}

/* Evita que el anclaje quede oculto por el header fijo */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 14px);
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
  background: #fff;
  position: relative;
  z-index: 50;
  transition: box-shadow 0.25s ease, transform 0.35s ease;
}

/* Para evitar “salto” al activar fixed */
body {
  padding-top: 0;
}
.site-header.fixed + main {
  /* Cuando el header pasa a fixed, el contenido no debe subir */
  padding-top: var(--header-h);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo-mark {
  height: 38px;
  width: auto;
  flex: 0 0 auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.logo-title {
  font-weight: 700;
  color: var(--verde);
  line-height: 1.1;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-subtitle {
  font-size: 13px;
  color: #666;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-contact {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.header-call-label {
  font-size: 12px;
  color: #666;
}

.header-phone {
  color: var(--verde);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.site-header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  animation: slideDown 0.35s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: clamp(74px, 10vw, 120px) 0 clamp(46px, 7vw, 80px);
  color: #fff;
  overflow: hidden;
}

.hero-img-wrapper {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.58));
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62);
  transform: scale(1.05);
  opacity: 0;
  animation: heroFadeIn 1.2s ease forwards;
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: opacity, transform;
}

@keyframes heroFadeIn {
  to { opacity: 1; transform: scale(1); }
}

.hero-bg.fade-out {
  opacity: 0;
  transform: scale(1.03);
}

.hero-bg.fade-in {
  opacity: 1;
  transform: scale(1);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.6fr auto;
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
  max-width: none;
}

.hero-content h1 {
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  margin-bottom: 14px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.hero-lead {
  font-size: clamp(16px, 1.6vw, 18px);
  max-width: 60ch;
  margin-bottom: 14px;
  opacity: 0.95;
  max-width: none;
}

.hero-bullets {
  margin: 0 0 32px;
  padding-left: 18px;
  font-size: 16px;
}

.hero-bullets li {
  margin: 8px 0;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--naranja);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  transition: background 0.25s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* táctil */
}

.btn-primary:hover {
  background: var(--naranja-suave);
  transform: translateY(-1px);
}

.hero-cta-note {
  font-size: 14px;
  opacity: 0.92;
}

.hero-thumbs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
  margin-top: clamp(24px, 6vw, 80px);
  width: 120px;
  justify-self: end;
}

.hero-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  opacity: 0.92;
  cursor: pointer;

  border: 2px solid rgba(255, 138, 0, 0.35);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.hero-thumb:hover {
  transform: scale(1.03);
  opacity: 1;
  border-color: rgba(255, 138, 0, 0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.hero-thumb.active-thumb {
  border-color: rgba(255, 138, 0, 1);
  box-shadow: 0 0 0 2px rgba(255,138,0,0.25);
}

/* =========================================================
   SECCIONES
   ========================================================= */
.section {
  padding: var(--section-y) 0;
}

.section.light {
  background: var(--gris-claro);
}

.section h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.12;
  margin-bottom: 14px;
}

/* Dos columnas: desktop */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 4vw, 44px);
  align-items: start;
}

/* Justificado para textos largos (solo dentro del bloque principal) */
.section-inner > div > p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.65;
}

/* =========================================================
   HIGHLIGHT BOX
   ========================================================= */
.highlight-box {
  background: #fff;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.highlight-box h3 {
  margin-top: 0;
  font-size: 18px;
}

.highlight-box ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.highlight-box li {
  margin: 8px 0;
}

.box-photo {
  margin-top: 14px;
  border-radius: var(--radius);
  object-fit: cover;
  width: 100%;
  height: clamp(200px, 24vw, 280px);
}

/* =========================================================
   VENTAJAS AGRONÓMICAS
   ========================================================= */
.advantages-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
}

.adv-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  border-left: 5px solid var(--naranja);
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.adv-card h3 {
  font-size: 1.18rem;
  margin-bottom: 10px;
}

.adv-card p {
  margin-bottom: 0;
}

/* =========================================================
   GALERÍA
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-item img {
  width: 100%;
  height: clamp(150px, 20vw, 260px);
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
}

.gallery-item img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

/* =========================================================
   CTA FINAL
   ========================================================= */
.cta-final {
  background: var(--verde-suave);
  color: #fff;
  padding: clamp(44px, 6vw, 64px) 0;
}

.cta-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(16px, 4vw, 40px);
  align-items: center;
}

.cta-final h2 {
  margin-bottom: 10px;
}

.cta-contact-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.cta-contact-label {
  font-size: 12px;
  opacity: 0.92;
}

.cta-phone {
  color: #fff;
  font-size: clamp(22px, 2.8vw, 28px);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.05;
}

.cta-small {
  font-size: 12px;
  opacity: 0.9;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 22px;
  background: #eee;
  font-size: 14px;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* <= 980px: reduce columnas y tamaños, mejora confort */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-thumbs {
    width: 100%;  
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
  }

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

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

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

  .cta-inner {
    grid-template-columns: 1fr;
  }

  .cta-contact-block {
    align-items: flex-start;
    text-align: left;
  }
}

/* <= 640px: optimización WhatsApp/mobile */
@media (max-width: 640px) {
  :root {
    --header-h: 86px; /* en móvil el header suele “crecer” */
  }

  /* Header: apila de forma limpia */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-contact {
    width: 100%;
    text-align: left;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .logo-title {
    font-size: 17px;
  }
  .logo-subtitle {
    font-size: 12px;
  }

  /* Hero: thumbs en “tira” cómoda */
  .hero-thumbs {
    margin-top: 14px;        /* antes era mayor */
    gap: 8px;
  }

  .hero-thumb {
    flex: 0 0 90px;          /* más pequeños */
    height: auto;            /* control directo */
    aspect-ratio: auto;      /* evitamos que “crezcan” */
    scroll-snap-align: start;
    opacity: 0.85;
  }

  /* Justificado en móvil suele verse peor */
  .section-inner > div > p {
    text-align: justify;
    text-justify: inter-word;
  }

  /* Galería: 2 columnas y alturas más contenidas */
  .gallery-item img {
    height: 170px;
  }

  /* CTA: botón y nota mejor alineados */
  .hero-cta {
    gap: 10px;
  }
}

/* Preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}