/* ============================================================ */
/* COMPONENTES — Voy Salud x Mr. Kine                            */
/* Estilo: clínica top chilena. SIN gradientes, SIN animaciones, */
/* SIN glassmorphism. Bordes sólidos, fondos planos, alta densidad */
/* ============================================================ */

/* ============================================================ */
/* TOP BAR (barra superior con teléfonos y portal)               */
/* ============================================================ */

.topbar {
  background: var(--color-neutral-900);
  color: var(--color-neutral-300);
  font-size: var(--text-xs);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
}

.topbar-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-neutral-300);
  white-space: nowrap;
  font-weight: var(--weight-medium);
}

.topbar-item:hover {
  color: var(--color-white);
  text-decoration: none;
}

.topbar-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.topbar-portal {
  background: var(--color-primary-700);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-portal:hover {
  background: var(--color-primary-600);
  color: var(--color-white);
  text-decoration: none;
}

.topbar-social {
  display: flex;
  gap: var(--space-3);
}

.topbar-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--color-neutral-400);
}

.topbar-social a:hover {
  color: var(--color-white);
}

.topbar-social svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .topbar { display: none; }
}

/* ============================================================ */
/* HEADER PRINCIPAL                                              */
/* ============================================================ */

.header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-neutral-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 56px;
  width: auto;
}

.header-nav {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  height: 100%;
}

.header-nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-neutral-800);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  height: 100%;
  border-bottom: 3px solid transparent;
  margin-top: 3px;
  transition: color var(--transition), border-color var(--transition);
}

.header-nav-link:hover {
  color: var(--color-primary-700);
  text-decoration: none;
  border-bottom-color: var(--color-primary-600);
}

.header-nav-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .header-nav { display: flex; }
}

/* ============================================================ */
/* MEGAMENÚ (dropdown al hover)                                  */
/* ============================================================ */

.megamenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; /* alineado al borde izquierdo de su ítem; nunca centrado (se salía de la pantalla) */
  margin-top: 6px;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  background: var(--color-white);
  border: 1px solid var(--color-neutral-200);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 40, 70, 0.12);
  padding: var(--space-2);
  z-index: 99;
}

/* Puente invisible: el cursor no pierde el hover al cruzar el espacio entre ítem y panel */
.megamenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

.header-nav-item:hover .megamenu,
.header-nav-item:focus-within .megamenu {
  display: block;
}

.megamenu ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.megamenu li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-neutral-800);
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.megamenu li a:hover,
.megamenu li a:focus-visible {
  background: var(--color-primary-50);
  color: var(--color-primary-900);
  text-decoration: none;
}

/* Especialidades: lista de áreas del directorio en 2 columnas, compacta */
.megamenu-wide {
  width: 540px;
}

.megamenu-wide ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-1);
}

.megamenu-wide li a {
  line-height: 1.25;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ============================================================ */
/* HAMBURGER MOBILE                                              */
/* ============================================================ */

.header-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  cursor: pointer;
}

.header-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-neutral-900);
  transition: all var(--transition);
}

.header-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 1024px) {
  .header-hamburger { display: none; }
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: var(--color-white);
  z-index: 99;
  padding: var(--space-6);
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-neutral-900);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-neutral-100);
}

.nav-mobile a:hover {
  color: var(--color-primary-700);
  text-decoration: none;
}

@media (min-width: 1024px) {
  .nav-mobile { display: none !important; }
}

/* ============================================================ */
/* HERO CARRUSEL                                                 */
/* ============================================================ */

.hero {
  position: relative;
  background: var(--color-neutral-900);
  overflow: hidden;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 480px;
}

@media (max-width: 768px) {
  .hero-carousel { height: 420px; }
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease-in-out;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 63, 92, 0.85) 0%, rgba(20, 63, 92, 0.55) 60%, rgba(20, 63, 92, 0.25) 100%);
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  color: var(--color-white);
}

.hero-slide-inner {
  max-width: 600px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-100);
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-left: 3px solid var(--color-primary-100);
  padding-left: var(--space-3);
}

.hero-slide h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .hero-slide h1 { font-size: var(--text-3xl); }
}

.hero-slide p {
  font-size: var(--text-md);
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--space-6);
  max-width: 500px;
}

.hero-slide-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Controles del carrusel */
.hero-dots {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: var(--space-2);
}

.hero-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background var(--transition);
}

.hero-dot.active {
  background: var(--color-white);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-white);
  transition: background var(--transition);
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.5);
}

.hero-arrow-prev { left: var(--space-4); }
.hero-arrow-next { right: var(--space-4); }

.hero-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

@media (max-width: 768px) {
  .hero-arrow { display: none; }
}

/* ============================================================ */
/* EQUIPO MÉDICO                                                 */
/* ============================================================ */

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .doctor-grid { grid-template-columns: repeat(4, 1fr); }
}

.doctor-card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-200);
  overflow: hidden;
  transition: border-color var(--transition);
}

.doctor-card:hover {
  border-color: var(--color-primary-600);
}

.doctor-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-neutral-100);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doctor-photo-placeholder svg {
  width: 48px;
  height: 48px;
  stroke: var(--color-neutral-400);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doctor-body {
  padding: var(--space-4);
}

.doctor-body h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-neutral-900);
  margin: 0 0 var(--space-1);
  line-height: 1.3;
}

.doctor-specialty {
  font-size: var(--text-xs);
  color: var(--color-primary-700);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.doctor-link {
  font-size: var(--text-xs);
  color: var(--color-primary-700);
  font-weight: var(--weight-semibold);
}

.doctor-link:hover {
  text-decoration: underline;
}

/* ============================================================ */
/* BANNER PORTAL PACIENTE                                        */
/* ============================================================ */

.portal-banner {
  background: var(--color-primary-700);
  color: var(--color-white);
  padding: var(--space-12) 0;
}

.portal-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 768px) {
  .portal-banner-inner {
    grid-template-columns: 1fr auto;
  }
}

.portal-banner h2 {
  color: var(--color-white);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.portal-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-md);
  margin: 0;
}

.portal-banner .btn {
  background: var(--color-white);
  color: var(--color-primary-900);
  border: none;
}

.portal-banner .btn:hover {
  background: var(--color-neutral-100);
}

/* ============================================================ */
/* BLOG / NOTICIAS                                               */
/* ============================================================ */

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-200);
  display: flex;
  flex-direction: column;
}

.blog-card-image {
  width: 100%;
  height: 200px;
  background: var(--color-neutral-100);
  background-size: cover;
  background-position: center;
}

.blog-card-body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  font-size: var(--text-xs);
  color: var(--color-neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
  font-weight: var(--weight-medium);
}

.blog-card h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.blog-card p {
  font-size: var(--text-sm);
  color: var(--color-neutral-600);
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--space-4);
}

.blog-card-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary-700);
}

/* ============================================================ */
/* CONVENIOS (opción A, Felipe 23-nov): logos sueltos en tarjetas */
/* iguales a las de Especialidades; filas centradas y simétricas  */
/* ============================================================ */

.conv {
  scroll-margin-top: 96px; /* queda bajo el encabezado fijo al llegar desde el menú */
  background: var(--color-neutral-50);
  border-top: 1px solid var(--color-neutral-200);
  border-bottom: 1px solid var(--color-neutral-200);
}

.conv-kicker {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary-600);
}

.conv h2 { font-size: 24px; margin: 0; color: var(--color-primary-900); }

.conv-bajada {
  margin: 8px 0 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-neutral-600);
}

.conv-grupo { margin-top: 28px; }

.conv-grupo h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-primary-900);
}

.conv-prev, .conv-ali { list-style: none; margin: 0; padding: 0; }

/* Previsión: flex centrado con ancho fijo por columna, así la última fila incompleta queda al medio */
.conv-prev {
  --conv-cols: 7;
  --conv-gap: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--conv-gap);
}

.conv-logo, .conv-tarj {
  background: var(--color-white);
  border: 1px solid rgba(43, 115, 160, .16);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 63, 92, .05), 0 6px 18px rgba(20, 63, 92, .06);
}

.conv-logo {
  flex: 0 0 calc((100% - (var(--conv-cols) - 1) * var(--conv-gap)) / var(--conv-cols));
  display: grid;
  place-items: center;
  height: 104px;
  padding: 16px 14px;
}

.conv-logo img { width: auto; height: auto; max-width: 100%; max-height: 48px; object-fit: contain; }
.conv-logo img.conv-medio { max-height: 58px; }

.conv-ali {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.conv-tarj {
  display: grid;
  grid-template-columns: 176px 1fr;
  align-items: center;
  gap: 18px;
  height: 104px;
  padding: 12px 18px;
}

.conv-tarj img { width: auto; height: auto; max-width: 100%; max-height: 56px; justify-self: center; object-fit: contain; }
.conv-tarj img.conv-alto { max-height: 76px; }

.conv-ali-txt { font-size: 14px; line-height: 1.4; color: var(--color-neutral-600); overflow: hidden; max-height: 80px; }

.conv-nota { margin: 28px 0 0; font-size: 14px; color: var(--color-neutral-600); }
.conv-nota strong { color: var(--color-primary-900); }

@media (max-width: 1100px) {
  .conv-prev { --conv-cols: 4; }
  .conv-ali { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .conv-prev { --conv-cols: 2; --conv-gap: 10px; }
  .conv-logo { height: 88px; padding: 12px; }
  .conv-logo img { max-height: 42px; }
  .conv-logo img.conv-medio { max-height: 52px; }
  .conv-tarj { grid-template-columns: 128px 1fr; gap: 14px; height: 92px; }
  .conv-tarj img.conv-alto { max-height: 68px; }
}

/* ============================================================ */
/* MAPA Y UBICACIÓN                                             */
/* ============================================================ */

.location {
  background: var(--color-white);
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .location-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-10);
  }
}

.location-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.location-info h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-3);
}

.location-detail {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.location-detail-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.location-detail-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-primary-700);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.location-detail-text {
  flex: 1;
}

.location-detail-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-neutral-600);
  margin-bottom: var(--space-1);
}

.location-detail-text p,
.location-detail-text a {
  font-size: var(--text-sm);
  color: var(--color-neutral-800);
  line-height: 1.5;
  margin: 0;
}

.location-detail-text a {
  color: var(--color-primary-700);
}

.location-map {
  width: 100%;
  height: 360px;
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-200);
  overflow: hidden;
}

.location-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================ */
/* FOOTER                                                        */
/* ============================================================ */

.footer {
  background: var(--color-neutral-900);
  color: var(--color-neutral-400);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; }
}

.footer-brand .footer-logo-plate {
  display: inline-block;
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  margin-bottom: var(--space-4);
  line-height: 0;
}

.footer-brand .footer-logo-plate img {
  height: 52px;
  width: auto;
  display: block;
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-neutral-400);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.footer-social a:hover {
  background: var(--color-primary-600);
  color: var(--color-white);
}

.footer-social svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-col a,
.footer-col li {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  line-height: 1.5;
}

.footer-col a:hover {
  color: var(--color-white);
  text-decoration: none;
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-neutral-500);
}

.footer-bottom a {
  color: var(--color-neutral-400);
}

.footer-bottom a:hover {
  color: var(--color-white);
  text-decoration: none;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-credit a {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  opacity: 0.85;
}

.footer-credit a:hover { opacity: 1; }

.footer-credit img {
  height: 18px;
  width: auto;
  display: block;
}

/* Exámenes: 9 ítems en 2 columnas (cabe en 1024 px) */
.megamenu-2 {
  width: 440px;
}

.megamenu-2 ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-1);
}

/* El botón flotante de Rosita no debe tapar el crédito de LUMNIA al final de la página */
@media (min-width: 768px) {
  .footer-bottom { padding-bottom: 84px; }
}
