/* Base y variables */
:root {
  --red: #c00000;
  --black: #111111;
  --gray-700: #444444;
  --gray-500: #777777;
  --gray-200: #f5f5f7;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --header-h: 72px; /* altura base del header para cálculos responsivos */
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--black);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Inter", "Open Sans", sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__logo {
  height: 72px; /* igual a la altura del header en desktop */
  max-height: 100%;
  width: auto;
  display: block;
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav__link {
  text-decoration: none;
  color: var(--black);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav__link:hover {
  color: var(--red);
  background: rgba(192, 0, 0, 0.08);
}

.nav__link.active {
  color: var(--red);
  background: rgba(192, 0, 0, 0.14);
}

/* Secciones */
.section {
  padding: clamp(80px, 10vw, 140px) 0; /* espaciado fluido según tamaño de pantalla */
}

section {
  scroll-margin-top: calc(var(--header-h) + 12px); /* compensa header sticky de forma fluida */
}

.section__title {
  font-size: clamp(26px, 3vw, 34px);
  margin: 0 0 24px 0;
  text-align: center;
  position: relative;
}

.section__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  background: var(--red);
  margin: 14px auto 0;
}

.section__intro {
  color: var(--gray-700);
  margin-bottom: 28px;
}

.section__note {
  margin-top: 24px;
  color: var(--gray-700);
}

/* HERO */
.hero__content {
  text-align: center;
  max-width: 900px;
}

.hero__title {
  font-size: 40px;
  margin: 0;
}

/* Ajustes de hero para mostrar mejor la imagen de fondo */
.hero {
  display: flex;
  align-items: center;
  min-height: 84vh; /* presencia más marcada, estilo portada corporativa */
}

/* Hero con fondo de oficina y overlay blanco para coherencia */
.hero--bg {
  background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
    url('../assets/oficina-ec.jpg') center / cover no-repeat;
}

@media (max-width: 640px) {
  .hero--bg {
    background: linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
      url('../assets/oficina-ec.jpg') center / cover no-repeat;
  }
}

.divider {
  width: 80px;
  height: 3px;
  background: var(--red);
  margin: 18px auto 24px;
}

.hero__subtitle {
  font-size: 22px;
  color: var(--gray-700);
  margin: 0 0 8px 0;
}

.hero__text {
  color: var(--gray-500);
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.btn--primary {
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(192, 0, 0, 0.18);
}

.btn--primary:hover {
  background: #a00000;
}

/* Listas */
.list {
  margin: 8px 0 16px 0;
}
.list li {
  margin: 6px 0;
}

/* Tarjetas */
.cards {
  display: grid;
  gap: 20px;
}

.cards--three {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.card__title {
  margin-top: 0;
}

/* Servicios */
/* Catálogo dinámico */
.services-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}

.service-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.08);
  border-color: #e6e6e6;
}

.service-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px 18px;
  border-left: 4px solid var(--red);
}

.service-card__title {
  margin: 0;
  font-size: 18px;
}

.service-card__toggle {
  appearance: none;
  border: none;
  background: rgba(192,0,0,0.1);
  color: var(--red);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.service-card__toggle:hover {
  background: rgba(192,0,0,0.18);
}

.service-card__toggle .chevron {
  margin-left: 8px;
  display: inline-block;
  transform: translateY(1px);
}

.service-card.expanded .service-card__toggle .chevron {
  transform: rotate(90deg);
}

.service-card__details {
  padding: 0 18px 18px 18px;
  color: var(--gray-700);
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.service-card__details.show {
  /* toggled from JS */
}

/* Grid genérico */
.grid {
  display: grid;
  gap: 20px;
}

.grid--three {
  grid-template-columns: repeat(3, 1fr);
}

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

.block {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.block__title {
  margin-top: 0;
}

/* Diferenciar Misión/Visión/Compromiso de Programas */
#mision .card {
  border: none;
  border-top: 6px solid var(--red);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

#mision .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.10);
}

#mision .card__title {
  text-align: center;
  font-weight: 800;
}

/* Contacto */
.contact__title {
  margin-top: 0;
}

.contact__bottom {
  margin-top: 26px;
  font-weight: 600;
}

/* Footer */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--gray-700);
}

/* Animaciones: fade-up */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsivo */
@media (max-width: 1024px) {
  .cards--three,
  .grid--three,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .header__inner {
    height: 64px;
  }
  .brand__logo {
    height: 64px; /* igual a la altura del header en móvil */
  }

  .nav__list {
    gap: 16px;
    font-size: 14px;
  }

  .hero__title {
    font-size: 32px;
  }

  .cards--three,
  .grid--three,
  .grid--two,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 120px 0; /* se mantiene el espaciado amplio */
  }
}
/* Quiénes Somos (About) */
.about__lead {
  text-align: center;
  color: var(--gray-700);
  margin: 10px auto 18px;
  max-width: 800px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 26px;
}

.badge {
  display: inline-block;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  background: #fff;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.feature-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
  position: relative;
}

.feature-card::before {
  content: "✓";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(192,0,0,0.12);
  color: var(--red);
  font-weight: 800;
}

.feature-card__title {
  margin-top: 0;
}

.value-callout {
  background: var(--gray-200);
  border-left: 6px solid var(--red);
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
}

.value-callout__lead {
  font-size: 18px;
  margin: 0 0 10px 0;
}

.check-list {
  margin: 12px 0 0 0;
  list-style: none;
  padding: 0;
}
.check-list li {
  margin: 8px 0;
  position: relative;
  padding-left: 26px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
}

/* el callout ya ocupa 1 columna (full width) en todos los tamaños */
/* === Header hamburguesa + logo grande === */
/* ===== HEADER 100% HAMBURGUESA (WP) ===== */
.site-header{position:sticky;top:0;background:#fff;border-bottom:1px solid #eee;z-index:10002;box-shadow:0 6px 20px rgba(0,0,0,0.06)}
.header-inner{display:flex;justify-content:center;align-items:center;height:104px;position:relative}

/* Logo visible y robusto (funciona con custom-logo y fallback) */
.logo,.header-inner .custom-logo-link{position:relative;left:auto;transform:none;top:auto;z-index:10005;text-decoration:none;display:inline-block;transition:opacity .2s ease}
.logo img,.custom-logo{height:96px;width:auto;display:block;margin:0 auto}
/* Ocultar logo cuando el menú móvil está abierto (sin cambiar layout) */
body.menu-open .logo,
body.menu-open .header-inner .custom-logo-link{opacity:0;pointer-events:none}

.burger{position:absolute;right:16px;top:50%;transform:translateY(-50%);width:44px;height:44px;display:inline-flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;background:#fff;border:1px solid #d7d7d7;border-radius:12px;padding:8px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.08)}
.burger span{display:block;width:22px;height:2px;background:#111;border-radius:2px}
.mobile-menu{position:fixed;inset:0 0 0 auto;width:min(340px,80%);background:#fff;transform:translateX(100%);transition:.32s ease;box-shadow:-16px 0 28px rgba(0,0,0,.12);padding:28px 24px;z-index:10000;pointer-events:auto}
.mobile-menu a{display:block;padding:16px 8px;border-bottom:1px solid #f1f1f1;color:#333;text-decoration:none;font-weight:600;position:relative;z-index:1}
.backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:.3s;z-index:9000}
body.menu-open .backdrop{opacity:1;pointer-events:auto}
body.menu-open .mobile-menu{transform:translateX(0)}
body.menu-open{overflow:hidden}
:target{scroll-margin-top:100px}

/* ===== SERVICES ACCORDION ===== */
.services-accordion {
  max-width: 800px;
  margin: 0 auto;
}

.service-item {
  border: 1px solid #e5e5e5;
  border-radius: 12px; /* uniformar radios con el sitio estático */
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(192,0,0,0.22); /* tono más intenso en estado normal */
  box-shadow: none;
  pointer-events: none;
  transition: border-color 0.25s ease, border-width 0.25s ease, box-shadow 0.25s ease;
}

.service-item:hover::after {
  border-color: rgba(192,0,0,0.28); /* mayor presencia en hover */
}

.service-item.active::after {
  border-color: rgba(192,0,0,0.34); /* rojo más vibrante al abrir */
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(192,0,0,0.16); /* halo suave adicional para realce */
}
.service-item.active {
  border-color: #dddddd;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.service-item.active::after {
  border-color: rgba(192,0,0,0.18);
  border-width: 2px;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: none;
  width: 100%;
  text-align: left;
}

.service-header:hover {
  background: #f8f9fa;
}

.service-header:focus {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  flex: 1;
  padding-right: 16px;
}

.service-icon {
  font-size: 0; /* ocultar texto directo */
  color: var(--red);
  width: 32px;
  height: 32px;
  display: grid; /* centrado perfecto */
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  flex-shrink: 0;
}
.service-icon::before {
  content: '+';
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.service-header[aria-expanded="true"] .service-icon::before { content: '−'; }
.service-header[aria-expanded="true"] .service-icon { background: var(--red); color: #fff; }
/* eliminar rotación para que el icono no se recorte */
/* .service-item.active .service-icon { transform: rotate(45deg); } */
.service-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background: #fff; /* fondo blanco para continuidad del borde */
}

.service-item.active .service-content {
  max-height: 1000px;
  padding: 24px;
}

.service-text {
  color: #555;
  line-height: 1.6;
}

.service-text p {
  margin: 0 0 16px 0;
}

.service-text p:last-child {
  margin-bottom: 0;
}

.service-text ul {
  margin: 16px 0;
  padding-left: 20px;
}

.service-text li {
  margin-bottom: 8px;
  color: #666;
}

.service-text strong {
  color: #333;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .service-header {
    padding: 16px 20px;
  }
  
  .service-title {
    font-size: 1.1rem;
    padding-right: 12px;
  }
  
  .service-item.active .service-content {
    padding: 20px;
  }
}
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.12);
  display: grid;
  place-items: center;
  z-index: 9999;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
  will-change: transform;
  animation: whatsapp-bounce-in 600ms cubic-bezier(.2,.8,.25,1) 200ms both;
}
.whatsapp-float svg{width:52%;height:52%;display:block;position:relative;top:0}
.whatsapp-float:hover {
  background-color: #2BE274;
  transform: scale(1.05);
  box-shadow: 0 10px 24px rgba(0,0,0,0.20), 0 3px 8px rgba(0,0,0,0.14);
}
@keyframes whatsapp-bounce-in {
  0%   { opacity: 0; transform: translateY(16px) scale(0.85); }
  50%  { opacity: 1; transform: translateY(-6px) scale(1.08); }
  80%  { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { animation: none; transition: background-color 0.2s ease; }
}

/* Carrusel de Servicios */
.services-carousel { position: relative; margin: 20px auto 32px; max-width: 940px; }
.services-carousel .carousel-track { display: flex; overflow: hidden; border-radius: 10px; background: #f7f7f7; }
.services-carousel .carousel-slide { min-width: 100%; flex: 0 0 100%; position: relative; }
.services-carousel .carousel-slide img { width: 100%; height: 480px; object-fit: cover; display: block; }
.services-carousel .carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(0,0,0,0.45); color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); transition: background 0.2s ease, transform 0.2s ease; z-index: 2; }
.services-carousel .carousel-btn:hover { background: rgba(0,0,0,0.6); transform: translateY(-50%) scale(1.06); }
.services-carousel .carousel-btn.prev { left: 10px; }
.services-carousel .carousel-btn.next { right: 10px; }
.services-carousel .carousel-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.services-carousel .carousel-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: #d1d5db; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.services-carousel .carousel-dots button.is-active { background: #4b5563; transform: scale(1.1); }
@media (max-width: 768px) { .services-carousel .carousel-slide img { height: auto; aspect-ratio: 16/9; } }
@media (prefers-reduced-motion: reduce) { .services-carousel .carousel-track { transition: none !important; } }

/* Ajustes finos de alineación del layout de Servicios en desktop */
@media (min-width: 1024px) {
  #servicios .container { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  #servicios .services-accordion, #servicios .services-carousel { align-self: start; width: 100%; }
  #servicios .services-carousel { justify-self: center; align-self: center; max-width: 940px; margin: 0 auto; }
}

/* Ajuste de overflow del carrusel y transición suave */
.services-carousel { overflow: hidden; }
.services-carousel .carousel-track { overflow: visible; transition: transform 400ms ease; will-change: transform; }