/* =========================================================
   VARIABLES GLOBALES Y CONFIGURACIÓN BASE
========================================================= */
:root {
  --primary: #014e2e;        
  --primary-dark: #14532d;   
  --accent: #22c55e;         
  --success: #15803d;
  --bg: #fcfcfc;             
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1f2937;           
  --muted: #6b7280;          
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(22, 101, 52, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
  padding: 4rem 0;
}

.d-none { display: none !important; }

/* =========================================================
   HEADER / TOPBAR RESPONSIVO
========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  border-bottom: 1px solid var(--border);
}

.logo-wrap {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.nav { 
  display: flex; 
  gap: 1.5rem; 
}

.nav a {
  text-decoration: none;
  color: #374151;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: .25s ease;
}

.nav a:hover, .nav a.active {
  color: var(--primary);
  background: rgba(22, 101, 52, 0.08);
}

/* Menú Hamburguesa Móvil */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span { 
  width: 22px; 
  height: 3px; 
  background: var(--primary); 
  border-radius: 2px; 
}

/* =========================================================
   HERO SECCIÓN HOME
========================================================= */
.hero-home {
  background: linear-gradient(rgba(94, 119, 35, 0.2), rgba(29, 100, 30, 0.4)), url("../assets/images/hero.png");
  background-size: cover;
  background-position: center;
  min-height: 35vh;
  display: flex;
  align-items: center;
  color: white;
  position: relative;
}

.hero-overlay {
  width: 100%;
  padding: 4rem 5%;
}

.hero-content {
  max-width: 750px;
}

.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.pillar-icon {
  width: 64px;
  height: 64px;
  background-color: #e8f5e9; /* Un verde orgánico sumamente claro y sutil */
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  color: #1b5e20; /* Verde oscuro profesional */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px; /* Espacio para que el icono respire dentro del círculo */
  box-sizing: border-box;
}

/* Buscador Flotante */
.search-box-container {
  background: var(--surface);
  padding: 0.45rem;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  max-width: 600px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-icon {
  color: var(--muted);
  padding-left: 1rem;
}

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover { background: var(--primary-dark); }

/* =========================================================
   GRILLA DE PILARES Y RECURSOS
========================================================= */
.pillar-grid, .innovations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s;
}

.pillar-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

/* .pillar-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
} */

.pillar-card h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.pillar-card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* =========================================================
   FOOTER INSTITUCIONAL OSCURO
========================================================= */
.main-footer {
  background: var(--primary);
  color: #94a3b8;
  padding: 4rem 5% 2rem;
  font-size: 0.9rem;
  border-top: 4px solid var(--primary);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand h3, .footer-links h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.6rem;
}

.footer-links ul li a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links ul li a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

/* =========================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
========================================================= */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    flex-direction: column;
    padding: 1.5rem 5%;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
  }
  
  .nav.open { display: flex; }
  
  .hero-content h1 { font-size: 2.2rem; }
}

/* =========================================================
   COMPONENTE: KPIs Y ESTADÍSTICAS DINÁMICAS (ESTILO AGROIDEAS)
========================================================= */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  width: 100%;
  max-width: 1100px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: white;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  
  /* Estado inicial para la animación de entrada */
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  /* El delay se inyecta dinámicamente desde JS por cada tarjeta */
  animation-delay: var(--card-delay, 0s);
  
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 40px 0 rgba(22, 101, 52, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.metric-icon-wrap {
  width: 50px;
  height: 50px;
  background: rgba(34, 197, 94, 0.25); /* Tinte verde accent */
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, #bbf7d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.25rem;
}

/* Keyframes de animación fluida */
@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}