/**
 * Conecta Medic Spa - Hoja de Estilos Principal
 * Diseño Moderno, Minimalista y Profesional.
 * Totalmente Responsivo utilizando CSS Grid y Flexbox.
 * Zero Frameworks (No Bootstrap, No Tailwind).
 */

/* ==========================================================================
   1. VARIABLES GLOBALES Y TOKENS DE DISEÑO
   ========================================================================== */
:root {
  /* Paleta de Colores Corporativa */
  --color-primario: #0056b3;     /* Azul corporativo: Confianza, Profesionalismo */
  --color-secundario: #28a745;   /* Verde médico: Salud, Bienestar */
  --color-acento: #00d2ff;       /* Celeste: Tecnología, Innovación, Digital */
  --color-fondo: #ffffff;        /* Blanco puro: Limpieza, Minimalismo */
  --color-fondo-alt: #f8f9fa;    /* Gris muy suave: Para contrastar secciones */
  
  /* Colores de Texto */
  --color-texto: #333333;        /* Gris oscuro: Alta legibilidad */
  --color-texto-claro: #6c757d;  /* Gris medio: Para descripciones y subtítulos */
  --color-borde: #e9ecef;        /* Gris muy claro: Para divisores y bordes */
  
  /* Tipografía (Google Fonts) */
  --fuente-principal: 'Poppins', sans-serif; /* Para cuerpos de texto y botones */
  --fuente-secundaria: 'Inter', sans-serif;  /* Para encabezados (H1-H6) */
}

/* ==========================================================================
   2. RESET Y ESTILOS BASE (Accesibilidad orientada)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* Habilitar scroll suave nativo */
}

body {
  font-family: var(--fuente-principal);
  color: var(--color-texto);
  background-color: var(--color-fondo);
  line-height: 1.6;
  overflow-x: hidden; /* Evitar scroll horizontal accidental */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Asegurar que las imágenes y SVGs no desborden */
img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tipografía de Encabezados */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fuente-secundaria);
  font-weight: 700;
  color: var(--color-primario);
  margin-bottom: 1rem;
  line-height: 1.2;
}

p {
  margin-bottom: 1rem;
}

/* ==========================================================================
   3. CLASES UTILITARIAS DE DISEÑO (Layout Utilities)
   ========================================================================== */
.contenedor {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.seccion {
  padding: 100px 0;
}

.fondo-alt {
  background-color: var(--color-fondo-alt);
}

.texto-centro {
  text-align: center;
}

/* ==========================================================================
   4. SISTEMA DE BOTONES (UI Components)
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 30px; /* Bordes redondeados modernos */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 0.95rem;
  font-family: var(--fuente-principal);
  text-align: center;
}

.btn-primario {
  background-color: var(--color-primario);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 86, 179, 0.2);
}

.btn-primario:hover, .btn-primario:focus {
  background-color: #003d82;
  box-shadow: 0 8px 25px rgba(0, 86, 179, 0.4);
  transform: translateY(-3px); /* Micro-interacción de elevación */
  color: #ffffff;
  outline: none;
}

.btn-secundario {
  background-color: transparent;
  color: var(--color-primario);
  border-color: var(--color-primario);
}

.btn-secundario:hover, .btn-secundario:focus {
  background-color: var(--color-primario);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 86, 179, 0.3);
  outline: none;
}

.btn-deshabilitado {
  background-color: #e9ecef;
  color: #adb5bd;
  cursor: not-allowed;
  box-shadow: none;
  border-color: #e9ecef;
}

.btn-deshabilitado:hover {
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   5. COMPONENTES ESPECÍFICOS DE LA PÁGINA
   ========================================================================== */

/* --- 5.1 HEADER Y NAVEGACIÓN (Efecto Glassmorphism / Transparencia) --- */
.header-principal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  transition: all 0.4s ease;
  z-index: 1000;
  padding: 25px 0;
}

/* Clase añadida vía JS al hacer scroll */
.header-scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px); /* Efecto Glassmorphism */
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
}

.nav-contenedor {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 50px;
  transition: height 0.4s ease;
}

.header-scrolled .logo img {
  height: 40px; /* Reducir logo al hacer scroll */
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 35px;
}

.nav-enlace {
  font-weight: 500;
  color: #ffffff;
  position: relative;
  font-size: 1rem;
  padding: 5px 0;
}

/* Cambio de color de enlaces al hacer scroll */
.header-scrolled .nav-enlace {
  color: var(--color-texto);
}

.nav-enlace:hover, .nav-enlace:focus {
  color: var(--color-acento);
  outline: none;
}

/* Línea animada inferior en enlaces (Micro-animación) */
.nav-enlace::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-acento);
  transition: width 0.3s ease;
}

.nav-enlace:hover::after, .nav-enlace:focus::after {
  width: 100%;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.3s;
}

.header-scrolled .menu-btn {
  color: var(--color-primario);
}

/* --- 5.2 SECCIÓN HERO (Pantalla Completa) --- */
.hero {
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  position: relative;
  /* Gradiente premium mezclado */
  background: linear-gradient(135deg, rgba(0,86,179,0.95) 0%, rgba(0,210,255,0.85) 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero-contenedor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  z-index: 2;
}

.hero-contenido h1 {
  color: #ffffff;
  font-size: 4.8rem;
  line-height: 1.05;
  margin-bottom: 15px;
  letter-spacing: -1.5px;
}

.hero-contenido h2 {
  color: var(--color-acento);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 25px;
  font-family: var(--fuente-principal);
}

.hero-contenido p {
  font-size: 1.15rem;
  margin-bottom: 40px;
  opacity: 0.95;
  max-width: 520px;
}

.hero-botones {
  display: flex;
  gap: 20px;
}

/* Botón secundario especial para el Hero fondo oscuro */
.hero-botones .btn-secundario {
  border-color: #ffffff;
  color: #ffffff;
}

.hero-botones .btn-secundario:hover {
  background: #ffffff;
  color: var(--color-primario);
}

.hero-imagen img {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  animation: animacionFlotante 6s ease-in-out infinite;
}

/* --- 5.3 SECCIÓN NOSOTROS --- */
.nosotros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

.nosotros-texto h3 {
  color: var(--color-secundario);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.nosotros-texto h2 {
  font-size: 2.8rem;
  margin-bottom: 25px;
}

.nosotros-texto p {
  color: var(--color-texto-claro);
  font-size: 1.15rem;
}

.nosotros-valores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 45px;
}

.valor-card {
  background: var(--color-fondo-alt);
  padding: 30px;
  border-radius: 16px;
  border-left: 5px solid var(--color-primario);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.valor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

/* --- 5.4 SECCIÓN SERVICIOS (Tarjetas de alto nivel) --- */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 35px;
  margin-top: 60px;
}

.servicio-card {
  background: #ffffff;
  padding: 50px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-borde);
  z-index: 1;
}

.servicio-card:hover {
  transform: translateY(-15px);
  box-shadow: 0 25px 50px rgba(0, 86, 179, 0.1);
  border-color: transparent;
}

/* Efecto de borde superior dinámico */
.servicio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--color-primario), var(--color-acento));
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  transform-origin: left;
  z-index: 2;
}

.servicio-card:hover::before {
  transform: scaleX(1);
}

.servicio-icono {
  width: 90px;
  height: 90px;
  background: rgba(0, 210, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  color: var(--color-primario);
  transition: all 0.4s ease;
}

.servicio-card:hover .servicio-icono {
  background: var(--color-primario);
  color: #ffffff;
  transform: scale(1.1) rotate(5deg);
}

.servicio-icono svg {
  width: 45px;
  height: 45px;
  fill: currentColor;
}

.servicio-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

/* --- 5.5 SECCIÓN ESPECIALIDADES --- */
.especialidades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 25px;
  margin-top: 50px;
}

.especialidad-item {
  text-align: center;
  padding: 30px 15px;
  background: var(--color-fondo);
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
  border: 1px solid var(--color-fondo-alt);
  cursor: default;
}

.especialidad-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  border-color: var(--color-acento);
}

.especialidad-icono {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  fill: var(--color-secundario);
  transition: fill 0.3s ease;
}

.especialidad-item:hover .especialidad-icono {
  fill: var(--color-primario);
}

/* --- 5.6 BENEFICIOS --- */
.beneficios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.beneficio-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  padding: 25px 30px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.04);
  transition: transform 0.3s;
}

.beneficio-card:hover {
  transform: translateX(5px);
}

.beneficio-check {
  color: var(--color-secundario);
  flex-shrink: 0;
  background: rgba(40, 167, 69, 0.1);
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beneficio-check svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* --- 5.7 SECCIÓN AGENDA MÉDICA (Próximamente) --- */
.agenda-cta {
  background: linear-gradient(135deg, var(--color-primario), #003d82);
  color: #fff;
  padding: 80px 40px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 86, 179, 0.25);
}

.etiqueta-proximamente {
  display: inline-block;
  background: var(--color-secundario);
  color: #fff;
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 25px;
  letter-spacing: 1.5px;
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.agenda-cta h2 {
  color: #ffffff;
  margin-bottom: 25px;
  font-size: 3rem;
}

.agenda-cta p {
  font-size: 1.25rem;
  margin-bottom: 40px;
  opacity: 0.9;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* --- 5.8 CONTACTO Y FORMULARIO --- */
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 60px;
}

.formulario {
  background: #ffffff;
  padding: 50px 40px;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.06);
}

.formulario-grupo {
  margin-bottom: 25px;
}

.formulario-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--color-texto);
  font-size: 0.95rem;
}

.formulario-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--color-borde);
  border-radius: 12px;
  font-family: var(--fuente-principal);
  font-size: 1.05rem;
  transition: all 0.3s;
  background: var(--color-fondo-alt);
  color: var(--color-texto);
}

/* Estilo de foco accesible y estético */
.formulario-input:focus {
  outline: none;
  border-color: var(--color-acento);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.15);
}

textarea.formulario-input {
  resize: vertical;
  min-height: 160px;
}

.mapa-contenedor iframe {
  width: 100%;
  height: 100%;
  min-height: 550px;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.06);
}

/* --- 5.9 FOOTER --- */
.footer {
  background: #0f172a; /* Azul marino muy oscuro / Premium */
  color: #cbd5e1;
  padding: 100px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 70px;
  margin-bottom: 70px;
}

.footer-logo img {
  height: 55px;
  filter: brightness(0) invert(1);
  margin-bottom: 25px;
}

.footer-titulo {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.footer-titulo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--color-acento);
  border-radius: 3px;
}

.footer-lista {
  list-style: none;
}

.footer-lista li {
  margin-bottom: 18px;
}

.footer-lista a {
  color: #94a3b8;
  transition: color 0.3s, padding-left 0.3s;
}

.footer-lista a:hover,
.footer-lista a:focus {
  color: #ffffff;
  padding-left: 8px; /* Micro-animación de lista */
  outline: none;
}

.footer-contacto li {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  color: #94a3b8;
  margin-bottom: 22px;
  line-height: 1.5;
}

.footer-contacto svg {
  width: 24px;
  height: 24px;
  fill: var(--color-secundario);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 35px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  color: #ffffff;
  transition: all 0.3s;
}

.social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.social-link:hover,
.social-link:focus {
  background: var(--color-primario);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 86, 179, 0.4);
  outline: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-size: 0.95rem;
}

/* --- 5.10 BOTÓN WHATSAPP FLOTANTE --- */
.whatsapp-flotante {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 65px;
  height: 65px;
  background-color: #25d366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0px 8px 25px rgba(37, 211, 102, 0.4);
  z-index: 900;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-flotante:hover,
.whatsapp-flotante:focus {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0px 12px 30px rgba(37, 211, 102, 0.6);
  outline: none;
}

.whatsapp-flotante svg {
  width: 38px;
  height: 38px;
  fill: white;
}

/* ==========================================================================
   6. CLASES DE ANIMACIÓN (Para usar con JS IntersectionObserver)
   ========================================================================== */
@keyframes animacionFlotante {
  0% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

.animar-fade-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animar-fade-in.visible {
  opacity: 1;
  transform: scale(1);
}

.animar-slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* ==========================================================================
   7. MEDIA QUERIES (Responsive Design)
   ========================================================================== */

/* Tablet Horizontal / Portátiles Pequeños */
@media (max-width: 1024px) {
  .hero-contenido h1 { font-size: 4rem; }
  .hero-contenedor { gap: 30px; }
  .nosotros-grid, .contacto-grid { gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 50px; }
}

/* Tablet Vertical / Menú Hamburguesa */
@media (max-width: 768px) {
  .menu-btn { 
    display: block; 
    color: #ffffff; 
  }
  
  /* Menú desplegable móvil */
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
  }
  
  .nav-menu.activo {
    max-height: 500px;
  }
  
  .nav-enlace {
    display: block;
    padding: 20px 30px;
    color: var(--color-texto) !important;
    border-bottom: 1px solid var(--color-borde);
  }

  .nav-enlace::after { display: none; } /* Quitar línea hover en móvil */
  
  .hero { 
    min-height: 100vh; 
    padding-top: 100px; 
    padding-bottom: 50px;
  }
  
  .hero-contenedor { 
    grid-template-columns: 1fr; 
    text-align: center; 
  }
  
  .hero-contenido p { margin: 0 auto 30px; }
  .hero-botones { justify-content: center; }
  
  /* Ocultar ilustración hero en móvil para mejorar la experiencia */
  .hero-imagen { display: none; }
  
  /* Grillas a 1 columna */
  .nosotros-grid, .contacto-grid, .footer-grid { 
    grid-template-columns: 1fr; 
  }
  
  .nosotros-texto h2 { font-size: 2.2rem; }
  
  .mapa-contenedor iframe { 
    height: 400px; 
    min-height: auto; 
  }
  
  .seccion { padding: 70px 0; }
  
  .agenda-cta { padding: 60px 30px; }
  .agenda-cta h2 { font-size: 2.2rem; }
}

/* Móviles / Smartphones */
@media (max-width: 480px) {
  .hero-contenido h1 { font-size: 3rem; }
  .hero-contenido h2 { font-size: 1.4rem; }
  
  /* Botones apilados en móvil */
  .hero-botones { flex-direction: column; gap: 15px; }
  .btn { width: 100%; }
  
  /* Especialidades 2 columnas en móvil */
  .especialidades-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
  .especialidad-item { padding: 20px 10px; }
  
  .formulario { padding: 30px 20px; }
  
  /* Ajustar botón de WhatsApp */
  .whatsapp-flotante {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
  }
  .whatsapp-flotante svg { width: 30px; height: 30px; }
}
