/* Tokens y paleta Gobierno Digital 2.0 */
:root {
  --color-primary: #003366;
  --color-primary-dark: #0b2646;
  --color-accent: #28a745;
  --color-accent-dark: #218838;
  --color-bg: #f8f9fa;
  --color-text: #1f2937;
  --color-text-muted: #4b5563;
  --color-border: #e2e8f0;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-md: 16px;
  /* NUEVOS TOKENS DE ESPACIADO */
  --space-24: 24px;
  --space-32: 32px;
}

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

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

/* Accesibilidad: enlace para saltar contenido */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.skip-link:focus-visible {
  left: 16px;
  top: 16px;
  background: #fff;
  color: var(--color-primary);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

/* Topbar / navegación */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}
.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Marca con logo a la izquierda */
.nav-brand { display: inline-flex; align-items: center; gap: 10px; }
.nav-brand .logo-img { height: 28px; width: auto; object-fit: contain; display: block; }
.logo-text {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.nav-toggle {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 22px;
  display: none;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 20px;
}
.nav-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
.nav-link:hover, .nav-link:focus-visible {
  text-decoration: underline;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  padding: 64px 20px;
  width: 100%;
}
.hero-content { max-width: 1100px; 
    margin-left: auto; 
    margin-right: auto; 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
}
/* Logo en el hero */
.hero-logo {
  width: 220px;
  max-width: 60vw;
  height: auto;
  margin-bottom: 14px;
  image-rendering: auto;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.hero p {
  font-size: 16px;
  opacity: 0.95;
  margin-bottom: 20px;
}

/* Botones */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary:hover { transform: scale(1.03); background: var(--color-accent-dark); box-shadow: var(--shadow-sm);} 
.btn-primary:focus-visible { outline: 3px solid rgba(40,167,69,0.35); outline-offset: 2px; }

/* Layout principal */
.container {
  max-width: 1200px;
  width: 100%;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  margin: 24px auto 40px auto;
  padding-inline: 16px; /* balancea izquierda/derecha */
}
.content { 
  padding: 40px 24px; 
  margin-inline: auto; /* centra el contenido dentro del contenedor */
}
.intro-text { text-align: center; margin-bottom: 32px; }
.intro-text h2 { font-size: 24px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.intro-text p { font-size: 15px; color: var(--color-text-muted); }

/* Tarjetas de servicio */
.buttons-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.service-card {
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  background: #fff;
}
.service-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin-bottom: 6px;
}
.service-card h3 { font-size: 18px; font-weight: 700; color: var(--color-text); }
.service-card p { font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }
.service-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--color-primary); }
.service-card:hover .service-cta { color: var(--color-primary-dark); }
.service-btn {
  padding: 10px 24px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.service-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-sm); background: var(--color-accent-dark); }

/* Spotlight Control de Plagas */
.spotlight {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 32px 24px;
  margin-top: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f9fbff;
}
.spotlight h2 { font-size: 22px; font-weight: 700; color: var(--color-text); margin-bottom: 8px; }
.spotlight p { font-size: 15px; color: var(--color-text-muted); margin-bottom: 16px; }
.spotlight .spotlight-media img {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Lista de requisitos */
.check-list {
  list-style: none;
  margin-top: 12px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--color-text);
}
.check-list li::before {
  content: "\2713";
  color: var(--color-accent);
  font-weight: 700;
}

/* Caja informativa */
.info-box {
  background: #edf2f7;
  border-left: 4px solid var(--color-primary);
  padding: 16px 20px;
  border-radius: 8px;
  margin-top: 24px;
  text-align: left;
}
.info-box p { font-size: 14px; color: #4a5568; }
.info-box i { color: var(--color-primary); margin-right: 8px; }

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: #ffffff;
  padding: 32px 20px 24px;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer-col h4 { font-weight: 700; margin-bottom: 12px; }
/* Centrar y posicionar la primera columna del footer (título y descripción) */
.footer-col:first-child { 
  text-align: center; 
  grid-column: 1 / -1; /* ocupa todo el ancho del grid */
  justify-self: center; /* centra el bloque dentro del grid */
  max-width: 620px; /* limita el ancho para mejor lectura */
}

.footer-list { list-style: none; }
.footer-list li { margin-bottom: 8px; color: #e5e7eb; }
.footer-list a { color: #ffffff; text-decoration: none; }
.footer-list a:hover, .footer-list a:focus-visible { text-decoration: underline; }
.badge { display: inline-block; background: #163b66; color: #fff; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-bottom { max-width: 1200px; margin: 16px auto 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.2); text-align: center; color: #cbd5e1; }

/* Estados de foco visibles */
 a:focus-visible, button:focus-visible { outline: 3px solid rgba(0,51,102,0.3); outline-offset: 2px; }

/* Loader de navegación */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(160%) blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10000;
}
.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text { color: var(--color-primary); font-weight: 600; }
.page-loader.reduce-motion .loader-spinner { animation: none; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsivo */
@media (max-width: 992px) {
  .buttons-container { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  /* Evitar desbordes horizontales en móviles */
  html, body { overflow-x: hidden; }
  .nav { padding: 12px 12px; }
  .nav-menu { 
    display: none; 
    position: fixed; 
    left: 12px; 
    right: 12px; 
    top: 56px; 
    background: #fff; 
    border: 1px solid var(--color-border); 
    border-radius: 12px; 
    padding: 12px; 
    box-shadow: var(--shadow-sm); 
    z-index: 1000; 
    max-width: calc(100vw - 24px);
  }
  .nav-menu.open { display: block; }
  .nav-menu li { margin: 8px 0; }

  /* El contenedor se ajusta de forma simétrica */
  .container { 
    border-radius: 16px; 
    margin: 16px auto 24px; 
    padding-inline: 12px; 
    width: 100%;
  }
  .content { max-width: 1100px; padding: var(--space-32) var(--space-24); margin-left: auto; margin-right: auto; }
  .buttons-container { grid-template-columns: 1fr; gap: 16px; }
  .spotlight { grid-template-columns: 1fr; }
  .hero { padding: 48px 16px; }
  .hero h1 { font-size: 26px; }
  .hero-logo { width: 180px; margin-bottom: 12px; }
}

/* Botón para enlace de Inicio en la barra de navegación */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 999px; /* estilo pill */
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nav-btn:focus-visible { outline: 3px solid rgba(0,51,102,0.35); outline-offset: 2px; }
.page-loader.reduce-motion .loader-spinner { animation: none; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsivo */
@media (max-width: 992px) {
  .buttons-container { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  /* Evitar desbordes horizontales en móviles */
  html, body { overflow-x: hidden; }
  .nav { padding: 12px 12px; }
  .nav-menu { 
    display: none; 
    position: fixed; 
    left: 12px; 
    right: 12px; 
    top: 56px; 
    background: #fff; 
    border: 1px solid var(--color-border); 
    border-radius: 12px; 
    padding: 12px; 
    box-shadow: var(--shadow-sm); 
    z-index: 1000; 
    max-width: calc(100vw - 24px);
  }
  .nav-menu.open { display: block; }
  .nav-menu li { margin: 8px 0; }

  /* El contenedor se ajusta de forma simétrica */
  .container { 
    border-radius: 16px; 
    margin: 16px auto 24px; 
    padding-inline: 12px; 
    width: 100%;
  }
  .content { max-width: 1100px; padding: var(--space-32) var(--space-24); margin-left: auto; margin-right: auto; }
  .buttons-container { grid-template-columns: 1fr; gap: 16px; }
  .spotlight { grid-template-columns: 1fr; }
  .hero { padding: 48px 16px; }
  .hero h1 { font-size: 26px; }
  .hero-logo { width: 180px; margin-bottom: 12px; }
}
