:root {
  /* --- Paleta de Colores Institucional --- */
  --color-navy: #20315f; /* Texto, Footer, Títulos oscuros */
  --color-royal: #004a98; /* Botones, Links, Elementos activos */
  --color-sky: #0099dd; /* Detalles, Fondos suaves, Iconos */
  --color-white: #ffffff;
  --color-gray-light: #f4f6f9; /* Para romper el blanco puro en secciones */

  /* --- Tipografía --- */
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Inter", sans-serif;

  /* --- Espaciado y UI (Para que se sienta "limpio") --- */
  --border-radius: 8px; /* Bordes ligeramente redondeados, muy moderno */
  --container-width: 1200px;
  --transition: all 0.3s ease;
}

/* Reset básico moderno */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(
    --color-navy
  ); /* Usamos tu azul oscuro en vez de negro puro (más elegante) */
  background-color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; /* Texto más nítido en Mac */
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* --- Estilos del Header --- */
.header {
  background-color: rgba(
    255,
    255,
    255,
    0.95
  ); /* Blanco con leve transparencia */
  backdrop-filter: blur(10px); /* Efecto moderno de desenfoque detrás */
  position: sticky; /* Se pega al techo al hacer scroll */
  top: 0;
  z-index: 1000; /* Asegura que flote sobre todo lo demás */
  box-shadow: 0 2px 15px rgba(32, 49, 95, 0.08); /* Sombra suave azulada */
  padding: 1rem 0;
}

/* Contenedor utilitario para centrar contenido */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.header-container {
  display: flex;
  justify-content: space-between; /* Logo izq - Menú centro - Botón der */
  align-items: center;
}

/* Ajuste del Logo */
.logo-img {
  height: 50px; /* Ajusta este valor según la proporción de tu SVG */
  width: auto;
  display: block;
}

/* Navegación */
.nav-list {
  display: flex;
  list-style: none;
  gap: 2rem; /* Espacio entre items del menú */
}

.nav-link {
  text-decoration: none;
  color: var(--color-navy);
  font-weight: 600; /* Semibold para que se lea bien */
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-royal); /* Cambio de color al pasar el mouse */
}

/* --- Dropdown Menu --- */
.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-white);
  box-shadow: 0 4px 12px rgba(32, 49, 95, 0.15);
  border-radius: var(--border-radius);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  list-style: none;
  padding: 0.5rem 0;
  z-index: 1001;
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-navy);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-link:hover {
  background-color: var(--color-gray-light);
  color: var(--color-royal);
}

/* --- Botones (UI Kit básico) --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px; /* Botones totalmente redondos (Pill shape) */
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  font-size: 0.9rem;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--color-royal);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-navy);
  transform: translateY(-2px); /* Pequeña elevación al interactuar */
  box-shadow: 0 4px 12px rgba(0, 74, 152, 0.3); /* Sombra brillante */
}

/* Efecto de 'pulso' táctil al hacer click */
.btn-primary:active {
  transform: scale(0.95);
  transition: transform 0.1s;
  box-shadow: 0 2px 4px rgba(0, 74, 152, 0.2);
}

/* --- Ajustes para Material Icons --- */

/* Clase base del icono */
.material-symbols-rounded {
  font-size: 20px; /* Tamaño del icono */
  color: var(--color-navy); /* Color inicial */
  transition:
    transform 0.3s ease,
    color 0.3s ease;
  /* Corrección de alineación vertical para fuentes de iconos */
  display: inline-flex;
  vertical-align: middle;
}

/* Icono personalizable independientemente */
.icon-calendar {
  color: #fff; /* Por defecto hereda, pero se puede cambiar aquí */
  /* Ejemplo: color: yellow; */
}

/* --- Efecto HOVER en el enlace padre --- */
.nav-link:hover .material-symbols-rounded {
  color: var(--color-sky); /* Cambia a azul claro */
  transform: translateY(-2px); /* El saltito hacia arriba */
}

/* Ajustes específicos para el Dropdown */
.dropdown-link .material-symbols-rounded {
  font-size: 18px; /* Un poco más pequeños en el submenú */
  color: var(--color-royal); /* Los ponemos en azul royal por defecto */
}

.dropdown-link:hover .material-symbols-rounded {
  transform: translateX(3px); /* En el submenú, el saltito es lateral */
}

/* --- Efecto Click (Active) para enlaces --- */
.nav-link:active,
.dropdown-link:active {
  transform: scale(0.95); /* Reducción ligera al hacer click */
  color: var(--color-royal);
}

/* Ajuste específico para mantener los iconos alineados durante el click */
.nav-link:active .material-symbols-rounded,
.dropdown-link:active .material-symbols-rounded {
  transform: none; /* Evitamos conflictos con otras transformaciones */
}

/* --- HERO SECTION MODERNA --- */

.hero-section {
  padding: 4rem 0; /* Espacio generoso arriba y abajo */
  background: linear-gradient(
    135deg,
    #f8faff 0%,
    #eef4fc 100%
  ); /* Degradado muy sutil */
  position: relative;
  overflow: hidden; /* Para que nada se salga de la pantalla */
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Dos columnas iguales */
  align-items: center; /* Centrado verticalmente */
  gap: 4rem;
}

/* --- Tipografía y Badges --- */

/* La "pastilla" pequeña arriba del título */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 74, 152, 0.1); /* Azul Royal muy transparente */
  color: var(--color-royal);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.badge-icon {
  font-size: 16px;
}

.hero-content h1 {
  font-size: 3.5rem; /* Título grande e impactante */
  line-height: 1.1;
  color: var(--color-navy);
  margin-bottom: 1.5rem;
  letter-spacing: -1px; /* Hace que el título se vea más compacto y moderno */
  position: relative; /* Aseguramos z-index */
  z-index: 5;
}

/* Resaltamos una palabra clave en Azul Royal */
/* Estilos para el contenedor del highlight */
.text-highlight {
  color: var(--color-royal);
  position: relative;
  z-index: 1;
  display: inline-block; /* Necesario para que el SVG se ajuste al ancho */
}

/* Eliminamos el ::after anterior */
.text-highlight::after {
  display: none;
}

/* SVG del subrayado */
.highlight-svg {
  position: absolute;
  bottom: -5px; /* Ajuste para que quede debajo del texto */
  left: 0;
  width: 100%;
  height: 15px;
  z-index: -1;
  pointer-events: none;
}

/* Animación del trazado "Sharpie" */
.highlight-svg path {
  stroke: var(--color-sky);
  stroke-width: 8px; /* Grosor del marcador */
  stroke-linecap: round; /* Bordes redondeados */
  stroke-dasharray: 500; /* Longitud suficiente para cubrir el trazo */
  stroke-dashoffset: 500; /* Empieza oculto */
  opacity: 0.3; /* Transparencia de marcador */
  animation: draw-stroke 1.2s ease-out 0.5s forwards;
}

@keyframes draw-stroke {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes highlight-expand {
  to {
    width: 100%;
  }
}

.hero-description {
  font-size: 1.1rem;
  color: #556987; /* Un gris azulado suave para lectura */
  margin-bottom: 2rem;
  max-width: 480px; /* Evita que el texto sea demasiado largo de leer */
  position: relative;
  z-index: 5;
}

/* --- Botones --- */
.hero-actions {
  display: flex;
  gap: 1rem;
  position: relative;
  z-index: 5; /* Asegura que los botones estén sobre el blob */
}

/* Botón secundario (Outline) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--color-navy);
  color: var(--color-navy);
  transition: var(--transition);
}

.btn-outline:hover {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.btn-outline:active {
  transform: scale(0.95);
  transition: transform 0.1s;
  box-shadow: 0 2px 4px rgba(0, 74, 152, 0.2);
}

.arrow-icon {
  transition: transform 0.3s ease;
  /* Color will be inherited by default (Navy) */
}

/* Cuando se hace hover en el botón COMPLETO, el icono se mueve y cambia de color */
.btn-outline:hover .arrow-icon {
  transform: translateX(5px);
  color: var(--color-sky); /* #0099dd */
}

/* Ajuste al botón primario para incluir icono */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Parte Visual (Derecha) --- */
.hero-visual {
  position: relative;
  /* Centramos la imagen en su columna */
  display: flex;
  justify-content: center;
}

/* Círculo decorativo (ahora SVG) detrás de la imagen */
.blob-bg {
  position: absolute;
  width: 550px; /* Un poco más grande para que se note la forma */
  height: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none; /* Que el mouse lo ignore */
}

/* Contenedor para la animación de borde "Snake" y Carrusel */
.hero-img-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  border-radius: 20px;
  padding: 3px; /* Espacio para el borde */
  overflow: hidden; /* Mantiene la animación dentro de la forma */
  background-color: transparent;
  box-shadow: 20px 20px 60px rgba(32, 49, 95, 0.15); /* Sombra externa */

  /* Grid Stacking para el carrusel */
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
}

/* El "Borde" giratorio detrás */
.hero-img-box::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250%; /* Mucho más grande para cubrir al rotar */
  height: 250%;
  background: conic-gradient(
    transparent,
    transparent,
    transparent,
    var(--color-sky)
  );
  animation: border-spin 4s ease-in-out infinite; /* Curva de velocidad "orgánica" */
  transform: translate(-50%, -50%);
  z-index: -1; /* Detrás de la imagen */
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 17px; /* Un poco menos que el contenedor (20px - 3px) */
  background-color: var(--color-white); /* Fondo por si acaso */
  position: relative;
  z-index: 2; /* Sobre la animación */

  /* Configuración para stacking */
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-img.active {
  opacity: 1;
}

@keyframes border-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* --- Tarjeta Flotante ("Floating Card") --- */
.floating-card {
  position: absolute;
  bottom: 40px; /* Ajusta según la imagen */
  left: -20px; /* Se sale un poco a la izquierda para romper la simetría */
  z-index: 2;
  background-color: var(--color-white);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: float 3s ease-in-out infinite; /* Pequeña animación de flotación */
}

.float-icon-box {
  background-color: #dcf1f7; /* Fondo rojo muy suave */
  color: #ff4757; /* Icono rojo corazón */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-text {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: var(--color-navy);
}

/* Animación Keyframes */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* =========================================
   MENÚ HAMBURGUESA - ESTILOS BASE
   ========================================= */

/* Ocultar botón hamburguesa en escritorio */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1050;
  position: relative;
}

/* Líneas del hamburger icon */
.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 24px;
  height: 2.5px;
  background-color: var(--color-navy);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.77, 0, 0.175, 1);
}

.hamburger-icon {
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -7px;
}

.hamburger-icon::after {
  top: 7px;
}

/* Animación hamburguesa → X */
.mobile-toggle.active .hamburger-icon {
  background-color: transparent;
}

.mobile-toggle.active .hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-toggle.active .hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Overlay - oculto por defecto en TODOS los viewports */
.menu-overlay {
  display: none;
}

/* =========================================
   RESPONSIVE MÓVIL (max-width: 968px)
   ========================================= */
@media (max-width: 968px) {
  /* --- Hero Responsive --- */
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-description {
    margin: 0 auto 2rem auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .floating-card {
    left: 50%;
    transform: translateX(-50%);
    bottom: -20px;
    width: max-content;
    animation: none;
  }

  /* --- BOTÓN HAMBURGUESA --- */
  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Cuando el menú está activo, el botón flota fijo */
  .mobile-toggle.active {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 1050;
  }

  /* --- NAV MENU: PANEL LATERAL --- */
  .nav-menu {
    /* Ocultar COMPLETAMENTE cuando no está activo */
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height para móviles modernos */
    background-color: var(--color-white);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    padding: 5rem 1.5rem 2rem 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1040;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  }

  /* Cuando el menú está activo: mostrarlo y deslizarlo */
  .nav-menu.active {
    display: block;
    transform: translateX(0);
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* --- OVERLAY OSCURO --- */
  /* NOTA: El header tiene backdrop-filter, lo que convierte position:fixed
     en position:absolute relativo al header. Por eso usamos unidades de
     viewport (vw/vh) en vez de porcentajes para cubrir toda la pantalla. */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport para móviles modernos */
    background-color: rgba(32, 49, 95, 0.45);
    z-index: 1030; /* POR DEBAJO del nav-menu (1040) y del botón (1050) */
    opacity: 0;
    transition: opacity 0.4s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .menu-overlay.active {
    display: block;
    opacity: 1;
  }

  /* --- Ocultar CTA del header en móvil --- */
  .header-container > .btn-primary {
    display: none;
  }

  /* --- Submenús (dropdown) siempre abiertos en móvil --- */
  .nav-item-dropdown {
    flex-direction: column;
    display: flex;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-left: 2px solid var(--color-sky);
    padding-left: 1rem;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
    background-color: transparent;
    width: 100%;
    min-width: unset;
    margin-top: 0.5rem;
  }

  /* Prevenir desbordamiento horizontal cuando el menú está abierto */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
  }
}

/* --- UTILITARIOS GENERALES --- */
.section-padding {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.text-primary {
  color: var(--color-royal);
}

/* Cabeceras de Sección Centradas */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem auto;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--color-navy);
  margin-bottom: 1rem;
}

.section-header p {
  color: #556987;
  font-size: 1.1rem;
}

/* --- GRID DE SERVICIOS (La magia moderna) --- */
.services-grid {
  display: grid;
  /* min(300px, 100%) evita desbordamiento en pantallas menores a 300px */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
}

/* --- TARJETA DE SERVICIO --- */
.service-card {
  background: var(--color-white);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05); /* Borde sutil casi invisible */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); /* Sombra muy suave por defecto */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote suave */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* El Icono con fondo */
.icon-box {
  width: 60px;
  height: 60px;
  background-color: var(--color-gray-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--color-royal);
  transition: var(--transition);
}

.icon-box .material-symbols-rounded {
  font-size: 32px;
  width: 32px; /* Forzar ancho exacto */
  height: 32px; /* Forzar alto exacto */
  line-height: 32px; /* Centrado vertical */
  text-align: center; /* Centrado horizontal */
  display: block;
  overflow: hidden; /* Por si es el texto fallback el que molesta */
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-navy);
}

.service-card p {
  color: #667;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1; /* Empuja el enlace hacia abajo para alinearlos todos */
}

/* Enlace "Ver más" */
.link-arrow {
  text-decoration: none;
  color: var(--color-royal);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.link-arrow .material-symbols-rounded {
  font-size: 18px;
  transition: transform 0.3s ease;
}

/* --- INTERACCIÓN HOVER (Efecto WOW) --- */
.service-card:hover {
  transform: translateY(-10px); /* Sube la tarjeta */
  box-shadow: 0 20px 40px rgba(32, 49, 95, 0.1); /* Sombra más fuerte */
}

/* Cambio de color del icono al pasar el mouse por la tarjeta */
.service-card:hover .icon-box {
  background-color: var(--color-royal);
  color: var(--color-white);
  transform: rotate(5deg); /* Pequeña rotación divertida */
}

.service-card:hover .icon-box .material-symbols-rounded {
  color: var(--color-white);
}

/* Flecha se mueve */
.service-card:hover .link-arrow .material-symbols-rounded {
  transform: translateX(5px);
}

/* Borde inferior decorativo al hover */
.service-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-royal), var(--color-sky));
  transform: scaleX(0); /* Oculto inicialmente */
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::after {
  transform: scaleX(1); /* Se dibuja de izq a der */
}

/* --- FOOTER MODERNO --- */
.main-footer {
  background-color: var(--color-navy);
  color: #b0b8c8; /* Gris azulado claro, cansa menos la vista que el blanco puro */
  position: relative;
  padding-top: 0;
  margin-top: 4rem;
}

/* El divisor ondulado */
.footer-wave {
  position: absolute;
  top: -1px; /* Para tapar cualquier línea blanca */
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  /* transform removed to fix orientation */
}

/* Fix para pantallas de alta resolución donde puede aparecer una línea */
.footer-wave {
  top: -1px; /* Ajuste fino */
  height: 60px; /* Altura original */
}

.footer-wave svg {
  position: relative;
  display: block;
  width: calc(100% + 2px); /* Ancho extra para evitar huecos laterales */
  height: 100%;
  /* Mantener flip horizontal si se desea, pero quitamos el vertical implícito del padre si existía */
  transform: rotateY(180deg);
  left: -1px; /* Ajuste centro */
}

.footer-wave path {
  fill: var(
    --color-white
  ); /* Debe coincidir con el fondo de la sección anterior */
}

/* Grid del Footer */
.footer-grid {
  padding: 5rem 20px 3rem 20px;
  display: grid;
  /* 4 columnas que se adaptan. La primera (brand) es más ancha */
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
  gap: 3rem;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

/* Pequeña línea decorativa bajo los títulos */
.footer-col h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 30px;
  height: 2px;
  background-color: var(--color-sky);
}

/* Columna de Marca */
.brand-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo {
  max-width: 180px;
  margin: 0 auto 1rem auto;
  display: block;
  /* Si no tienes logo blanco, usa este filtro para volver blanco tu logo azul: */
  /* filter: brightness(0) invert(1); */
}

.footer-desc {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 300px; /* Evita que el texto centrado sea demasiado ancho */
}

/* Botones de contacto destacados */
.contact-highlight {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Centrado interno para la columna de marca */
.brand-col .contact-highlight {
  align-items: center;
}

.brand-col .contact-item {
  width: 100%;
  max-width: 280px;
  justify-content: center;
}

.brand-col .contact-item div {
  align-items: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05); /* Fondo semitransparente */
  padding: 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none; /* Quita subrayado si es link */
  color: inherit;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(
    -3px
  ); /* Cambiado a subir un poco en lugar de lateral */
}

/* UPDATED: Changed class to matches HTML */
.contact-item .material-symbols-rounded,
.contact-item .contact-icon {
  color: var(--color-sky);
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.contact-item div {
  display: flex;
  flex-direction: column;
}

.contact-item small {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b0b8c8;
}

.contact-item strong {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Lista de Sedes */
.sedes-list {
  list-style: none;
  font-size: 0.9rem;
}

.sedes-list li {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.sedes-list strong {
  color: var(--color-white);
}

/* Estilo para el acordeón de "más sedes" */
.more-sedes summary {
  cursor: pointer;
  color: var(--color-sky);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  outline: none;
}

/* Enlaces */
.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: #b0b8c8;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-links a:hover {
  color: var(--color-sky);
  padding-left: 5px; /* Efecto de desplazamiento */
}

/* Iconos pequeños para horarios */
.icon-tiny {
  font-size: 16px;
  vertical-align: middle;
  margin-right: 5px;
  color: var(--color-sky);
}

.hours-box p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Supersalud y Social */
.supersalud-box {
  margin-bottom: 2rem;
  text-align: right;
}

.supersalud-img {
  width: 140px;
  height: auto;
  display: inline-block;
}

/* En móvil el centrado ya está definido en la media query inferior */

.social-links {
  display: flex;
  justify-content: flex-end; /* Alineados a la derecha */
  gap: 1rem;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  text-decoration: none;
  transition: var(--transition);
}

.social-btn:hover {
  background-color: var(--color-royal);
  transform: translateY(-3px);
}

/* Barra de Copyright */
.copyright-bar {
  background-color: rgba(0, 0, 0, 0.2); /* Oscurece un poco el fondo base */
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.copyright-bar .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 968px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr; /* 2 columnas en tablets */
  }

  .supersalud-box,
  .social-links {
    text-align: left;
    justify-content: flex-start;
  }

  /* Centrado de columnas 2, 3 y 4 en móviles */
  .footer-col:nth-child(2),
  .footer-col:nth-child(3),
  .footer-col:nth-child(4) {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-col:nth-child(2) h4::after,
  .footer-col:nth-child(3) h4::after,
  .footer-col:nth-child(4) h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .sedes-list li,
  .footer-links a,
  .hours-box p,
  .supersalud-box,
  .social-links {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr; /* 1 columna en móvil */
    gap: 2rem;
  }

  .copyright-bar .container {
    justify-content: center;
    text-align: center;
  }
}

/* --- FIXES GLOBALES --- */
/* NO poner overflow-x en html, rompe position: sticky */
body {
  max-width: 100vw;
  overflow-x: clip; /* clip no rompe sticky, a diferencia de hidden */
}

/* --- FIX COLORES FOOTER --- */
.footer-col p,
.footer-links a,
.sedes-list li span,
.sedes-list li,
.supersalud-box .caption,
.hours-box p {
  color: #e0e6ed; /* Blanco grisáceo para mejor lectura sobre azul oscuro */
}

.footer-links a:hover {
  color: var(--color-sky);
}

.contact-highlight .contact-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-highlight .contact-item small {
  color: #b0b8c8;
}

/* =========================================
   PÁGINAS INTERNAS (Preparaciones, etc.)
   ========================================= */

/* --- Banner Superior (Page Header) --- */
.page-header {
  background-color: var(--color-navy); /* Fondo sólido elegante */
  color: var(--color-white);
  padding: 3rem 0;
  text-align: center;
  background-image: radial-gradient(
    circle at 10% 20%,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 20%
  ); /* Detalle sutil */
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Buscador Estilizado --- */
.search-container {
  max-width: 600px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 15px;
  color: var(--color-royal);
  font-size: 24px;
}

.search-box input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem; /* Espacio a la izq para el icono */
  border: 2px solid #e0e6ed;
  border-radius: 50px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--color-royal);
  box-shadow: 0 4px 15px rgba(0, 74, 152, 0.1);
}

.search-hint {
  font-size: 0.85rem;
  color: #889;
  margin-top: 0.5rem;
}

/* --- Tabla Personalizada --- */
.table-responsive {
  overflow-x: auto; /* Permite scroll lateral en móviles */
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Asegura que no se rompa en pantallas muy pequeñas */
}

.custom-table thead {
  background-color: var(--color-royal);
  color: var(--color-white);
}

.custom-table th,
.custom-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.custom-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.custom-table td {
  font-size: 0.95rem;
  color: #445;
}

/* Zebra Striping (Filas alternas) */
.custom-table tbody tr:nth-child(even) {
  background-color: #f8faff;
}

/* Hover en filas */
.custom-table tbody tr:hover {
  background-color: #eef4fc;
  cursor: default;
}

/* Destacar el código CUPS */
.custom-table td strong {
  color: var(--color-navy);
  background-color: #e0e6ed;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* =========================================
   RESPONSIVE TABLE (Corrección Tarjetas Móviles)
   ========================================= */

@media (max-width: 768px) {
  /* 1. Ocultamos cabeceras de tabla */
  .custom-table thead {
    display: none;
  }

  /* 2. Convertimos todo a bloques */
  .custom-table,
  .custom-table tbody,
  .custom-table tr,
  .custom-table td {
    display: block;
    width: 100%;
  }

  /* 3. FIX CRÍTICO DE DESBORDAMIENTO */
  .custom-table {
    min-width: 0 !important;
  }

  .table-responsive {
    box-shadow: none;
    background: transparent;
    overflow-x: hidden;
    padding: 0;
    border: none; /* Asegura limpieza */
  }

  /* 4. Estilo de TARJETA (Card) */
  .custom-table tr {
    background-color: var(--color-white);
    margin-bottom: 1.5rem;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem; /* Más aire interno */
    width: 100%; /* Ocupa el 100% del contenedor (que ya tendrá padding) */
  }

  /* 5. Estilos internos de la celda */
  .custom-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .custom-table td:last-child {
    border-bottom: none;
  }

  /* Títulos de campo (data-label) */
  .custom-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--color-royal);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
  }

  /* FIX PARA EL BUSCADOR */
  .search-container {
    padding: 0; /* Ya no necesitamos padding extra aquí si arreglamos el container */
    margin-bottom: 2rem;
  }
}

/* =========================================
   PAGINACIÓN
   ========================================= */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 1rem;
}

.btn-page {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.6rem 1.2rem;
  border: none;
  background-color: var(--color-white);
  color: var(--color-navy);
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid #e0e6ed;
}

.btn-page:hover:not(:disabled) {
  background-color: var(--color-royal);
  color: var(--color-white);
  border-color: var(--color-royal);
  transform: translateY(-2px);
}

.btn-page:disabled {
  background-color: #f4f6f9;
  color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

.page-info {
  font-size: 0.9rem;
  color: #667;
  font-weight: 600;
}
