/* ==========================================
   1. VARIABLES DE DISEÑO (Colores Claros)
   ========================================== */
:root {
  /* Fondos limpios y profesionales */
  --bg-primary: #f8fafc;       
  --bg-secondary: #ffffff;     
  --bg-dark-accent: #0f172a;   

  /* Colores de marca y acentos */
  --primary: #0284c7;          
  --primary-hover: #0369a1;    
  --accent: #0d9488;           

  /* Tipografías y Textos con gran contraste */
  --text-main: #0f172a;        
  --text-muted: #475569;      
  --text-light: #ffffff;       
  
  /* Fuentes */
  --font-display: 'DM Serif Display', serif;
  --font-sans: 'DM Sans', sans-serif;

  /* Bordes, Sombras y Transiciones */
  --border: #e2e8f0;          
  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --transition: all 0.25s ease-in-out;
}

/* ==========================================
   2. REGLAS GENERALES Y RESET
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================
   3. BOTONES Y COMPONENTES REUTILIZABLES
   ========================================== */
.btn-primary {
  display: inline-block;
  background-color: var(--primary);
  color: var(--text-light) !important;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.3);
}

.btn-ghost {
  display: inline-block;
  background-color: transparent;
  color: var(--text-main);
  font-weight: 500;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: 30px;
  transition: var(--transition);
}

.btn-ghost:hover {
  background-color: var(--bg-primary);
  border-color: var(--text-main);
  transform: translateY(-2px);
}

/* Títulos de sección */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-tag {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-main);
}

.section-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 48px;
}

/* ==========================================
   4. NAVEGACIÓN (NAV CLARO)
   ========================================== */
nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-main);
  line-height: 1.1;
}

.logo span {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-cta {
  background-color: var(--bg-primary);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-cta:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-secondary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text-main);
}

/* ==========================================
   5. HERO SECTION
   ========================================== */
.hero {
  background: radial-gradient(circle at 80% 20%, #f0f9ff 0%, var(--bg-primary) 100%);
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

.hero-text-content {
  flex: 1;
  max-width: 600px;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--primary);
}

.hero-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-logo-wrapper {
  background-color: var(--bg-secondary);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 380px;
  border: 1px solid var(--border);
}

.hero-logo-img {
  width: 100%;
  height: auto;
}

.hero-badge {
  position: absolute;
  bottom: -20px;
  left: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.badge-dot {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.badge-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================
   6. SECCIÓN ESPECIALISTAS (Tarjetas Alineadas)
   ========================================== */
#especialistas {
  background-color: var(--bg-primary);
}

.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.doctor-card {
  background-color: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  
  /* Permite unificar el flujo del contenido para alinear los botones */
  display: flex;
  flex-direction: column;
}

.doctor-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-img-container {
  height: 300px;
  overflow: hidden;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* Alinea los rostros por defecto arriba */
}

/* Contenedor de Información con Flexbox Activo */
.doctor-info {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Hace que todas las áreas de info midan exactamente lo mismo */
}

.doctor-info h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-main);
  margin-bottom: 8px;
}

.doctor-specialty {
  color: var(--primary);
  font-weight: 500;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

/* El meta ahora tiene color oscuro contrastante y empuja el botón */
.doctor-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
  flex-grow: 1; /* CLAVE: Rellena el espacio vacío y alinea los botones */
}

.card-btn {
  display: block;
  text-align: center;
  background-color: var(--primary);
  color: var(--text-light) !important;
  padding: 12px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: auto; /* Empuja el botón al fondo del contenedor */
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.1);
  transition: var(--transition);
}

.card-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transform: translateY(-1px);
}

/* ==========================================
   7. INSTALACIONES
   ========================================== */
.section-instalaciones {
  background-color: var(--bg-secondary);
}

.fachadas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.fachada-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  height: 250px;
}

.fachada-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.fachada-card:hover .fachada-img {
  transform: scale(1.04);
}

/* ==========================================
   8. MAPA Y CONTACTO (Totalmente Responsive)
   ========================================== */
.contact-section {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.contact-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.contact-info-block {
  max-width: 500px;
}

.contact-info-block p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Contenedor Adaptativo del Mapa */
.map-container {
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  height: 400px;
  box-shadow: var(--shadow-lg);
  background-color: var(--bg-secondary);
}

.map-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

/* ==========================================
   9. FOOTER (Mantiene Contraste Oscuro Elegante)
   ========================================== */
footer {
  background-color: var(--bg-dark-accent);
  color: var(--text-light);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 48px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.footer-brand-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.footer-desc {
  color: #cbd5e1;
  font-size: 0.95rem;
  max-width: 360px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-light);
}

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

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul a {
  color: #cbd5e1;
  font-size: 0.95rem;
}

.footer-col ul a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-col p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  border-top: 1px solid #1e293b;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ==========================================
   10. MEDIA QUERIES (Responsividad)
   ========================================== */
@media (max-width: 1024px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }
  .hero-text-content {
    max-width: 100%;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-badge {
    left: 50%;
    transform: translateX(-50%);
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* Ideal para controlarse desde js */
  }
  .menu-toggle {
    display: flex;
  }
  .nav-cta {
    display: none;
  }
  .section-title {
    font-size: 2rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .map-container {
    height: 300px;
  }
}