html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size for better mobile scaling */
  overflow-x: hidden; /* Prevenir scroll horizontal no deseado */
}

body {
  cursor: url("../assets/dermatoscopio.png") 16 16, pointer;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #fafafa;
  color: #333;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optimizaciones generales para móviles */
* {
  box-sizing: border-box;
}

/* Eliminar el efecto azul (tap highlight) en dispositivos móviles */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Permitir selección de texto solo en elementos de texto */
p, span, h1, h2, h3, h4, h5, h6, a, .hero-text, .about-text {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Mejorar el rendimiento en móviles */
.hero, .about, #services, #contact {
  will-change: transform;
}

/* Optimizar imágenes para móviles */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mejorar la accesibilidad táctil */
button, .btn-cta, .btn-contact, .nav-btn {
  min-height: 44px; /* Tamaño mínimo recomendado para touch */
  min-width: 44px;
}

/* Optimizar el scroll en móviles */
@media (max-width: 768px) {
  html {
    font-size: 14px; /* Reducir ligeramente el tamaño base en móviles */
  }
  
  /* Mejorar el rendimiento de scroll */
  .hero::before,
  .hero::after {
    will-change: transform;
  }
  
  /* Optimizar las animaciones en móviles */
  .floating-bubbles-canvas {
    transform: translateZ(0); /* Forzar aceleración por hardware */
  }
}

/* Asegurar que la versión web mantenga su altura completa */
@media (min-width: 1024px) {
  .hero {
    min-height: 100vh; /* Altura completa para pantallas grandes */
    padding: 80px 40px 60px; /* Solo navbar en escritorio */
    flex-direction: row; /* Layout horizontal para web */
    text-align: left;
  }
  
  .hero-text {
    max-width: 500px;
    flex: 1;
  }
  
  .hero-illustration {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  /* Restaurar el canvas de burbujas para web */
  .floating-bubbles-canvas {
    top: 80px; /* Solo navbar en escritorio */
    height: calc(100% - 80px);
  }
}

/* Barra superior con información dinámica */
.top-info-bar {
  /* Estilos base para móvil (position fixed) */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInDown 0.8s ease-out;
}

/* En escritorio: integrar dentro del header */
@media (min-width: 1024px) {
  .top-info-bar {
    position: static; /* Cambiar de fixed a static */
    height: auto;
    background: transparent; /* Sin fondo en escritorio */
    border-bottom: none;
    box-shadow: none;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: center; /* Centrar horizontalmente */
    animation: none; /* Sin animación en escritorio */
    flex: 1; /* Tomar espacio disponible */
    margin: 0 40px; /* Mayor espaciado del logo y menú */
    padding: 0 20px; /* Padding horizontal para separación */
  }
  
  .top-info-content {
    font-size: 0.95rem !important; /* Mismo tamaño que los enlaces del navbar */
    gap: 20px !important; /* Espaciado armonioso */
    font-weight: 600 !important; /* Mismo peso que los enlaces */
    color: #c4308b !important; /* Mismo color que el logo y enlaces */
    font-family: 'Poppins', sans-serif !important; /* Misma fuente */
    text-shadow: none !important; /* Sin sombra en escritorio para integración */
    letter-spacing: 0.3px !important;
    display: flex !important; /* Restaurar display flex para escritorio */
    align-items: center !important; /* Centrar verticalmente */
    justify-content: center !important; /* Centrar horizontalmente */
    margin: 0 auto !important; /* Centrar el bloque en el espacio disponible */
    max-width: 400px !important; /* Limitar ancho para mejor centrado */
  }
  
  .location-info {
    color: #c4308b !important; /* Mismo color que el header */
    opacity: 1 !important;
    text-shadow: none !important;
    font-weight: 600 !important; /* Mismo peso que los enlaces */
    font-size: 0.95rem !important; /* Mismo tamaño */
  }
  
  .time-info {
    color: #c4308b !important; /* Mismo color que el header */
    font-weight: 600 !important; /* Mismo peso */
    text-shadow: none !important;
    font-size: 0.95rem !important; /* Mismo tamaño */
  }
  
  .weather-info {
    font-size: 0.95rem !important; /* Mismo tamaño que los otros elementos */
    opacity: 1 !important;
    color: #c4308b !important; /* Mismo color que el header */
    text-shadow: none !important;
    font-weight: 600 !important; /* Mismo peso que los enlaces */
    font-family: 'Poppins', sans-serif !important; /* Misma fuente */
    display: inline !important; /* Restaurar display inline para escritorio */
  }
  
  /* Sobrescribir estilos inline del JavaScript */
  .weather-info span {
    color: #c4308b !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.95rem !important;
    opacity: 1 !important;
    text-shadow: none !important;
    display: inline !important; /* Restaurar display inline para escritorio */
  }
  
  /* Restaurar gauge para escritorio */
  .mini-uv-gauge {
    display: inline-flex !important; /* Restaurar display inline-flex para escritorio */
    transform: scale(1) !important; /* Tamaño normal para escritorio */
    margin-left: 15px !important; /* Margen original para escritorio */
  }
}

/* Estilos base para móvil - serán sobrescritos en escritorio */
.top-info-content {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.time-info {
  font-weight: 600;
  color: #ffb6d9;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  font-size: 15px;
}

/* Estilos base para móvil - serán sobrescritos en escritorio */
.weather-info {
  opacity: 1;
  font-size: 14px;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Animación de entrada */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0; /* En escritorio no necesita ajuste, en móvil se ajustará */
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF8F8;
  backdrop-filter: blur(10px);
  padding: 8px 40px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  z-index: 1000;
  transition: all 0.3s ease;
}

/* En escritorio: navbar normal sin ajuste de top */
@media (min-width: 1024px) {
  .navbar {
    top: 0;
  }
}

/* En móvil: navbar en la parte superior (sin barra superior separada) */
@media (max-width: 1023px) {
  .navbar {
    top: 0; /* Sin ajuste, navbar en la parte superior */
  }
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #c4308b;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: 1px;
}

.mobile-menu-toggle.active span:first-child {
  transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.mobile-menu-toggle.active span:last-child {
  transform: rotate(-45deg);
}

.navbar.scrolled {
  background: #FFF5F5;
  box-shadow: 0 4px 30px rgba(0,0,0,0.12);
  padding: 6px 40px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #c4308b;
  letter-spacing: -0.5px;
  transition: all 0.3s ease;
}

.logo:hover {
  color: #ff66c4;
  transform: scale(1.02);
}

.navbar nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

/* Mobile navigation styles */
@media (max-width: 768px) {
  /* Eliminar cualquier margen o padding superior que pueda causar espacio blanco */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    padding-top: env(safe-area-inset-top, 0) !important;
  }
  
  /* Optimización del header para móvil */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #FFF8F8;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin: 0 !important;
    top: 0 !important;
  }
  
  /* Logo dividido en dos líneas para móvil */
  .logo {
    font-size: 1.44rem; /* 20% menos que 1.8rem */
    font-weight: 800;
    color: #c4308b;
    letter-spacing: -0.5px;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    text-align: left;
  }
  
  /* Ocultar el span original del logo en móvil */
  .logo span {
    display: none;
  }
  
  /* Crear las dos líneas usando pseudo-elementos */
  .logo::before {
    content: "Kathy";
    display: block;
    font-size: 1.44rem;
    font-weight: 800;
    color: #c4308b;
    letter-spacing: -0.5px;
    line-height: 1.1;
  }
  
  .logo::after {
    content: "Derma";
    display: block;
    font-size: 1.44rem;
    font-weight: 800;
    color: #c4308b;
    letter-spacing: -0.5px;
    line-height: 1.1;
  }
  
  /* Reorganizar el layout del header móvil en tres zonas equilibradas */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #FFF8F8;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin: 0 !important;
    top: 0 !important;
    min-height: 60px; /* Altura mínima para acomodar el contenido en dos líneas */
  }
  
  /* Zona izquierda: Logo dividido en dos líneas */
  .logo {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-right: 10px;
  }
  
  /* Zona central: Índice UV reorganizado */
  .top-info-bar {
    position: static;
    height: auto;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
    flex: 1;
    margin: 0 15px;
    padding: 0;
  }
  
  /* Contenedor que agrupa texto UV + gauge en fila */
  .top-info-content {
    display: flex;
    flex-direction: row; /* texto a la izquierda, gauge a la derecha */
    align-items: center; /* centra verticalmente texto y gauge */
    gap: 6px; /* Reducido de 8px a 6px para ahorrar espacio */
    flex-wrap: nowrap; /* evita que el gauge salte abajo */
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #c4308b;
    text-shadow: none;
    letter-spacing: 0.2px;
    min-width: 0; /* Permitir que se encoja si es necesario */
  }
  
  /* Bloque de texto del UV en dos líneas */
  .weather-info {
    display: flex;
    flex-direction: column; /* 2 líneas */
    line-height: 1.05;
    font-size: 0; /* Ocultar el texto original */
    flex-shrink: 1; /* Permitir que se encoja si es necesario */
    min-width: 0; /* Permitir que se encoja */
  }
  
  /* Crear estructura de dos líneas para el índice UV */
  .weather-info::before {
    content: "Índice UV:";
    display: block;
    font-size: 13px; /* Aumentado de 11px a 13px (+18%) */
    font-weight: 600;
    color: #c4308b;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    line-height: 1.05;
    margin-bottom: 1px;
  }
  
  /* Estilo para el span que contiene el valor y nivel */
  .weather-info span {
    font-size: 13px !important; /* Aumentado de 11px a 13px (+18%) */
    color: #c4308b !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    opacity: 1 !important;
    text-shadow: none !important;
    display: block;
    text-align: center;
    line-height: 1.05;
    white-space: nowrap; /* mantener "0.0 Bajo" en una sola línea */
  }
  
  /* Gauge más grande y alineado horizontalmente */
  .mini-uv-gauge {
    margin: 0;
    display: flex;
    align-items: center;
    transform: scale(1.55); /* ~55% más grande (aumentado de 1.35 + 15%) */
    transform-origin: left center;
    flex-shrink: 0; /* No permitir que se encoja */
  }
  
  .gauge-container {
    width: 40px;
    height: 40px;
  }
  
  .gauge-image {
    width: 40px;
    height: 40px;
  }
  
  .gauge-needle {
    width: 2px;
    height: 16px;
    top: 12px;
    left: 19px;
  }
  
  /* Zona derecha: Menú hamburguesa */
  .mobile-menu-toggle {
    flex: 0 0 auto;
    margin-left: 10px;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .navbar nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 1000;
  }
  
  .navbar nav.active {
    right: 0;
  }
  
  .navbar nav a {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: rgba(196, 48, 139, 0.1);
    color: #c4308b;
    width: 200px;
    text-align: center;
  }
  
  .navbar nav a:hover {
    background: #c4308b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 48, 139, 0.3);
  }
  
  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }
}

.navbar a {
  text-decoration: none;
  color: #c4308b; /* Mismo color que el logo */
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  transition: all 0.3s ease;
  padding: 8px 0;
}

/* Eliminado el pseudo-elemento ::after que causaba el rectángulo blanco */

.navbar a:hover {
  color: #ff66c4; /* Mismo color de hover que el logo */
  transform: translateY(-1px);
}

/* Eliminado el hover del pseudo-elemento ::after */

/* Hero - Piel humana en corte transversal completa */
.hero {
  display: flex;
  justify-content: space-around;
  align-items: center;
  min-height: 100vh; /* Restaurado a 100vh para versión web */
  padding: 55px 40px 60px; /* Padding ajustado para header más fino */
  flex-wrap: wrap;
  color: white;
  text-align: left;
  position: relative;
  overflow: hidden;
  
  /* Fondo base de la piel - degradado fluido de tonos rosados */
  background: linear-gradient(
    180deg,
    /* Superficie de la piel (rosado muy claro) */
    #FDF2F8 0%,
    #FCE7F3 10%,
    #FBCFE8 20%,
    #F9A8D4 30%,
    
    /* Transición media (rosados medios) */
    #F472B6 40%,
    #EC4899 50%,
    #DB2777 60%,
    
    /* Profundidad de la piel (rosados intensos) */
    #BE185D 70%,
    #9D174D 80%,
    #831843 90%,
    #701A75 100%
  );
  
  background-size: 100% 100%;
  animation: skinBreathing 8s ease-in-out infinite;
}

/* Textura superior sutil - Borde ondulado sin división */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20%; /* Zona superior para textura sutil */
  
  background: 
    /* Textura de poros muy sutil */
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 150"><defs><pattern id="epidermisTexture" width="80" height="40" patternUnits="userSpaceOnUse"><circle cx="40" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="15" cy="12" r="0.5" fill="white" opacity="0.08"/><circle cx="65" cy="25" r="0.7" fill="white" opacity="0.09"/><circle cx="25" cy="30" r="0.3" fill="white" opacity="0.06"/><circle cx="55" cy="10" r="0.4" fill="white" opacity="0.07"/></pattern></defs><rect width="300" height="150" fill="url(%23epidermisTexture)"/></svg>'),
    
    /* Gradiente muy sutil que se integra con el fondo */
    linear-gradient(
      180deg,
      rgba(253, 242, 248, 0.3) 0%,
      rgba(252, 231, 243, 0.2) 50%,
      transparent 100%
    );
  
  /* Borde ondulado muy suave */
  clip-path: polygon(
    0% 0%, 
    10% 5%, 
    20% 2%, 
    30% 8%, 
    40% 3%, 
    50% 6%, 
    60% 4%, 
    70% 7%, 
    80% 3%, 
    90% 5%, 
    100% 0%
  );
  
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
  
  /* Sombra muy sutil */
  box-shadow: 
    inset 0 3px 10px rgba(255, 255, 255, 0.2);
}

/* Textura inferior sutil - Profundidad rosada sin división */
.hero::after {
  content: '';
  position:absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20%; /* Zona inferior para textura sutil */
  
  background: 
    /* Textura de tejido muy sutil */
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><defs><pattern id="subcutaneousTexture" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="1.2" fill="rgba(255,255,255,0.05)"/><circle cx="12" cy="18" r="0.8" fill="rgba(255,255,255,0.04)"/><circle cx="48" cy="42" r="1" fill="rgba(255,255,255,0.045)"/><circle cx="18" cy="48" r="0.6" fill="rgba(255,255,255,0.035)"/><circle cx="42" cy="12" r="0.7" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="200" height="200" fill="url(%23subcutaneousTexture)"/></svg>'),
    
    /* Gradiente rosado sutil que se integra con el fondo */
    linear-gradient(
      0deg,
      rgba(112, 26, 117, 0.2) 0%,
      rgba(131, 24, 67, 0.15) 50%,
      transparent 100%
    );
  
  /* Borde ondulado muy suave */
  clip-path: polygon(
    0% 100%,
    10% 95%,
    20% 98%,
    30% 92%,
    40% 96%,
    50% 94%,
    60% 97%,
    70% 93%,
    80% 96%,
    90% 95%,
    100% 100%
  );
  
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
  
  /* Sombra muy sutil */
  box-shadow: 
    inset 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Canvas para células animadas - Solo área rosada */
.floating-bubbles-canvas {
  position: absolute;
  top: 80px; /* Empezar después del navbar (que tiene ~80px de altura) */
  left: 0;
  width: 100%;
  height: calc(100% - 80px); /* Restar la altura del navbar */
  z-index: 2;
  pointer-events: none;
  opacity: 0.9;
  background: transparent;
  overflow: hidden; /* Evitar que las células se salgan del área */
}

.hero-text {
  max-width: 500px;
  z-index: 3;
  position: relative;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fafafa;
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease-out;
}

.hero p {
  font-size: 1.4rem;
  font-weight: 400;
  color: #fafafa;
  margin-bottom: 30px;
  line-height: 1.6;
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Botón CTA */
.btn-cta {
  display: inline-block;
  padding: 16px 32px;
  background: white;
  color: #c4308b;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease-out 0.4s both;
  position: relative;
  overflow: hidden;
}

.btn-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.btn-cta:hover {
  transform: translateY(-2px) scale(1.02);
  background: #f8f9fa;
  color: #c4308b;
  box-shadow: 0 8px 25px rgba(196, 48, 139, 0.25);
}

.btn-cta:hover::before {
  left: 100%;
}

/* Hero SVG */
.hero-illustration {
  z-index: 3;
  position: relative;
  animation: fadeInRight 1s ease-out 0.6s both;
}

/* La ilustración de piel ahora está integrada en el fondo */
.hero-illustration {
  /* Mantener el contenedor pero sin contenido visual */
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 3;
}

/* Animación de respiración de la piel */
@keyframes skinBreathing {
  0%, 100% { 
    background-position: 0% 50%;
    transform: scale(1);
  }
  50% { 
    background-position: 100% 50%;
    transform: scale(1.001);
  }
}

/* Transiciones suaves entre capas de piel */
.hero::before,
.hero::after {
  transition: all 0.8s ease-in-out;
}

/* Efecto de integración suave para las texturas */
.hero::before {
  /* Integración suave de textura superior */
  background-blend-mode: soft-light;
}

.hero::after {
  /* Integración suave de textura inferior */
  background-blend-mode: soft-light;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Sections */
.section {
  padding: 80px 20px;
  max-width: 1000px;
  margin: auto;
  text-align: center;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #c4308b;
}

.cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  background: white;
  padding: 30px 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  flex: 1 1 250px;
  transition: transform 0.3s;
}
.card:hover {
  transform: translateY(-8px);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  color: #ccc;
  text-align: center;
  padding: 40px 20px;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

/* Optimizaciones del footer para móviles */
@media (max-width: 768px) {
  footer {
    padding: 30px 15px;
    font-size: 0.8rem;
  }
  
  footer p {
    margin-bottom: 10px;
    line-height: 1.4;
  }
  
  footer .legal-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  
  footer .legal-links a {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }
  
  footer .legal-links a:hover {
    background: rgba(196, 48, 139, 0.2);
    color: #c4308b;
  }
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-pattern" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23c4308b" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-pattern)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

footer p {
  margin: 0 0 15px 0;
  font-weight: 500;
  position: relative;
  z-index: 2;
}

footer .legal-links {
  position: relative;
  z-index: 2;
}

footer .legal-links a {
  color: #999;
  text-decoration: none;
  margin: 0 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

footer .legal-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #c4308b;
  transition: width 0.3s ease;
}

footer .legal-links a:hover {
  color: #c4308b;
  transform: translateY(-1px);
}

footer .legal-links a:hover::after {
  width: 100%;
}

/* Sección alterna con fondo suave */
.section.alt {
  background: #ffe5f0;
  border-radius: 20px;
  padding: 80px 20px;
  margin: 40px auto;
  max-width: 1000px;
}

/* Sección Sobre mí - Imagen de fondo completa */
.about {
  background-image: url('../assets/sobre-mi-movil.svg'); /* Fondo móvil por defecto */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  width: 100vw; /* Usar viewport width para asegurar ancho completo */
  max-width: none; /* Anular max-width de .section */
  margin: 0; /* Anular margin: auto de .section */
  padding: 0; /* Anular padding de .section */
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow-x: hidden;
}

/* ===== ESCRITORIO (≥ 1024px) - SECCIÓN FIJA SIN SCROLL ===== */
@media (min-width: 1024px) {
  .about {
    height: calc(120vh + 120px); /* Altura aumentada para dar espacio a las tarjetas expandidas + espacio inferior */
    min-height: calc(120vh + 120px); /* Altura mínima aumentada con espacio inferior */
    max-height: none; /* Permitir que la altura incluya el espacio inferior */
    overflow: visible; /* Permitir que el espacio inferior sea visible */
    position: relative;
    width: 100vw !important; /* Asegurar ancho completo del viewport para centrado correcto */
    background-image: url('../assets/sobre-mi.svg') !important; /* Fondo de escritorio */
    background-position: 100% 50% !important; /* Mover imagen de la doctora claramente hacia el lado derecho */
    background-size: cover !important; /* Mantener tamaño original */
    background-repeat: no-repeat !important; /* Asegurar que no se repita */
    background-color: transparent !important; /* Asegurar que no haya color de fondo que cubra la imagen */
  }

  /* Centrar la barra de búsqueda decorativa horizontalmente en escritorio */
  .decorative-search-bar {
    left: 50% !important; /* Centrar horizontalmente - usar !important para sobrescribir estilo base */
    transform: translateX(-50%) !important; /* Centrado perfecto respecto al ancho total */
  }

  /* Ajustar el hover para mantener el centrado */
  .decorative-search-bar:hover {
    transform: translateX(-50%) translateY(-2px) !important; /* Mantener centrado y aplicar elevación */
  }

  /* Ocultar texto "Pulsa aquí" en escritorio - solo visible en móvil */
  .about-stack-hint {
    display: none !important;
  }
}





/* Responsive Design para móviles */
@media (max-width: 1023px) {
  .about {
    background-image: url('../assets/sobre-mi-movil.svg'); /* Fondo móvil específico */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
}

@media (max-width: 768px) {
  .about {
    height: 100vh; /* Usar altura completa de viewport */
    min-height: 100vh; /* Asegurar altura mínima */
    max-height: none; /* Permitir altura dinámica para que las tarjetas no se corten */
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden; /* Solo ocultar overflow horizontal */
    overflow-y: visible; /* Permitir que el contenido vertical sea visible para las tarjetas */
    /* Cambios específicos para móviles */
    background-size: cover; /* Usar cover para que la doctora ocupe más espacio */
    background-repeat: no-repeat;
    background-position: center; /* Centrar la imagen para mejor visualización en móvil */
    background-color: #f9c6d9; /* Color de fondo rosa para cubrir bordes sobrantes */
    position: relative; /* Asegurar posicionamiento relativo */
    object-fit: cover; /* Usar cover para llenar mejor el espacio */
  }
}

@media (max-width: 480px) {
  .about {
    height: 100vh; /* Mantener altura completa */
    min-height: 100vh; /* Asegurar altura mínima */
    max-height: none; /* Permitir altura dinámica para que las tarjetas no se corten */
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden; /* Solo ocultar overflow horizontal */
    overflow-y: visible; /* Permitir que el contenido vertical sea visible para las tarjetas */
    /* Cambios específicos para móviles pequeños */
    background-image: url('../assets/sobre-mi-movil.svg'); /* Asegurar fondo móvil en pantallas pequeñas */
    background-size: cover; /* Usar cover para que la doctora ocupe más espacio */
    background-repeat: no-repeat;
    background-position: center; /* Centrar la imagen para mejor visualización */
    background-color: #f9c6d9; /* Color de fondo rosa para cubrir bordes sobrantes */
    position: relative; /* Asegurar posicionamiento relativo */
    object-fit: cover; /* Usar cover para llenar mejor el espacio */
  }
}

/* Media query adicional para orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .about {
    background-image: url('../assets/sobre-mi-movil.svg'); /* Asegurar fondo móvil en orientación horizontal */
    background-position: center center; /* Centrar completamente en orientación horizontal */
    background-size: contain; /* Mantener contain para ver imagen completa */
  }
}

/* Barra de búsqueda decorativa glassmorphism */
.decorative-search-bar {
  position: absolute;
  top: 80px; /* Margen superior para no tapar el menú */
  left: 15%; /* Mover más hacia la izquierda (15% del ancho total) - será sobrescrito en escritorio */
  transform: translateX(0); /* Sin centrado automático - será sobrescrito en escritorio */
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 500px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0 20px;
  z-index: 10;
  transition: all 0.3s ease;
}

/* Tarjeta de información moderna tipo Dropbox/McLaren */
.about-card {
  position: absolute;
  top: 280px; /* Bajada 25% más para espacio de tarjetas apiladas */
  left: 15%; /* Movida hacia la izquierda para no cubrir a la doctora */
  width: 30%; /* Ancho del 30% del contenedor */
  max-width: 400px;
  background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%);
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(255, 105, 180, 0.12);
  padding: 16px 28px 24px 28px;
  z-index: 15;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top: 2.5px solid #d0d0d0 !important;
  border-left: 2.5px solid #d0d0d0 !important;
  border-right: 2.5px solid #d0d0d0 !important;
  border-bottom: 2.5px solid #d0d0d0 !important;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(255, 105, 180, 0.18);
  background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%);
}

/* Header de la tarjeta con ícono y título */
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  margin-top: 0.8rem;
}

.card-icon {
  width: 32px;
  height: 32px;
  color: #D63384;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.about-card:hover .card-icon {
  transform: scale(1.05);
  color: #ff66c4;
}

.about-card h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #D63384;
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0.3px;
  white-space: normal; /* Permitir que el texto se ajuste en múltiples líneas si es necesario */
  word-wrap: break-word; /* Permitir que las palabras largas se ajusten */
  overflow-wrap: break-word; /* Alternativa moderna para word-wrap */
}

.about-card p {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #444;
  margin: 0;
  line-height: 1.7;
  letter-spacing: 0.1px;
}

/* Logo CILAD en tarjetas de diplomaturas */
.cilad-img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: auto;
  /* Eliminar fondo blanco usando mix-blend-mode */
  /* multiply hace que el blanco se vuelva transparente sobre fondos claros */
  mix-blend-mode: multiply;
  /* Si multiply no funciona bien, usar darken que también elimina blancos */
  /* mix-blend-mode: darken; */
}

/* Ajuste alternativo: si multiply no funciona, usar filtro para eliminar blanco */
/* Descomentar si es necesario un enfoque más agresivo */
/*
.about-card--stack img.cilad-img {
  mix-blend-mode: darken;
  opacity: 0.95;
}
*/

/* Asegurar centrado horizontal y vertical dentro de las tarjetas stack */
.about-card--stack img.cilad-img {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  flex: 0 0 auto;
}

/* Asegurar que las tarjetas con logo CILAD distribuyan el espacio correctamente */
.about-card--stack:has(img.cilad-img) {
  justify-content: flex-start; /* Mantener header arriba */
}

.about-card--stack:has(img.cilad-img) .card-header {
  flex-shrink: 0; /* Evitar que el header se encoja */
  margin-bottom: 8px; /* Espaciado reducido antes del logo */
}

/* Ajuste específico para escritorio con altura fija de 210px */
/* Considerando padding: 14px arriba, 20px abajo = altura disponible ~176px */
/* Header ocupa ~50-60px, espacio para logo ~110-120px */
@media (min-width: 1024px) {
  .about-card--stack img.cilad-img {
    max-height: clamp(70px, 60%, 120px);
    max-width: clamp(70px, 80%, 320px);
    margin-top: auto; /* Empujar hacia abajo */
    margin-bottom: 0; /* Sin margen inferior para usar todo el espacio */
  }
  
  /* Asegurar que las tarjetas con logo distribuyan el espacio */
  .about-card--stack:has(img.cilad-img) {
    justify-content: flex-start; /* Header arriba */
  }
  
  .about-card--stack:has(img.cilad-img) img.cilad-img {
    margin-top: auto; /* Usar todo el espacio vertical disponible */
  }
}

/* Ajuste para tablets */
@media (min-width: 768px) and (max-width: 1023px) {
  .about-card--stack img.cilad-img {
    max-height: clamp(60px, 60%, 100px);
    max-width: clamp(60px, 75%, 280px);
    margin-top: auto;
  }
}

/* Ajuste para móviles - considerar altura dinámica de tarjetas */
@media (max-width: 767px) {
  .about-card--stack img.cilad-img {
    max-height: clamp(50px, 60%, 85px);
    max-width: clamp(50px, 75%, 240px);
    margin-top: auto;
  }
}

/* Animaciones adicionales para la tarjeta */
.about-card {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Preparación para múltiples tarjetas - Estilos base reutilizables */
.about-card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* Estilos para tarjetas adicionales - Todas con el mismo color de fondo */
.about-card:nth-child(2),
.about-card:nth-child(3),
.about-card:nth-child(4),
.about-card:nth-child(5) {
  /* Todas las tarjetas usan el mismo color de fondo que la primera */
  background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(255, 105, 180, 0.12);
}

/* Efectos hover mejorados para tarjetas adicionales - Todas con el mismo color */
.about-card:nth-child(2):hover,
.about-card:nth-child(3):hover,
.about-card:nth-child(4):hover,
.about-card:nth-child(5):hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(255, 105, 180, 0.18);
  background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%);
}

/* ===== MÚLTIPLES TARJETAS - CONTENEDOR ===== */
.about-cards {
  position: absolute;
  top: 320px; /* Posicionado debajo de la tarjeta principal */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  z-index: 10;
}

/* ===== ESCRITORIO (≥ 1024px) - STACK VERTICAL ===== */
@media (min-width: 1024px) {
  .about-cards {
    position: absolute; /* Cambio a absolute para mantener posición exacta */
    top: 200px; /* Elevado 80px hacia arriba para alinearse con la doctora */
    left: 38%; /* Aumentado de 30% a 38% para agregar espacio lateral desde el borde izquierdo */
    width: 30%; /* Ancho exacto de la tarjeta base original */
    max-width: 400px; /* Ancho máximo exacto de la tarjeta base original */
    height: auto; /* Altura automática para evitar overflow */
    max-height: calc(120vh - 220px); /* Ajustado para la nueva altura de sección */
    overflow: visible; /* Permitir que las tarjetas sean visibles */
    z-index: 10;
  }

  .about-card--stack {
    position: absolute;
    width: 100%;
    max-width: 400px;
    left: 0; /* Sin desplazamiento horizontal */
    transition: all 0.3s ease;
    /* Aplicar estilos base de la tarjeta original */
    background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%);
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(255, 105, 180, 0.12);
    padding: 16px 28px 24px 28px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 2.5px solid #d0d0d0 !important;
    border-left: 2.5px solid #d0d0d0 !important;
    border-right: 2.5px solid #d0d0d0 !important;
    border-bottom: 2.5px solid #d0d0d0 !important;
    height: 210px; /* Altura fija uniforme aumentada para que quepa todo el texto */
    box-sizing: border-box; /* Incluir padding y border en el cálculo de altura */
    display: flex;
    flex-direction: column; /* Permite que el contenido se ajuste verticalmente */
    padding: 14px 28px 20px 28px; /* Padding ajustado: menos arriba (14px) y abajo (20px) para dar más espacio al contenido */
  }

  /* Ajuste del header para mantener uniformidad */
  .about-card--stack .card-header {
    margin-bottom: 16px; /* Espaciado reducido entre header y párrafo para optimizar espacio */
    margin-top: 0.5rem; /* Margen superior reducido para optimizar espacio */
    flex-shrink: 0; /* Evitar que el header se encoja */
  }

  /* Ajuste del título para evitar desbordes en escritorio */
  .about-card--stack .card-header h3 {
    font-size: 1.2rem; /* Tamaño mantenido */
    white-space: normal; /* Permitir que el texto se ajuste en múltiples líneas */
    word-wrap: break-word; /* Permitir que las palabras largas se ajusten */
    overflow-wrap: break-word; /* Alternativa moderna para word-wrap */
    line-height: 1.25; /* Line-height ligeramente ajustado para optimizar espacio */
    margin: 0; /* Eliminar márgenes del h3 */
    flex: 1; /* Permitir que el h3 use el espacio disponible en el header */
  }

  /* Ajuste del párrafo para que todo el texto sea visible */
  .about-card--stack > p {
    flex: 1; /* Permite que el párrafo use el espacio disponible */
    margin: 0; /* Eliminar márgenes para control preciso */
    line-height: 1.5; /* Line-height ajustado para optimizar espacio sin perder legibilidad */
    overflow: visible; /* Permitir que todo el texto sea visible */
    display: block; /* Eliminar -webkit-box para permitir que todo el texto sea visible */
    font-size: 0.95rem; /* Tamaño de fuente mantenido */
  }

  /* ===== ANIMACIÓN DE FLOTACIÓN AUTOMÁTICA ===== */
  /* Animaciones separadas para cada tarjeta que preservan sus escalas */
  @keyframes float1 {
    0%, 100% {
      transform: scale(1) translateY(0px);
    }
    50% {
      transform: scale(1) translateY(-5px);
    }
  }

  @keyframes float2 {
    0%, 100% {
      transform: scale(0.98) translateY(0px);
    }
    50% {
      transform: scale(0.98) translateY(-5px);
    }
  }

  @keyframes float3 {
    0%, 100% {
      transform: scale(0.96) translateY(0px);
    }
    50% {
      transform: scale(0.96) translateY(-5px);
    }
  }

  @keyframes float4 {
    0%, 100% {
      transform: scale(0.94) translateY(0px);
    }
    50% {
      transform: scale(0.94) translateY(-5px);
    }
  }

  /* Aplicar animación de flotación a todas las tarjetas con diferentes delays y escalas */
  .about-card--stack {
    will-change: transform; /* Optimización para mejor rendimiento */
    transform-origin: center center; /* Origen de transformación centrado */
  }

  /* Desfases de tiempo entre tarjetas para efecto natural - mantener escalas */
  .about-card--1 {
    animation: float1 3.5s ease-in-out infinite;
    animation-delay: 0s;
  }

  .about-card--2 {
    animation: float2 3.5s ease-in-out infinite;
    animation-delay: 0.35s;
  }

  .about-card--3 {
    animation: float3 3.5s ease-in-out infinite;
    animation-delay: 0.7s;
  }

  .about-card--4 {
    animation: float4 3.5s ease-in-out infinite;
    animation-delay: 1.05s;
  }

  /* Pausar animación cuando las tarjetas están expandidas (exploded) */
  .about-cards.exploded .about-card--stack {
    animation-play-state: paused;
  }

  /* Asegurar que la animación no interfiera con el hover */
  .about-card--stack:hover {
    animation-play-state: paused;
  }

  /* Primera tarjeta (frente) - tarjeta base "Dermatóloga certificada" */
  .about-card--1 {
    top: 0; /* Sin desplazamiento vertical - posición base */
    left: 0; /* Sin desplazamiento horizontal */
    z-index: 4; /* Z-index más alto para estar al frente */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); /* Sombra más sutil para jerarquía */
    /* La transformación scale y translateY se manejan en la animación float1 */
  }

  /* Segunda tarjeta (medio) - apilada verticalmente */
  .about-card--2 {
    top: 30px; /* Desplazamiento vertical reducido para optimizar espacio */
    left: 0; /* Sin desplazamiento horizontal */
    z-index: 3; /* Z-index intermedio */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* Sombra intermedia */
    /* La transformación scale y translateY se manejan en la animación float2 */
  }

  /* Tercera tarjeta (medio-bajo) - más abajo en la pila */
  .about-card--3 {
    top: 60px; /* Desplazamiento vertical reducido para optimizar espacio */
    left: 0; /* Sin desplazamiento horizontal */
    z-index: 2; /* Z-index intermedio-bajo */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12); /* Sombra más pronunciada para profundidad */
    /* La transformación scale y translateY se manejan en la animación float3 */
  }

  /* Cuarta tarjeta (fondo) - al final de la pila */
  .about-card--4 {
    top: 90px; /* Desplazamiento vertical reducido para optimizar espacio */
    left: 0; /* Sin desplazamiento horizontal */
    z-index: 1; /* Z-index más bajo para estar al fondo */
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15); /* Sombra más pronunciada para profundidad */
    /* La transformación scale y translateY se manejan en la animación float4 */
  }

  /* ===== ANIMACIÓN INTERACTIVA DE EXPLOSIÓN ===== */
  .about-cards {
    cursor: pointer; /* Indicar que es interactivo */
    transition: all 0.6s ease-in-out; /* Transición suave para el contenedor */
  }

  .about-card--stack {
    transition: all 0.6s ease-in-out; /* Transición suave para cada tarjeta */
    cursor: pointer; /* Indicar que es clickeable */
  }

  /* Estado de explosión - cuando se hace clic */
  .about-cards.exploded {
    /* El contenedor mantiene su posición base */
  }

  /* Distribución equilibrada en cuadrantes */
  .about-cards.exploded .about-card--1 {
    top: 50px; /* Cuadrante superior izquierdo */
    left: -200px; /* Se mueve hacia la izquierda */
    z-index: 4; /* Mantiene z-index alto */
    transform: scale(1); /* Escala completa */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Sombra más pronunciada */
  }

  .about-cards.exploded .about-card--2 {
    top: 50px; /* Cuadrante superior derecho */
    left: 200px; /* Se mueve hacia la derecha */
    z-index: 3;
    transform: scale(1); /* Escala completa */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  .about-cards.exploded .about-card--3 {
    top: 300px; /* Cuadrante inferior izquierdo */
    left: -200px; /* Se mueve hacia la izquierda */
    z-index: 3;
    transform: scale(1); /* Escala completa */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  .about-cards.exploded .about-card--4 {
    top: 300px; /* Cuadrante inferior derecho */
    left: 200px; /* Se mueve hacia la derecha */
    z-index: 2;
    transform: scale(1); /* Escala completa */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  /* Efecto hover para indicar interactividad */
  .about-cards:hover .about-card--stack {
    transform: scale(1.02); /* Ligero aumento en hover */
  }

  .about-cards.exploded:hover .about-card--stack {
    transform: scale(1); /* Mantener escala normal cuando está explotado */
  }
}

/* ===== TABLET (768px - 1023px) - STACK CON MENOR OFFSET ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  .about-cards {
    position: absolute;
    top: 320px; /* Posicionado debajo de la tarjeta principal */
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 320px;
    z-index: 10;
  }

  .about-card--stack {
    position: absolute;
    width: 100%;
    max-width: 320px;
    z-index: 1;
  }

  /* Primera tarjeta (fondo) */
  .about-card--1 {
    top: 0;
    z-index: 1;
  }

  /* Segunda tarjeta (medio) */
  .about-card--2 {
    top: -15px; /* Offset menor para tablet */
    z-index: 2;
  }

  /* Tercera tarjeta (medio-frente) */
  .about-card--3 {
    top: -30px; /* Offset menor para tablet */
    z-index: 3;
  }

  /* Cuarta tarjeta (frente) */
  .about-card--4 {
    top: -45px; /* Offset menor para tablet */
    z-index: 4;
  }
}

/* ===== MÓVIL (≤ 767px) - LISTA VERTICAL CON ANIMACIÓN ===== */
@media (max-width: 767px) {
  .about-cards {
    position: relative; /* Contenedor relativo */
    top: 140px; /* Justo debajo de la barra de búsqueda */
    left: 2.5%; /* Alineado a la izquierda de la doctora */
    transform: none;
    width: 80%;
    max-width: 300px;
    height: auto; /* Altura automática basada en contenido */
    min-height: 280px; /* Altura mínima para mostrar parcialmente las tarjetas inferiores (~200px primera + ~80px visibles de las demás) */
    z-index: 10;
    cursor: pointer;
    transition: all 0.5s ease-in-out;
    /* Prevenir scroll y mejorar interacción táctil */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overflow: visible; /* Permitir que las tarjetas parcialmente visibles se muestren */
  }

  .about-card--stack {
    position: absolute; /* Posicionamiento absoluto para stack apilado */
    left: 0; /* Alineado a la izquierda del contenedor */
    width: 100%;
    max-width: 100%;
    margin: 0;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    transform-origin: center center;
    /* Prevenir scroll y mejorar interacción táctil */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }

  /* Stack apilado compacto - solo primera tarjeta visible completamente */
  .about-card--1 {
    top: 0; /* Primera tarjeta completamente visible */
    z-index: 4; /* Z-index más alto para estar al frente */
    opacity: 1; /* Completamente visible */
    visibility: visible;
  }

  /* CRÍTICO: Ocultar completamente las tarjetas 2, 3 y 4 inicialmente en móvil */
  .about-card--2:not(.active),
  .about-card--3:not(.active),
  .about-card--4:not(.active) {
    opacity: 0 !important; /* Ocultar completamente inicialmente - solo visible cuando se expande */
    visibility: hidden !important; /* Ocultar completamente para evitar cualquier visibilidad */
    pointer-events: none !important; /* Sin interactividad cuando está oculta */
    display: none !important; /* Asegurar que no se rendericen en absoluto */
  }

  /* Mantener posicionamiento para cuando se muestren */
  .about-card--2 {
    top: 6px; /* Segunda tarjeta con pequeño desplazamiento vertical */
    z-index: 3;
  }

  .about-card--3 {
    top: 12px; /* Tercera tarjeta con mayor desplazamiento */
    z-index: 2;
  }

  .about-card--4 {
    top: 18px; /* Cuarta tarjeta con mayor desplazamiento */
    z-index: 1; /* Z-index más bajo para estar al fondo */
  }
  
  /* Mostrar todas las tarjetas cuando el visor está activo o cuando se hace clic para expandir */
  #cardViewer.active ~ .about .about-cards .about-card--2,
  #cardViewer.active ~ .about .about-cards .about-card--3,
  #cardViewer.active ~ .about .about-cards .about-card--4,
  body.viewer-open .about-cards .about-card--2,
  body.viewer-open .about-cards .about-card--3,
  body.viewer-open .about-cards .about-card--4,
  .about-cards.exploded .about-card--2,
  .about-cards.exploded .about-card--3,
  .about-cards.exploded .about-card--4,
  .about-cards.mobile-expanded .about-card--2,
  .about-cards.mobile-expanded .about-card--3,
  .about-cards.mobile-expanded .about-card--4,
  .about-card--2.active,
  .about-card--3.active,
  .about-card--4.active,
  /* Asegurar que las tarjetas dentro del visor siempre sean visibles */
  .viewer-track .about-card--stack.about-card--2,
  .viewer-track .about-card--stack.about-card--3,
  .viewer-track .about-card--stack.about-card--4 {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important; /* Restaurar display cuando se muestran */
    pointer-events: auto !important;
  }

  /* Texto interactivo: "Pulsa aquí" (encima de la primera tarjeta) */
  .about-stack-hint {
    position: absolute;
    top: 143px; /* Ajuste fino: bajado 3px adicionales desde 140px para mejor alineación visual */
    left: calc(50% - 19px); /* Desplazado 19px hacia la izquierda (3px adicionales desde -16px) para alineación perfecta con el borde de la tarjeta */
    transform: translateX(-50%);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px; /* 14–16px para legibilidad */
    color: #E63BA8; /* Tono rosa solicitado */
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); /* Sombra mejorada para mejor contraste sobre fondos claros */
    z-index: 6; /* Por encima de las tarjetas apiladas y del fondo */
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    opacity: 0.9;
    white-space: nowrap; /* Evitar salto de línea */
    animation: hintFloat 2s ease-in-out infinite; /* Animación más notoria y constante */
  }

  @keyframes hintFloat {
    0%, 100% {
      transform: translateX(-50%) translateY(0);
      opacity: 0.9;
    }
    50% {
      transform: translateX(-50%) translateY(-6px); /* Amplitud aumentada a -6px para mayor visibilidad */
      opacity: 1;
    }
  }

  /* ===== ANIMACIÓN DE FLOTACIÓN ELEGANTE PARA PILA COMPACTA (MÓVIL) ===== */
  /* Animación más perceptible aplicada a toda la pila como conjunto */
  @keyframes mobileStackFloat {
    0%, 100% {
      transform: translateY(0);
    }
    25% {
      transform: translateY(-7px);
    }
    50% {
      transform: translateY(0);
    }
    75% {
      transform: translateY(-7px);
    }
  }

  /* Aplicar animación elegante a todo el contenedor de la pila */
  .about-cards {
    animation: mobileStackFloat 4s ease-in-out infinite;
  }

  /* Mantener transformaciones individuales pero permitir animación del contenedor */
  .about-card--stack {
    will-change: transform;
  }

  /* ===== ANIMACIÓN MÓVIL - EXPANSIÓN VERTICAL CENTRADA ===== */
  
  /* Estado de expansión móvil */
  .about-cards.mobile-expanded {
    /* El contenedor mantiene su posición base */
  }

  /* Tarjeta destacada (centrada y agrandada) - Sistema legacy (no usado en visor móvil) */
  /* NOTA: Este sistema está siendo reemplazado por about-card-viewer */
  .about-cards.mobile-expanded .about-card--stack.active {
    position: fixed !important; /* Cambiar a fixed para centrar en viewport */
    top: 50% !important; /* Centrado vertical dinámico del viewport */
    left: 50% !important; /* Centrado horizontal */
    transform: translate(-50%, -50%) scale(1.05) !important; /* Centrado perfecto vertical y horizontal con escala */
    z-index: 100; /* Z-index alto para estar al frente */
    width: 90%; /* Ancho aumentado */
    max-width: 350px; /* Ancho máximo aumentado */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); /* Sombra más pronunciada */
    opacity: 1; /* Completamente visible */
    pointer-events: auto; /* Mantener interactividad */
    margin: 0 !important;
    padding: 30px 25px !important;
  }

  /* Tarjetas no destacadas (ocultas) */
  .about-cards.mobile-expanded .about-card--stack:not(.active) {
    opacity: 0; /* Ocultas */
    pointer-events: none; /* Sin interactividad */
    z-index: 1; /* Z-index bajo */
  }

  /* Efecto hover para indicar interactividad - pausar animación y elevar toda la pila */
  .about-cards:hover {
    animation-play-state: paused;
    transform: translateY(-4px) !important; /* Elevar toda la pila en hover, proporcional a la animación */
  }

  /* Efecto hover individual en cada tarjeta - destacar la tarjeta sobre la que se hace hover */
  .about-card--stack:hover {
    z-index: 5 !important; /* Elevar la tarjeta hover al frente */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(255, 105, 180, 0.18);
  }

  /* Evitar hover cuando está expandida */
  .about-cards.mobile-expanded .about-card--stack.active:hover {
    transform: translate(-50%, -50%) scale(1.05); /* Mantener transformación de expansión */
  }

  /* Pausar animación de flotación cuando se expande */
  .about-cards.mobile-expanded {
    animation-play-state: paused;
  }
}

/* Responsive para múltiples tarjetas */
@media (max-width: 768px) {
  .about-card-container {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 15px;
  }
  
  /* Esta regla se eliminó porque estaba sobrescribiendo position: absolute con static */
  /* .about-card {
    width: 90%;
    max-width: 320px;
    position: static;
    margin: 0 auto;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 2.5px solid #d0d0d0 !important;
    border-left: 2.5px solid #d0d0d0 !important;
    border-right: 2.5px solid #d0d0d0 !important;
    border-bottom: 2.5px solid #d0d0d0 !important;
  } */
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efecto de brillo sutil en hover */
.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.about-card:hover::before {
  opacity: 1;
}

/* Asegurar que el contenido esté por encima del efecto de brillo */
.about-card h3,
.about-card p {
  position: relative;
  z-index: 2;
}

/* Efecto de pulso sutil en el título */
.about-card h3 {
  position: relative;
}

.about-card h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #c4308b, #ff66c4);
  transition: width 0.3s ease;
}

.about-card:hover h3::after {
  width: 100%;
}

.decorative-search-bar:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  /* El transform se maneja en el media query de escritorio */
}

.search-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.search-icon {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.decorative-search-bar:hover .search-icon {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

/* Media queries para la barra de búsqueda en móviles */
@media (max-width: 768px) {
  .decorative-search-bar {
    width: 90%; /* Adaptarse al ancho de pantalla con máximo 90% */
    max-width: 500px; /* Mantener el ancho máximo de escritorio */
    height: 50px; /* Mantener la misma altura que en escritorio */
    top: 80px; /* Misma posición vertical que en escritorio */
    left: 50%; /* Centrar horizontalmente */
    transform: translateX(-50%); /* Centrado horizontal perfecto */
    padding: 0 20px; /* Mismo padding que en escritorio */
    z-index: 15; /* Asegurar que esté por encima de la imagen */
    /* Prevenir movimiento al enfocarse */
    position: fixed; /* Cambiar de absolute a fixed para mayor estabilidad */
    box-sizing: border-box; /* Asegurar que el padding no afecte el ancho */
    transition: all 0.3s ease; /* Transición suave para animaciones */
  }
  
  /* Tarjeta responsive para móviles */
  .about-card {
    top: 180px; /* Ajuste final: 40px más arriba para balance visual perfecto */
    left: 10%; /* Microajuste: 2% más a la izquierda para balance lateral perfecto */
    width: 65%; /* Ancho reducido para composición más ligera y elegante */
    max-width: 320px; /* Ancho máximo aumentado */
    padding: 14px 20px 20px 20px; /* Padding ajustado para el nuevo ancho */
    transform: scale(0.95); /* Escala ligeramente aumentada */
  }
  
  .card-header {
    gap: 10px; /* Gap ajustado para móvil */
    margin-bottom: 20px; /* Espacio más amplio para separación */
    margin-top: 0.6rem; /* Margen superior mínimo para móvil */
  }
  
  .card-icon {
    width: 28px; /* Ícono ajustado para móvil */
    height: 28px;
  }
  
  .about-card h3 {
    font-size: 1rem; /* Tamaño reducido para evitar desbordamiento */
    margin: 0;
    letter-spacing: 0.1px; /* Letter-spacing reducido para móvil */
    white-space: normal; /* Permitir salto de línea automático */
    text-align: center; /* Centrar el texto horizontalmente */
    line-height: 1.2; /* Line-height ajustado para múltiples líneas */
  }
  
  .about-card p {
    font-size: 0.9rem; /* Tamaño ligeramente menor para móvil */
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word; /* Asegurar que las palabras largas se rompan */
    overflow-wrap: break-word; /* Alternativa moderna para word-wrap */
    hyphens: auto; /* Permitir guiones automáticos en palabras largas */
  }
  
  /* Ajustes específicos para tarjetas 2, 3 y 4 en móvil - aumentar tamaños y centrado */
  .about-card--2,
  .about-card--3,
  .about-card--4 {
    display: flex; /* Usar flexbox para centrado vertical */
    flex-direction: column; /* Columna para layout vertical */
    justify-content: flex-start; /* Mantener header arriba */
    align-items: center; /* Centrar horizontalmente todos los elementos */
  }
  
  /* Aumentar tamaño del ícono en tarjetas 2, 3 y 4 */
  .about-card--2 .card-icon,
  .about-card--3 .card-icon,
  .about-card--4 .card-icon {
    width: 36px; /* Aumentado de 28px a 36px (~28% más grande) */
    height: 36px; /* Aumentado de 28px a 36px (~28% más grande) */
  }
  
  /* Aumentar tamaño del título en tarjetas 2, 3 y 4 */
  .about-card--2 h3,
  .about-card--3 h3,
  .about-card--4 h3 {
    font-size: 1.25rem; /* Aumentado de 1rem a 1.25rem (25% más grande) */
  }
  
  /* Asegurar que el header mantenga su layout original */
  .about-card--2 .card-header,
  .about-card--3 .card-header,
  .about-card--4 .card-header {
    width: 100%; /* Ocupar todo el ancho para mantener alineación del ícono y título */
    align-self: flex-start; /* Mantener header alineado a la izquierda */
    margin-bottom: 40px; /* Separación clara y amplia del título */
    flex-shrink: 0; /* Evitar que el header se comprima */
  }
  
  /* Logotipo CILAD grande, protagonista y perfectamente centrado en tarjetas 2, 3 y 4 */
  .about-card--2 .cilad-img,
  .about-card--3 .cilad-img,
  .about-card--4 .cilad-img {
    transform: scale(2.0); /* Aumentar 100% el tamaño (2x) para ocupar casi todo el espacio */
    max-width: 85%; /* Ocupar casi todo el ancho disponible sin tocar bordes */
    width: auto;
    height: auto;
    margin-top: auto; /* Empujar hacia abajo para centrado vertical */
    margin-bottom: auto; /* Empujar hacia arriba para centrado vertical */
    object-fit: contain; /* Mantener proporciones */
    flex-shrink: 0; /* No permitir que se comprima */
  }
}
  
  /* Estilos de foco para móviles - sin cambios de posición */
  .decorative-search-bar:focus,
  .decorative-search-bar:focus-within {
    transform: translateX(-50%); /* Mantener centrado al enfocarse */
    width: 90%; /* Mantener ancho fijo */
    max-width: 500px; /* Mantener ancho máximo */
    padding: 0 20px; /* Mantener padding fijo */
    /* Animación sutil de brillo */
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.2),
      0 0 0 2px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.3); /* Ligeramente más opaco al enfocarse */
  }
  
  .search-text {
    font-size: 1rem; /* Mismo tamaño que en escritorio */
    letter-spacing: 0.5px; /* Mismo espaciado que en escritorio */
    /* Prevenir zoom en Safari/Chrome */
    font-size: 16px; /* Tamaño mínimo para evitar zoom automático */
  }
  
  .search-icon {
    font-size: 1.2rem; /* Mismo tamaño que en escritorio */
    transition: all 0.3s ease; /* Transición suave */
  }
  
  /* Animación del ícono al enfocarse */
  .decorative-search-bar:focus .search-icon,
  .decorative-search-bar:focus-within .search-icon {
    transform: scale(1.1);
    color: rgba(255, 255, 255, 1);
  }
}

@media (max-width: 480px) {
  .decorative-search-bar {
    width: 90%; /* Adaptarse al ancho de pantalla con máximo 90% */
    max-width: 400px; /* Ancho máximo ligeramente menor para pantallas muy pequeñas */
    height: 45px; /* Altura ligeramente menor para pantallas pequeñas */
    top: 80px; /* Misma posición vertical que en escritorio */
    left: 50%; /* Centrar horizontalmente */
    transform: translateX(-50%); /* Centrado horizontal perfecto */
    padding: 0 15px; /* Padding ajustado para pantallas pequeñas */
    z-index: 15; /* Asegurar que esté por encima de la imagen */
    /* Prevenir movimiento al enfocarse */
    position: fixed; /* Cambiar de absolute a fixed para mayor estabilidad */
    box-sizing: border-box; /* Asegurar que el padding no afecte el ancho */
    transition: all 0.3s ease; /* Transición suave para animaciones */
  }
  
  /* Tarjeta para pantallas muy pequeñas */
  .about-card {
    width: 60%; /* Ancho reducido para composición más ligera y elegante */
    max-width: 280px; /* Ancho máximo aumentado */
    padding: 12px 18px 18px 18px; /* Padding ajustado para el nuevo ancho */
    top: 120px; /* Ajuste final: 50px más arriba para balance visual perfecto */
    left: 13%; /* Microajuste: 2% más a la izquierda para balance lateral perfecto */
    transform: scale(0.9); /* Escala ligeramente aumentada */
  }
  
  .card-header {
    gap: 8px; /* Gap ajustado para pantallas pequeñas */
    margin-bottom: 18px; /* Espacio más amplio para separación */
    margin-top: 0.5rem; /* Margen superior mínimo para pantallas pequeñas */
  }
  
  .card-icon {
    width: 26px; /* Ícono ajustado para pantallas pequeñas */
    height: 26px;
  }
  
  .about-card h3 {
    font-size: 0.9rem; /* Tamaño reducido para pantallas pequeñas */
    margin: 0;
    letter-spacing: 0.05px; /* Letter-spacing mínimo para pantallas pequeñas */
    white-space: normal; /* Permitir salto de línea automático */
    text-align: center; /* Centrar el texto horizontalmente */
    line-height: 1.2; /* Line-height ajustado para múltiples líneas */
  }
  
  .about-card p {
    font-size: 0.85rem; /* Tamaño menor para pantallas muy pequeñas */
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word; /* Asegurar que las palabras largas se rompan */
    overflow-wrap: break-word; /* Alternativa moderna para word-wrap */
    hyphens: auto; /* Permitir guiones automáticos en palabras largas */
  }
}
  
  /* Estilos de foco para móviles pequeños - sin cambios de posición */
  .decorative-search-bar:focus,
  .decorative-search-bar:focus-within {
    transform: translateX(-50%); /* Mantener centrado al enfocarse */
    width: 90%; /* Mantener ancho fijo */
    max-width: 400px; /* Mantener ancho máximo */
    padding: 0 15px; /* Mantener padding fijo */
    /* Animación sutil de brillo */
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.2),
      0 0 0 2px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.3); /* Ligeramente más opaco al enfocarse */
  }
  
  .search-text {
    font-size: 0.9rem; /* Tamaño ligeramente menor para pantallas pequeñas */
    letter-spacing: 0.3px; /* Espaciado ajustado */
    /* Prevenir zoom en Safari/Chrome */
    font-size: 16px; /* Tamaño mínimo para evitar zoom automático */
  }
  
  .search-icon {
    font-size: 1.1rem; /* Tamaño ligeramente menor para pantallas pequeñas */
    transition: all 0.3s ease; /* Transición suave */
  }
  
  /* Animación del ícono al enfocarse */
  .decorative-search-bar:focus .search-icon,
  .decorative-search-bar:focus-within .search-icon {
    transform: scale(1.1);
    color: rgba(255, 255, 255, 1);
  }
}


/* Botón outline minimalista */
.btn-outline {
  display: inline-block;
  background: transparent;
  border: 2px solid #c4308b;
  color: #c4308b;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn-outline:hover {
  background: #c4308b;
  color: #fff;
}

/* Botón secundario */
.btn-secondary {
  display: inline-block;
  margin-top: 20px;
  background: #7dd8c8;
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s;
}
.btn-secondary:hover {
  background: #5c5cff;
}

/* Contacto */
#contact {
  background: linear-gradient(135deg, #c4308b 0%, #ff66c4 100%);
  color: white;
  padding: 100px 20px;
  position: relative;
  overflow: hidden;
}

#contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="contact-pattern" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="2" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23contact-pattern)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

#contact h2 {
  color: white;
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  text-align: center;
  width: fit-content;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-contact:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-contact:hover::before {
  left: 100%;
}

.btn-contact.whatsapp {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.1);
}

.btn-contact.whatsapp:hover {
  background: #25D366;
  border-color: #25D366;
}

.btn-contact.instagram {
  border-color: #E4405F;
  background: rgba(228, 64, 95, 0.1);
}

.btn-contact.instagram:hover {
  background: #E4405F;
  border-color: #E4405F;
}

.btn-contact.email {
  border-color: #6c757d;
  background: rgba(108, 117, 125, 0.1);
}

.btn-contact.email:hover {
  background: #6c757d;
  border-color: #6c757d;
}

@media (min-width: 768px) {
  .contact-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 30px;
  }
  
  .btn-contact {
    min-width: 200px;
  }
}

/* ===== ESCRITORIO (≥ 1024px) - SECCIÓN CONTACTO ANCHO COMPLETO ===== */
@media (min-width: 1024px) {
  #contact {
    width: 100vw; /* Ancho completo del viewport */
    max-width: none !important; /* Anular max-width de .section */
    margin: 0 !important; /* Anular margin: auto de .section */
    padding: 100px 20px; /* Mantener padding vertical y horizontal */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
  }

  /* Centrar el contenido interno con un ancho máximo razonable */
  #contact h2,
  #contact .contact-buttons {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- Servicios scroll horizontal pantalla por pantalla ---- */
#services.horizontal-scroll {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

#services h2 {
  text-align: center;
  padding: 40px 0 20px;
  flex-shrink: 0;
  color: #c4308b;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.services-track {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 100px);
  scroll-snap-type: x mandatory;
  overflow-x: hidden;
  position: relative;
  /* Permitir scroll en ambas direcciones y zoom */
  touch-action: manipulation;
  user-select: none;
}

/* Cursor personalizado del dermatoscopio para escritorio */
@media (min-width: 769px) {
  .services-track {
    cursor: url("../assets/dermatoscopio.png") 16 16, pointer;
  }
  
  .services-track:active {
    cursor: url("../assets/dermatoscopio.png") 16 16, pointer;
  }
}

/* Cursor de arrastre solo para móviles */
@media (max-width: 768px) {
  .services-track {
    cursor: grab;
  }
  
  .services-track:active {
    cursor: grabbing;
  }
}

.service-card {
  flex: 0 0 100vw;
  min-height: calc(100vh - 100px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: none;
  position: relative;
  padding: 40px 20px;
  transition: all 0.3s ease;
}

.service-card h3 {
  font-size: 2.2rem;
  color: #c4308b;
  font-weight: 700;
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.antes-despues {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
  max-width: 800px;
  width: 100%;
}

.antes-despues img {
  width: 45%;
  aspect-ratio: 1 / 1;
  border-radius: 15px;
  object-fit: contain;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  border: 3px solid #fff;
  background: #f8f9fa;
}

.antes-despues img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

/* Indicadores de progreso */
.services-track::after {
  content: '';
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #c4308b;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.8;
  animation: bounce 2s infinite;
}

/* Botones de navegación tipo Apple */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4308b;
  opacity: 0.8;
}

.nav-btn:hover {
  transform: translateY(-50%) scale(1.05);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 6px 25px rgba(0, 0, 0, 0.15),
    0 3px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-btn-left {
  left: 30px;
}

.nav-btn-right {
  right: 30px;
}

.nav-btn svg {
  transition: all 0.2s ease;
}

.nav-btn:hover svg {
  transform: scale(1.1);
}

/* Estados de los botones */
.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%) scale(0.9);
}

.nav-btn:disabled:hover {
  transform: translateY(-50%) scale(0.9);
  background: rgba(255, 255, 255, 0.7);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}
/* Ocultar barra de scroll global pero mantener scroll funcional */
html::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}
html {
  overflow-y: scroll;     /* asegura que haya scroll si se necesita */
  scrollbar-width: none;  /* Firefox */
}

/* Asegurar que no aparezcan barras de scroll innecesarias */
.services-track::-webkit-scrollbar {
  display: none;
}

.services-track {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Media Queries para Responsividad */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero {
    min-height: 90vh; /* Altura ligeramente reducida para tablets */
    padding: 70px 30px 50px;
  }
  
  .hero h1 {
    font-size: 3rem; /* Tamaño intermedio */
    color: #fafafa;
  }
  
  .hero p {
    font-size: 1.3rem;
    color: #fafafa;
  }
}

/* Móviles */
@media (max-width: 1023px) {
  .top-info-bar {
    height: 40px;
  }
  
  .top-info-content {
    gap: 15px;
    font-size: 13px; /* Aumentado de 0.8rem a 13px para mejor legibilidad */
    color: #ffffff; /* Blanco puro en móvil también */
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.3); /* Sombra consistente */
    font-family: 'Poppins', sans-serif; /* Misma fuente que el header */
    font-weight: 500; /* Peso medio para móvil */
  }
  
  .location-info {
    opacity: 1; /* Máximo contraste en móvil */
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  }
  
  .time-info {
    color: #ffb6d9; /* Mantener rosado para la hora */
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    font-size: 13px; /* Tamaño consistente */
    font-weight: 600; /* Peso medio-fuerte para la hora */
  }
  
  .weather-info {
    font-size: 12px; /* Aumentado de 0.75rem a 12px */
    opacity: 1; /* Máximo contraste */
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  }
  
  .navbar {
    top: 0; /* Sin espacio superior en móvil */
    padding: 10px 20px;
  }
  
  .navbar nav {
    gap: 20px;
  }
  
  .navbar a {
    font-size: 0.9rem;
  }
  
  .hero {
    padding: 80px 20px 40px; /* Ajustado para navbar integrado */
    text-align: center;
    min-height: 80vh; /* Aumentado para mejor proporción en móvil */
    flex-direction: column;
    justify-content: center;
    gap: 30px;
  }
  
  /* Ajustar el canvas de burbujas para móviles */
  .floating-bubbles-canvas {
    top: 80px; /* Ajustado para navbar integrado */
    height: calc(100% - 80px);
  }
  
  .hero-text {
    max-width: 100%;
    z-index: 3;
    position: relative;
  }
  
  .hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #fafafa;
  }
  
  .hero p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    line-height: 1.5;
    color: #fafafa;
  }
  
  .btn-cta {
    padding: 14px 28px;
    font-size: 1rem;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    display: block;
  }
  
  .hero-illustration {
    margin-top: 30px;
  }
  
  .skin-icon {
    max-width: 300px;
  }
  
  .about-container {
    gap: 40px;
    text-align: center;
  }
  
  .about-text h2 {
    font-size: 2.2rem;
  }
  
  .about-text p {
    text-align: left;
  }
  
  .about-img {
    max-width: 250px;
  }
  
  .service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }
  
  .antes-despues {
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 350px;
  }
  
  .antes-despues img {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
  }
  
  /* Mejorar botones de navegación en móvil */
  .nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .nav-btn-left {
    left: 20px;
  }
  
  .nav-btn-right {
    right: 20px;
  }
  
  .scroll-indicator {
    font-size: 0.8rem;
    bottom: 20px;
  }
  
  /* Optimizar botones de navegación para pantallas pequeñas */
  @media (max-width: 480px) {
    .nav-btn {
      width: 45px;
      height: 45px;
    }
    
    .nav-btn-left {
      left: 15px;
    }
    
    .nav-btn-right {
      right: 15px;
    }
  }
  
  #contact {
    padding: 80px 20px;
  }
  
  #contact h2 {
    font-size: 2.2rem;
    margin-bottom: 30px;
  }
  
  .contact-buttons {
    gap: 15px;
  }
  
  .btn-contact {
    min-width: 200px;
    font-size: 1rem;
    padding: 14px 24px;
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
    color: #fafafa;
  }
  
  .hero p {
    font-size: 1.1rem;
    color: #fafafa;
  }
  
  .about-text h2 {
    font-size: 1.8rem;
  }
  
  .about-text p {
    font-size: 1rem;
  }
  
  .service-card h3 {
    font-size: 1.5rem;
  }
  
  .antes-despues img {
    width: 90%;
    aspect-ratio: 1 / 1;
  }
  
  /* Botones más pequeños en pantallas muy pequeñas */
  .nav-btn {
    width: 40px;
    height: 40px;
  }
  
  .nav-btn svg {
    width: 16px;
    height: 16px;
  }
  
  #contact h2 {
    font-size: 1.8rem;
  }
  
  .btn-contact {
    min-width: 180px;
    padding: 14px 24px;
    font-size: 0.9rem;
  }
  
  /* Optimizaciones adicionales para pantallas muy pequeñas */
  .hero {
    padding: 90px 15px 30px;
    min-height: 75vh;
  }
  
  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.1;
    color: #fafafa;
  }
  
  .hero p {
    font-size: 1rem;
    line-height: 1.4;
    color: #fafafa;
  }
  
  .btn-cta {
    padding: 12px 24px;
    font-size: 0.9rem;
    max-width: 250px;
  }
  
  .section {
    padding: 60px 15px;
  }
  
  .section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }
  
  #contact {
    padding: 60px 15px;
  }
  
  #contact h2 {
    font-size: 1.8rem;
  }
  
  .btn-contact {
    padding: 12px 20px;
    font-size: 0.9rem;
    max-width: 250px;
  }
}

/* Optimizaciones adicionales para mejorar la experiencia móvil */

/* Mejorar el rendimiento de las animaciones en dispositivos con poca potencia */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Optimizar para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero::before,
  .hero::after {
    background-size: 50% 50%;
  }
}

/* Mejorar la legibilidad en pantallas pequeñas */
@media (max-width: 768px) {
  .hero h1 {
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  
  .hero p {
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  }
  
  /* Optimizar el canvas de burbujas para móviles */
  .floating-bubbles-canvas {
    opacity: 0.7; /* Reducir opacidad para mejor rendimiento */
  }
}

/* Mejorar la accesibilidad */
@media (max-width: 768px) {
  .btn-cta:focus,
  .btn-contact:focus,
  .nav-btn:focus {
    outline: 3px solid #c4308b;
    outline-offset: 2px;
  }
  
  /* Mejorar la visibilidad de los botones de navegación */
  .nav-btn {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
  }
  
  .nav-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  }
}

/* ===== DECORATIVE UV GAUGE ===== */
.mini-uv-gauge {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.mini-uv-gauge.visible {
  opacity: 1;
  transform: scale(1);
}

.gauge-container {
  position: relative;
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.gauge-image {
  width: 75px;
  height: 75px;
  object-fit: contain;
  display: block;
  transition: all 0.3s ease;
}

.gauge-needle {
  position: absolute;
  width: 2.5px;
  height: 30px;
  background: #ffffff;
  border-radius: 1.25px;
  top: 22.5px;
  left: 36px;
  transform-origin: bottom center;
  transform: rotate(-90deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* Estados especiales */
.mini-uv-gauge.na .gauge-needle {
  transform: rotate(-90deg);
}

/* Responsive para tabletas */
@media (max-width: 992px) {
  .mini-uv-gauge {
    margin-left: 12px;
  }
  
  .gauge-container {
    width: 60px;
    height: 60px;
  }
  
  .gauge-image {
    width: 60px;
    height: 60px;
  }
  
  .gauge-needle {
    width: 2px;
    height: 24px;
    top: 18px;
    left: 29px;
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .mini-uv-gauge {
    margin-left: 8px;
  }
  
  .gauge-container {
    width: 45px;
    height: 45px;
  }
  
  .gauge-image {
    width: 45px;
    height: 45px;
  }
  
  .gauge-needle {
    width: 2px;
    height: 18px;
    top: 13.5px;
    left: 21.5px;
  }
}

/* Para pantallas muy pequeñas, mantener layout horizontal pero optimizado */
@media (max-width: 480px) {
  .top-info-content {
    flex-direction: row; /* Mantener horizontal */
    align-items: center;
    gap: 6px; /* Reducir gap para ahorrar espacio */
    flex-wrap: nowrap; /* Evitar wrap */
  }
  
  .mini-uv-gauge {
    margin-left: 0;
    margin-top: 0; /* Sin margen superior */
    flex-shrink: 0; /* No permitir que se encoja */
  }
  
  .gauge-container {
    width: 35px;
    height: 35px;
  }
  
  .gauge-image {
    width: 35px;
    height: 35px;
  }
  
  .gauge-needle {
    width: 1.5px;
    height: 14px;
    top: 10.5px;
    left: 16.5px;
  }
}

/* ===== VISOR DE TARJETAS PARA MÓVIL ===== */
/* Solo se activa en dispositivos móviles (max-width: 768px) */
@media (max-width: 768px) {
  /* Contenedor overlay que cubre toda la pantalla */
  .about-card-viewer {
    position: fixed;
    inset: 0; /* Equivale a top: 0; right: 0; bottom: 0; left: 0; */
    width: 100vw;
    height: 100dvh; /* Usar dvh para mejor compatibilidad iOS (dynamic viewport height) */
    min-height: 100dvh;
    max-height: 100dvh;
    /* Fondo con imagen SVG y overlay oscuro para mejor contraste */
    /* Degradado rosado debe comenzar desde el borde izquierdo */
    background: 
      rgba(0, 0, 0, 0.85),
      url('../assets/fondo-tarjeta.svg') no-repeat left center / cover;
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* CRÍTICO: Evitar que bloquee clicks cuando está cerrado */
    transition: all 0.6s ease-in-out;
    overflow: hidden;
    margin: 0;
    padding: 0;
    /* Asegurar que no haya transform o margin que desplace el centrado */
    transform: none;
    box-sizing: border-box;
  }

  /* Estado activo del visor */
  .about-card-viewer.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    /* Fondo con imagen SVG y overlay oscuro para mejor contraste */
    /* Degradado rosado debe comenzar desde el borde izquierdo */
    background: 
      rgba(0, 0, 0, 0.85),
      url('../assets/fondo-tarjeta.svg') no-repeat left center / cover !important;
    z-index: 9999 !important;
    pointer-events: auto !important; /* Permitir interacción cuando está abierto */
  }

  /* Botón de cierre fijo en la esquina superior derecha */
  .close-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .close-viewer:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  .close-viewer:active {
    transform: scale(0.95);
  }

  .close-viewer svg {
    width: 20px;
    height: 20px;
    color: #c4308b;
  }

  /* Contenedor principal del visor */
  .viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Sin padding para que no se vea la tarjeta anterior al deslizar */
    position: relative;
    margin: 0;
    /* Asegurar centrado perfecto sin desplazamientos */
    box-sizing: border-box;
    overflow: hidden; /* Recortar cualquier desborde de los slides */
  }

  /* Track para las tarjetas deslizables */
  .viewer-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    touch-action: pan-y; /* Permitir scroll vertical pero controlar horizontal */
    margin: 0;
    padding: 0;
    /* El track se mueve horizontalmente - viewer-container centra verticalmente */
    align-items: center; /* Centrar verticalmente las tarjetas dentro del track */
    justify-content: flex-start; /* Las tarjetas se alinean horizontalmente según el transform translateX */
    box-sizing: border-box;
  }

  /* Cada slide ocupa el 100% del viewport para que el translateX centre el contenido */
  .viewer-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center; /* CRÍTICO: Mantener centrado vertical para todas las tarjetas */
    justify-content: center;
    box-sizing: border-box;
    padding: 0; /* Sin padding para que el centrado sea exacto */
    overflow: hidden; /* Evitar que se vea contenido lateral (sombra/bordes) del slide vecino */
    /* CRÍTICO: Asegurar que no haya ajustes verticales automáticos */
    flex-direction: column;
  }

  /* Tarjetas dentro del visor */
  .viewer-track .about-card--stack {
    position: relative !important;
    width: 90% !important; /* La tarjeta es más angosta que el slide y queda centrada */
    max-width: 350px !important;
    min-width: 280px !important;
    height: auto;
    max-height: calc(100dvh - 100px); /* Dejar espacio para botón de cerrar y padding (48px botón + 52px margen) */
    margin: 0 auto !important; /* Centrado horizontal automático */
    padding: 30px 25px !important;
    background: linear-gradient(145deg, #ffffff 0%, #fff0f7 100%) !important;
    border-radius: 25px;
    box-shadow: 
      0 20px 40px rgba(0, 0, 0, 0.3),
      0 8px 20px rgba(255, 105, 180, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    /* CRÍTICO: Fijar eje Y en 0 para evitar desalineaciones verticales durante swipe */
    transform: translate3d(0, 0, 0) scale(0.9);
    opacity: 0.7;
    transition: all 0.6s ease-in-out;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    overflow-y: auto; /* Permitir scroll interno si el contenido es muy largo */
    overflow-x: hidden;
    /* Asegurar que no haya margin o padding que desplace */
    box-sizing: border-box;
    /* Evitar que transformaciones del padre afecten el centrado */
    flex-shrink: 0;
    visibility: visible !important;
    /* Asegurar que sea visible */
    z-index: 1;
    /* CRÍTICO: Asegurar alineación vertical fija */
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  /* Tarjeta activa (centrada) */
  .viewer-track .about-card--stack.active {
    /* CRÍTICO: Fijar eje Y en 0 y solo aplicar scale para mantener alineación vertical */
    transform: translate3d(0, 0, 0) scale(1) !important;
    opacity: 1 !important;
    box-shadow: 
      0 25px 50px rgba(0, 0, 0, 0.4),
      0 12px 25px rgba(255, 105, 180, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    /* Asegurar que no haya reglas que sobrescriban el centrado */
    position: relative !important;
    margin: 0 auto !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    /* Prevenir sobrescritura de reglas del sistema mobile-expanded */
    width: 90% !important;
    max-width: 350px !important;
  }

  /* Header de la tarjeta en el visor */
  /* CRITICO: Aplicar column solo a tarjetas que NO sean CILAD (2, 3, 4) */
  .viewer-track .about-card--stack:not(.about-card--2):not(.about-card--3):not(.about-card--4) .card-header {
    display: flex !important;
    margin-bottom: 30px;
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  
  /* Regla general como fallback (será sobrescrita por reglas específicas) */
  .viewer-track .card-header {
    display: flex !important;
    margin-bottom: 30px;
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }

  /* EXCEPCIÓN: Tarjetas con logo CILAD (2, 3, 4) en visor móvil mantienen estructura de escritorio */
  /* CRITICO: Estas reglas deben tener mayor especificidad y todas las propiedades necesarias */
  .viewer-track .about-card--stack.about-card--2 .card-header,
  .viewer-track .about-card--stack.about-card--3 .card-header,
  .viewer-track .about-card--stack.about-card--4 .card-header {
    display: flex !important;
    flex-direction: row !important; /* Icono y título en la misma fila */
    flex-wrap: nowrap !important; /* Asegurar que no se envuelvan */
    align-items: center !important;
    align-content: center !important;
    gap: 0.5rem !important;
    justify-content: flex-start !important;
    margin-bottom: 2rem !important; /* Aumentado de 0 a 2rem para más separación del logotipo */
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Regla complementaria para reforzar flex-direction: row en visor móvil con :has() */
  .viewer-track .about-card--stack.about-card--2:has(img.cilad-img) .card-header,
  .viewer-track .about-card--stack.about-card--3:has(img.cilad-img) .card-header,
  .viewer-track .about-card--stack.about-card--4:has(img.cilad-img) .card-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 2rem !important; /* Aumentado para más separación del logotipo */
  }
  
  /* REGLA ULTRA-ESPECÍFICA: Incluir .viewer-slide para máxima especificidad */
  .viewer-track .viewer-slide .about-card--stack.about-card--2 .card-header,
  .viewer-track .viewer-slide .about-card--stack.about-card--3 .card-header,
  .viewer-track .viewer-slide .about-card--stack.about-card--4 .card-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 2rem !important; /* Aumentado para más separación del logotipo */
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* REGLA MÁXIMA ESPECIFICIDAD: Combinar todos los selectores posibles */
  .viewer-track .viewer-slide .about-card--stack.about-card--2:has(img.cilad-img) .card-header,
  .viewer-track .viewer-slide .about-card--stack.about-card--3:has(img.cilad-img) .card-header,
  .viewer-track .viewer-slide .about-card--stack.about-card--4:has(img.cilad-img) .card-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 2rem !important; /* Aumentado para más separación del logotipo */
  }

  .viewer-track .card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }

  .viewer-track h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #c4308b;
    margin: 0;
    line-height: 1.3;
    text-align: center;
  }

  .viewer-track p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
    margin: 0;
    text-align: center;
    max-width: 90%;
  }

  /* EXCEPCIÓN: Tarjetas con logo CILAD (2, 3, 4) en visor móvil mantienen estructura de escritorio */
  .viewer-track .about-card--stack.about-card--2,
  .viewer-track .about-card--stack.about-card--3,
  .viewer-track .about-card--stack.about-card--4 {
    align-items: flex-start !important; /* No centrar todo el contenido */
    text-align: left !important;
  }

  .viewer-track .about-card--stack.about-card--2 .card-icon,
  .viewer-track .about-card--stack.about-card--3 .card-icon,
  .viewer-track .about-card--stack.about-card--4 .card-icon {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important; /* No centrar */
  }

  .viewer-track .about-card--stack.about-card--2 h3,
  .viewer-track .about-card--stack.about-card--3 h3,
  .viewer-track .about-card--stack.about-card--4 h3 {
    font-size: 1.2rem !important;
    text-align: left !important; /* No centrar */
    margin: 0 !important;
  }

  .viewer-track .about-card--stack.about-card--2 img.cilad-img,
  .viewer-track .about-card--stack.about-card--3 img.cilad-img,
  .viewer-track .about-card--stack.about-card--4 img.cilad-img {
    width: 70% !important;
    margin-top: 2.5rem !important; /* Aumentado de 0.8rem a 2.5rem para más separación del título */
    margin-bottom: auto !important; /* Empujar hacia abajo para centrado vertical */
    margin-left: auto !important;
    margin-right: auto !important;
    align-self: center !important; /* Centrado horizontalmente */
  }

  /* Indicadores de navegación */
  .viewer-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10001;
  }

  .viewer-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
  }

  .viewer-indicator.active {
    background: #c4308b;
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(196, 48, 139, 0.5);
  }

  .viewer-indicator:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
  }

  /* Prevenir scroll del body cuando el visor está activo */
  body.viewer-open {
    overflow: hidden !important;
    height: 100% !important;
    /* No usar position: fixed para evitar scroll hacia arriba */
  }
  
  /* Prevenir scroll en las tarjetas individuales */
  .about-card--stack {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Prevenir cualquier comportamiento de scroll */
    scroll-behavior: auto;
    /* Asegurar que no haya enlaces o elementos que causen scroll */
    pointer-events: auto;
    /* Prevenir zoom en doble tap */
    touch-action: manipulation;
  }
  
  /* Prevenir que los elementos dentro de las tarjetas causen scroll */
  .about-card--stack * {
    pointer-events: none;
  }
  
  /* Restaurar pointer-events solo para elementos interactivos necesarios */
  .about-card--stack img,
  .about-card--stack h3,
  .about-card--stack p {
    pointer-events: none;
  }

  /* Animación de entrada de las tarjetas */
  .viewer-track .about-card--stack {
    animation: cardViewerSlideIn 0.6s ease-out;
  }

  @keyframes cardViewerSlideIn {
    from {
      opacity: 0;
      /* CRÍTICO: Usar translate3d para mantener eje Y en 0, solo animar opacity y scale */
      transform: translate3d(0, 0, 0) scale(0.8);
    }
    to {
      opacity: 0.7;
      /* CRÍTICO: Mantener translateY en 0 para alineación vertical perfecta */
      transform: translate3d(0, 0, 0) scale(0.9);
    }
  }

  /* Animación de la tarjeta activa */
  .viewer-track .about-card--stack.active {
    animation: cardViewerActivate 0.6s ease-out;
  }

  @keyframes cardViewerActivate {
    from {
      opacity: 0.7;
      /* CRÍTICO: Mantener translateY en 0 durante la animación */
      transform: translate3d(0, 0, 0) scale(0.9);
    }
    to {
      opacity: 1;
      /* CRÍTICO: Solo aplicar scale, mantener translateY en 0 */
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  /* Efectos de deslizamiento suave */
  .viewer-track.smooth-transition {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Mejoras de accesibilidad */
  .about-card-viewer:focus-within {
    outline: none;
  }

  .close-viewer:focus {
    outline: 3px solid #c4308b;
    outline-offset: 2px;
  }

  .viewer-indicator:focus {
    outline: 2px solid #c4308b;
    outline-offset: 2px;
  }
}

/* Ocultar el visor en escritorio y tablet */
@media (min-width: 769px) {
  .about-card-viewer {
    display: none !important;
  }
}
}