/* ==========================================================================
   AGROEMERGE V3 — SECTION STYLES
   Estilos para las secciones híbridas V2/V3:
   Hero Cinematográfico · Resultados · Galería Masonry · Modal · Video Testimonio
   ========================================================================== */


/* ============================================================
   HEADER & NAVBAR OPTIMIZATION — ESPACIADO Y VISUALIZACIÓN
   Evita que el logo, título, links y botones se vean amontonados
============================================================ */
.header {
  height: 74px;
  background: rgba(13, 27, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header.scrolled {
  height: 66px;
  background: rgba(13, 27, 42, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(124, 179, 66, 0.25);
}

.nav-container {
  max-width: 1360px;
  width: 100%;
  padding-left: clamp(16px, 2.5vw, 32px);
  padding-right: clamp(16px, 2.5vw, 32px);
  gap: 16px;
}

.brand-logo-link {
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 40px;
  width: auto;
}

.brand-title {
  font-size: 1.18rem;
  letter-spacing: 0.03em;
}

.brand-tagline {
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: #94A3B8;
}

/* Menú de navegación con espaciado balanceado */
.nav-menu {
  gap: clamp(10px, 1.3vw, 22px);
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Botones de acción directos a la derecha */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-actions .btn {
  padding: 8px 16px;
  font-size: 0.82rem;
  white-space: nowrap;
  border-radius: 999px;
}

.nav-actions .btn-whatsapp {
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

/* ============================================================
   HERO V2 — CINEMATIC FULLSCREEN
============================================================ */
.hero-v2 {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: #0D1B2A;
  padding-top: 74px;
}

.hero-v2-bg {
  position: absolute;
  inset: 0;
  background: url('../images/v3/hero-agroemerge-precision.png') center center / cover no-repeat;
  opacity: 0.62;
}

.hero-v2-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(13,27,42,0.26) 0%,
    rgba(13,27,42,0.62) 55%,
    rgba(13,27,42,0.96) 100%);
}

.hero-v2-grid-line {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-v2-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
  padding: 60px 24px 70px;
}

/* Eyebrow badge */
.hero-v2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(124,179,66,0.45);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 6px 18px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #7CB342;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-v2-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7CB342;
  box-shadow: 0 0 10px #7CB342;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1;    }
  50%       { transform: scale(1.4); opacity: 0.65; }
}

/* Title */
.hero-v2-title {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.1rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-v2-title .accent { color: #7CB342; }

/* Subtitle */
.hero-v2-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  color: #94A3B8;
  line-height: 1.7;
  margin-bottom: 36px;
}

/* CTA buttons */
.hero-v2-ctas {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

/* Botón hero verde (pill) */
.btn-hero-green {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2E7D32;
  color: #fff;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.22s, transform 0.22s, box-shadow 0.22s;
  box-shadow: 0 4px 18px rgba(46,125,50,0.4);
}

.btn-hero-green:hover {
  background: #1B5E20;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46,125,50,0.5);
}

/* Botón hero ghost (pill) */
.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  text-decoration: none;
  transition: background 0.22s;
}

.btn-hero-ghost:hover { background: rgba(255,255,255,0.16); }

/* KPI Bar */
.hero-v2-kpi-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(13,27,42,0.78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 20px;
  padding: 28px 16px;
  gap: 8px;
}

.v2-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.v2-kpi-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 10%;
  height: 80%;
  width: 1px;
  background: rgba(255,255,255,0.1);
}

.v2-kpi-val {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  font-weight: 900;
  color: #7CB342;
  line-height: 1;
  margin-bottom: 6px;
}

.v2-kpi-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  color: #94A3B8;
  line-height: 1.3;
}


/* ============================================================
   RESULTADOS V2 — PROBLEMA vs RESULTADO
============================================================ */
.section-results-v2 {
  padding: 100px 0;
  background: #ffffff;
}

.results-v2-intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 72px;
  padding: 0 24px;
}

.results-v2-intro .v2-tag {
  display: inline-block;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2E7D32;
  background: rgba(46,125,50,0.1);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.results-v2-intro h2 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
  color: #0D1B2A;
  line-height: 1.2;
  margin-bottom: 12px;
}

.results-v2-intro h2 span { color: #2E7D32; }

.results-v2-intro p {
  font-family: 'Montserrat', sans-serif;
  color: #64748B;
  font-size: 1rem;
}

/* Compare rows */
.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto 56px;
  padding: 0 24px;
  align-items: stretch;
}

.cmp-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 36px rgba(0,0,0,0.1);
}

.cmp-img-wrap {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.cmp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.cmp-card:hover .cmp-img-wrap img { transform: scale(1.05); }

.cmp-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
}

.pill-problem { background: rgba(220,38,38,0.88);  color: #fff; }
.pill-result  { background: rgba(46,125,50,0.95);  color: #fff; }

.cmp-bottom {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cmp-card.problem .cmp-bottom { background: #0D1B2A; }
.cmp-card.result  .cmp-bottom { background: #0F3025; }

.cmp-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cmp-card.problem .cmp-ico { background: rgba(220,38,38,0.18); }
.cmp-card.result  .cmp-ico { background: rgba(124,179,66,0.18); }

.cmp-txt h4 {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.cmp-txt p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
}

.cmp-card.problem .cmp-txt p { color: #94A3B8; }
.cmp-card.result  .cmp-txt p { color: #86EFAC; }


/* ============================================================
   GALERÍA MASONRY V2
============================================================ */
.section-gallery-v2 {
  background: #0D1B2A;
  padding-top: 90px;
}

.gallery-v2-intro {
  text-align: center;
  padding: 0 24px;
  margin-bottom: 56px;
}

.gallery-v2-intro h2 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.gallery-v2-intro h2 span { color: #7CB342; }

.gallery-v2-intro p {
  font-family: 'Montserrat', sans-serif;
  color: #64748B;
  font-size: 0.95rem;
}

/* Grid masonry */
.gallery-v2-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 260px);
}

.g-item {
  position: relative;
  overflow: hidden;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: #0D1B2A;
}

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.g-item:hover img { transform: scale(1.06); }
.g-item.tall { grid-row: span 2; }
.g-item.wide { grid-column: span 2; }

.g-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,0.88) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  transition: opacity 0.3s;
}

.g-tag {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7CB342;
  margin-bottom: 4px;
}

.g-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.g-stat {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  color: #86EFAC;
  font-weight: 600;
  margin-top: 3px;
}

.g-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin-top: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  background: rgba(13,27,42,0.52);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.g-item:focus-visible {
  outline: 3px solid #7CB342;
  outline-offset: -3px;
  z-index: 2;
}


/* ============================================================
   GALERÍA MODAL — LIGHTBOX TEMÁTICO
============================================================ */
.gallery-modal[hidden] { display: none; }

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5,15,25,0.94);
  backdrop-filter: blur(12px);
}

.gallery-modal-dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: 94vh;
  overflow: auto;
  border: 1px solid rgba(124,179,66,0.35);
  border-radius: 20px;
  background: #102238;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
}

.gallery-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 64px 18px 24px;
}

.gallery-modal-kicker {
  display: block;
  margin-bottom: 4px;
  color: #7CB342;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-modal-title {
  margin: 0;
  color: #fff;
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.2;
}

.gallery-modal-count {
  flex: 0 0 auto;
  margin-top: 7px;
  color: #CBD5E1;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
}

.gallery-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  background: rgba(13,27,42,0.8);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-modal-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(62vh, 680px);
  margin: 0 24px;
  overflow: hidden;
  border-radius: 14px;
  background: #07111C;
  touch-action: pan-y;
}

.gallery-modal-image {
  display: block;
  width: 100%;
  height: min(62vh, 680px);
  object-fit: contain;
}

.gallery-modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  background: rgba(13,27,42,0.76);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}

.gallery-modal-prev { left: 16px; }
.gallery-modal-next { right: 16px; }

.gallery-modal-close:hover,
.gallery-modal-nav:hover { background: #2E7D32; }

.gallery-modal-close:focus-visible,
.gallery-modal-nav:focus-visible,
.gallery-thumb:focus-visible {
  outline: 3px solid #9CCC65;
  outline-offset: 2px;
}

.gallery-modal-caption {
  min-height: 24px;
  margin: 14px 24px 10px;
  color: #E2E8F0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  text-align: center;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  padding: 8px 24px 24px;
  overflow-x: auto;
  scrollbar-color: #7CB342 #1E344D;
}

.gallery-thumb {
  flex: 0 0 92px;
  height: 68px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  padding: 0;
  background: #07111C;
  opacity: 0.58;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}

.gallery-thumb.active {
  border-color: #7CB342;
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.gallery-open { overflow: hidden; }


/* ============================================================
   CASO DE ÉXITO EN VIDEO — JULIO SANTILLÁN
============================================================ */
.testimonial-card-video {
  padding: 0;
  overflow: hidden;
}

.case-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0D1B2A;
}

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

.case-video-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(46,125,50,0.92);
  color: #fff;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.case-video-copy {
  padding: 22px 24px 18px;
}

.case-video-title {
  margin: 0;
  color: #17324D;
  font-family: 'Exo 2', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
}

.testimonial-card-video .testimonial-author {
  margin: 0 24px 24px;
}


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1180px) {
  .nav-menu, .nav-actions { display: none; }
  .mobile-toggle { display: block; }
  
  .mobile-menu-active .nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 74px;
    left: 0;
    width: 100%;
    background: #0D1B2A;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    gap: 16px;
    z-index: 1001;
  }

  .mobile-menu-active .nav-actions {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(74px + 360px);
    left: 0;
    width: 100%;
    padding: 0 24px 24px;
    background: #0D1B2A;
    gap: 12px;
    z-index: 1001;
  }

  .mobile-menu-active .nav-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
}

@media (max-width: 1024px) {
  .hero-v2-kpi-bar { grid-template-columns: repeat(3, 1fr); }
  .v2-kpi-item:not(:last-child)::after { display: none; }
  .compare-row { grid-template-columns: 1fr; max-width: 640px; }
  .gallery-v2-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 240px;
  }
  .g-item.tall { grid-row: span 1; }
}

@media (max-width: 768px) {
  .hero-v2-kpi-bar { grid-template-columns: repeat(2, 1fr); }
  .gallery-v2-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .g-item.wide { grid-column: span 1; }
  .g-item { height: 220px; }
  .gallery-modal { padding: 0; }
  .gallery-modal-dialog {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
  .gallery-modal-header { padding: 18px 56px 14px 16px; }
  .gallery-modal-stage {
    min-height: 52vh;
    margin: 0;
    border-radius: 0;
  }
  .gallery-modal-image { height: 52vh; }
  .gallery-modal-nav { width: 44px; height: 44px; }
  .gallery-modal-prev { left: 10px; }
  .gallery-modal-next { right: 10px; }
  .gallery-modal-caption { margin-inline: 16px; }
  .gallery-thumbs { padding-inline: 16px; }
}


/* ============================================================
   ACCESIBILIDAD — MOVIMIENTO REDUCIDO
   Respeta la preferencia del sistema operativo del usuario
============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-v2-eyebrow .dot,
  .badge-dot {
    animation: none;
  }

  .g-item img,
  .cmp-img-wrap img {
    transition: none;
  }

  .hero-v2-bg {
    /* Sin transformaciones de fondo animadas */
  }
}
