/* =========================================================
   SMIPAT — hoja de estilos
   Paleta tomada de la identidad existente (logo + sitio Anvil)
   ========================================================= */

:root {
  --purple-deep: #4d378a;
  --purple: #5c43a8;
  --purple-soft: #8a72c4;
  --pink: #c23e8f;
  --pink-soft: #e2a9cd;
  --teal: #4e8a95;
  --ink: #241a38;
  --ink-soft: #5c5468;
  --paper: #ffffff;
  --lavender: #faf6fb;
  --lavender-line: #e9ddef;
  --whatsapp: #25d366;

  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Lora", Georgia, serif;
  --font-ui: "Poppins", "Segoe UI", sans-serif;
  --font-nav: "Kanit", "Segoe UI", sans-serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-card: 0 6px 24px rgba(74, 47, 130, 0.10);
  --shadow-pop: 0 12px 40px rgba(61, 42, 107, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
h1, h2, h3, h4, .ui {
  font-family: var(--font-display);
  margin: 0;
}
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
main > section[hidden] { display: none; }

/* ---------- Iconos de línea reutilizables (reemplazan emojis) ---------- */
svg.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--lavender-line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.brand .brand-mark { height: 58px; width: auto; max-width: none; object-fit: contain; display: block; }

.main-nav { display: flex; align-items: center; gap: 6px; font-family: var(--font-nav); }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.main-nav > ul > li { position: relative; }
.main-nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--pink);
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a.nav-link:hover,
.main-nav a.nav-link.is-current {
  background: var(--lavender);
  color: var(--purple-deep);
}

.search-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
  display: grid;
  place-items: center;
  margin-left: 6px;
}
.search-btn svg.icon { width: 18px; height: 18px; }
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--lavender);
  color: var(--purple-deep);
}
.nav-toggle svg.icon { width: 20px; height: 20px; }

/* ---------- Secciones genéricas ---------- */
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--muted { background: var(--lavender); }
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 0.8rem;
  margin-bottom: 10px;
  display: block;
}
.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  color: var(--purple-deep);
  margin-bottom: 14px;
}
.section-lead {
  max-width: 100%;
  color: var(--ink-soft);
  font-size: 1.05rem;
  text-align: justify;
  text-justify: inter-word;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: stretch;
}
/* <picture> es solo un envoltorio para servir WebP: no debe afectar el layout,
   así que se vuelve "transparente" y todas las reglas que apuntan a <img>
   (aquí y en el resto del sitio) siguen aplicando igual. El <source> oculto
   sigue funcionando para elegir el WebP (la selección no depende del CSS). */
picture { display: contents; }
picture > source { display: none; }
.two-col img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.two-col img.stretch-photo { aspect-ratio: auto; height: 100%; border-radius: 0; }

/* SMIred: la foto de la derecha ocupa exactamente el ancho de su columna y
   la MISMA altura que el bloque de texto de al lado — ni más ni menos. Para
   eso el <picture> hace de marco (se estira con la fila) y la <img> lo
   rellena en absoluto, sin aportar su propia altura. */
#red .two-col > .section-lead { margin: 0; }
#red .two-col > picture {
  display: block;
  position: relative;
  overflow: hidden;
  min-width: 0;
  align-self: stretch;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
#red .two-col img.red-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  box-shadow: none;
}
.photo-frame { position: relative; overflow: hidden; }
.photo-frame img.stretch-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-grid { grid-template-columns: 1fr 1.8fr; }
.quality-policy-grid { grid-template-columns: 1.8fr 1fr; }
.intro-card {
  background: var(--paper);
  border-left: 4px solid var(--pink);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
}
.intro-card p:last-child { margin-bottom: 0; }

/* ---------- Inicio: hero + carrusel ---------- */
.section--hero { padding-top: 48px; }
.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.hero-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-title {
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  color: var(--purple-deep);
  margin: 8px 0 16px;
}
.hero-lead { color: var(--ink-soft); font-size: 1.05rem; max-width: 560px; margin-left: auto; margin-right: auto; text-align: justify; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 24px; }
.btn-primary, .btn-secondary {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 24px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: var(--purple-deep); }
.btn-secondary { background: var(--lavender); color: var(--purple-deep); border: 1px solid var(--lavender-line); }
.btn-secondary:hover { background: var(--pink-soft); color: var(--purple-deep); }

.hero-carousel {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  aspect-ratio: 21 / 7;
  background: var(--lavender);
}
.carousel-track { position: relative; width: 100%; height: 100%; }
.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
}
.carousel-slide.is-active { opacity: 1; visibility: visible; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
}
.carousel-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--purple-deep);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.carousel-cta:hover { transform: translateY(-2px); background: var(--lavender); }
.carousel-cta svg.icon { width: 14px; height: 14px; transform: rotate(-90deg); }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--purple-deep);
  display: grid;
  place-items: center;
}
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel-arrow svg.icon { width: 18px; height: 18px; }
.carousel-arrow.prev svg.icon { transform: rotate(90deg); }
.carousel-arrow.next svg.icon { transform: rotate(-90deg); }
.carousel-dots { position: absolute; left: 24px; bottom: 28px; display: flex; align-items: center; gap: 8px; }
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.carousel-dots button.is-active { background: white; width: 22px; border-radius: 4px; }

/* ---------- Inicio: promociones ---------- */
.promo-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 40px 0 0; }
.promo-card {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.promo-card .cat { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.85; }
.promo-card h4 { font-family: var(--font-ui); font-size: 1.05rem; margin: 6px 0; }
.promo-card p { margin: 0; font-size: 0.88rem; opacity: 0.92; }

/* ---------- Inicio: servicios destacados ---------- */
.home-services { margin-top: 72px; text-align: center; }
.home-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  margin-top: 28px;
  text-align: left;
}
.home-service-card {
  background: var(--lavender);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.home-service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.home-service-photo { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.home-service-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.home-service-body { padding: 22px 22px 26px; }
.home-service-card h3 { font-size: 1.1rem; color: var(--purple-deep); margin-bottom: 8px; }
.home-service-card p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }
.home-service-card .go-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--font-ui); font-weight: 700; font-size: 0.86rem; color: var(--pink); }

/* ---------- Blog: ¿qué te gustaría leer? (filtro en lenguaje llano) ---------- */
.blog-audience {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.blog-audience-label { font-family: var(--font-ui); font-weight: 700; color: var(--purple-deep); font-size: 0.94rem; }
.blog-audience-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.audience-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--lavender);
  border: 1px solid var(--lavender-line);
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.audience-btn svg.icon { width: 16px; height: 16px; }
.audience-btn:hover { border-color: var(--purple-soft); color: var(--purple-deep); }
.audience-btn.is-active { background: var(--purple); border-color: var(--purple); color: white; }

/* ---------- Blog: chips de tema ---------- */
.blog-topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.blog-topics-label { font-family: var(--font-ui); font-size: 0.84rem; color: var(--ink-soft); margin-right: 4px; }
.topic-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--lavender-line); color: var(--pink);
  transition: background 0.15s ease, color 0.15s ease;
}
.topic-chip svg.icon { width: 13px; height: 13px; }
.topic-chip:hover { background: var(--lavender); }
.topic-chip.is-active { background: var(--pink); border-color: var(--pink); color: white; }

/* ---------- Blog cards (home) ---------- */
.card-grid {
  display: grid;
  /* auto-fill (no auto-fit): al filtrar y quedar 1-2 tarjetas, las columnas
     vacías se mantienen en blanco en vez de repartir su espacio en la
     tarjeta existente y estirarla a todo el ancho. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 32px;
}
.blog-card {
  max-width: 420px;
  background: var(--lavender);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.blog-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.blog-card[hidden] { display: none; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.blog-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--purple-soft);
  display: grid;
  place-items: center;
}
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-card .thumb-fallback svg.icon { width: 34px; height: 34px; color: rgba(255,255,255,0.85); }
.blog-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card .meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.blog-card .meta .date { font-family: var(--font-ui); font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.blog-card h3 { font-size: 1.05rem; color: var(--ink); font-family: var(--font-ui); }
.blog-card .excerpt { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }
.blog-card .card-cta {
  margin-top: auto; padding-top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.86rem; color: var(--pink);
}
.blog-card .card-cta .go { transition: transform 0.15s ease; }
.blog-card:hover .card-cta .go { transform: translateX(4px); }
.tema-chip-mini {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-family: var(--font-ui); font-size: 0.74rem; font-weight: 700;
  color: var(--teal); background: rgba(78,138,149,0.1); border-radius: 999px; padding: 3px 10px;
}
.tema-chip-mini svg.icon { width: 12px; height: 12px; }
.blog-empty { color: var(--ink-soft); font-style: italic; }

/* ---------- Insignias de audiencia (tarjeta + artículo) ---------- */
.badge { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.badge-pacientes { background: rgba(78,138,149,0.14); color: var(--teal); }
.badge-tecnico { background: rgba(92,67,168,0.14); color: var(--purple); }
.badge-general { background: rgba(194,62,143,0.14); color: var(--pink); }

/* ---------- Red de médicos ---------- */
.red-toggle {
  display: inline-flex;
  gap: 8px;
  background: var(--lavender);
  padding: 6px;
  border-radius: 999px;
  margin: 24px 0 8px;
}
.red-toggle button {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--purple-deep);
}
.red-toggle button[aria-pressed="true"] {
  background: var(--purple);
  color: white;
}

.map-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
.map-stage { position: relative; }
.mx-map { width: 100%; height: auto; }
.mx-map path {
  fill: #e7d9ee;
  stroke: var(--pink);
  stroke-width: 0.6;
  transition: fill 0.15s ease, opacity 0.15s ease;
  cursor: default;
}
.mx-map path.is-affiliated {
  fill: var(--pink-soft);
  cursor: pointer;
}
.mx-map path.is-affiliated:hover { fill: var(--pink); }
.mx-map path.is-active { fill: var(--purple); }
.mx-map path.is-hq { fill: var(--teal); cursor: pointer; }
.mx-map path.is-hq:hover { fill: var(--teal); opacity: 0.85; }

.map-legend {
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-ui);
  font-size: 0.86rem;
}
.map-legend h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--purple-deep); margin-bottom: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }

.state-popover {
  position: absolute;
  min-width: 260px;
  max-width: 320px;
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 18px;
  z-index: 20;
  border: 1px solid var(--lavender-line);
}
.state-popover.hidden { display: none; }
.state-popover h3 { color: var(--purple-deep); font-size: 1.2rem; margin-bottom: 10px; }
.state-popover .doc-row { padding: 10px 0; border-top: 1px solid var(--lavender-line); }
.state-popover .doc-row:first-of-type { border-top: none; }
.state-popover .doc-name { color: var(--pink); font-weight: 700; font-family: var(--font-ui); font-size: 0.95rem; }
.state-popover .doc-line { font-size: 0.85rem; color: var(--ink-soft); }
.state-popover .close-btn {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--lavender);
  color: var(--purple-deep);
}

/* Tarjetas de médicos */
.doctors-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.doctors-toolbar select {
  font-family: var(--font-ui);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--lavender-line);
  color: var(--purple-deep);
  background: var(--lavender);
  font-weight: 600;
}
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.doctor-card {
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.doctor-card .avatar {
  width: 150px; height: 185px;
  border-radius: var(--radius-md);
  margin: 0 auto 12px;
  object-fit: cover;
  object-position: center top;
  background: var(--lavender);
  border: 1px solid var(--pink-soft);
}
.doctor-card h4 { font-size: 1rem; color: var(--ink); font-family: var(--font-ui); }
.doctor-card .specialty { color: var(--pink); font-size: 0.82rem; font-weight: 700; font-family: var(--font-ui); margin: 4px 0 10px; }
.doctor-card .line { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- Servicios (acordeón de iconos) ---------- */
.service-block { margin-bottom: 24px; border-bottom: 1px solid var(--lavender-line); }
.service-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--purple);
  padding: 6px 4px 14px;
  margin-bottom: 0;
  text-align: left;
}
.service-head h3 { color: var(--pink); font-size: 1.4rem; }
.service-head-chev { color: var(--purple); flex: none; transition: color 0.2s ease; }
.service-head-chev svg.icon { width: 26px; height: 26px; }
.service-head-chev img { width: 26px; height: 26px; object-fit: contain; display: block; }
.service-head[aria-expanded="true"] .service-head-chev { color: var(--pink); }
.service-body { padding: 20px 4px 28px; }
.service-body p { max-width: 980px; margin-left: auto; margin-right: auto; text-align: justify; color: var(--ink-soft); font-size: 0.96rem; margin-top: 0; margin-bottom: 0; }
.service-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 20px auto 0;
  max-width: 980px;
  position: relative;
}
.service-icon-btn {
  width: 92px; height: 92px;
  border-radius: 16px;
  background: var(--lavender);
  border: 1px solid var(--lavender-line);
  display: grid;
  place-items: center;
  position: relative;
  transition: border-radius 0.25s ease, background 0.25s ease, transform 0.15s ease;
}
.service-icon-btn svg { width: 50px; height: 50px; stroke: var(--purple); fill: none; stroke-width: 1.6; }
.service-icon-btn .service-icon-img { width: 50px; height: 50px; object-fit: contain; }
.service-icon-btn .service-icon-img.icon-flip-v { transform: scaleY(-1); }
.service-icon-btn .service-icon-img.icon-flip-both { transform: scale(-1,-1); }
.service-icon-btn:hover { transform: translateY(-2px); }
.service-icon-btn[aria-expanded="true"] {
  border-radius: 50%;
  background: #e2a9cd;
}
.service-icon-btn[aria-expanded="true"] svg { stroke: white; }
.service-icon-btn .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-family: var(--font-ui);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.service-icon-btn:hover .tooltip { opacity: 1; }

.service-detail {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
}
.service-detail.hidden { display: none; }
.service-detail img {
  width: 160px; height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex: none;
}
.service-detail h4 { color: var(--purple-deep); margin-bottom: 6px; font-family: var(--font-ui); }
.service-detail p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
/* .service-permalink: enlace por servicio (/servicios/<slug>) que NO se
   muestra en la página — va oculto con .visually-hidden — pero queda en el
   HTML para que Google lo rastree y la URL funcione al llegar desde el buscador. */

/* ---------- Servicios: preguntas frecuentes ---------- */
.faq { margin-top: 56px; }
.faq .section-title { margin-bottom: 8px; }
.faq-item {
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-md);
  background: var(--paper);
  margin-top: 10px;
  overflow: hidden;
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--purple-deep);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
  color: var(--purple);
  flex: none;
}
.faq-item[open] > summary::after { content: "−"; }
.faq-item[open] > summary { border-bottom: 1px solid var(--lavender-line); }
.faq-item > p {
  margin: 0;
  padding: 14px 18px 16px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ---------- Nosotros: misión/visión/valores ---------- */
.mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.mv-card {
  background: var(--paper);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.mv-card h4 { color: var(--ink); margin-bottom: 10px; }

.quality-policy-grid { margin-top: 20px; }
.quality-policy {
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  border-right: 4px solid var(--pink);
  padding: 24px 26px;
}
.quality-policy h4 { color: var(--ink); margin-bottom: 10px; }
.quality-policy p { margin: 0; color: var(--ink-soft); }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.value-card {
  text-align: center;
  font-family: var(--font-ui);
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius-md);
  padding: 22px 16px;
}
.value-card .ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--ring-color, var(--purple));
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: var(--ring-color, var(--purple));
}
.value-card .ring svg.icon { width: 28px; height: 28px; }
.value-card h4 { font-weight: 700; font-size: 0.92rem; color: var(--ink); margin-bottom: 6px; }
.value-card p { font-family: var(--font-body); font-size: 0.82rem; color: var(--ink-soft); margin: 0; }

/* ---------- Nosotros: los 6 valores originales (imagen) ---------- */
.valores-banner { width: 100%; height: auto; margin-top: 48px; }

/* En móvil el SVG queda diminuto: se oculta y se muestran insignias
   circulares con el mismo estilo (anillo de color + etiqueta). Al tocar
   una, se rellena de su color. Desktop no cambia. */
.valores-chips { display: none; }

@media (max-width: 640px) {
  .valores-banner { display: none; }

  .valores-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    margin: 34px auto 4px;
    padding: 0;
    max-width: 340px;
  }
  .valores-chips li {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 3px solid var(--c);
    border-radius: 50%;
    background: #fff;
    color: var(--c);
    padding: 6px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1.12;
    box-shadow: var(--shadow-card);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
  }
  .valores-chips li span { hyphens: auto; overflow-wrap: anywhere; }
  .valores-chips li:hover,
  .valores-chips li:active {
    background: var(--c);
    color: #fff;
    transform: translateY(-2px);
  }
}

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.contact-card {
  background: var(--lavender);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.contact-card h3 { color: var(--purple-deep); text-align: center; margin-bottom: 6px; }
.contact-card .subtitle { text-align: center; color: var(--pink); font-weight: 700; font-family: var(--font-ui); font-size: 0.95rem; }
.hours-pill {
  background: var(--pink-soft);
  color: var(--purple-deep);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.86rem;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  margin: 16px 0;
}
.contact-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-family: var(--font-ui); font-size: 0.94rem; }
.contact-line strong { color: var(--purple-deep); }
.map-embed {
  margin-top: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--lavender-line);
}
.map-embed iframe { width: 100%; height: 260px; border: 0; display: block; }
.directions-btn {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--lavender-line);
  color: var(--purple-deep);
}

.quote-form { display: flex; flex-direction: column; gap: 14px; }
.quote-form h3 { color: var(--purple-deep); text-align: center; margin-bottom: 6px; }
.field label { display: block; font-family: var(--font-ui); font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--lavender-line);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field textarea { min-height: 90px; resize: vertical; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.86rem; color: var(--ink-soft); font-family: var(--font-ui); }
.submit-btn {
  align-self: flex-start;
  background: var(--purple);
  color: white;
  font-family: var(--font-ui);
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.submit-btn:hover { background: var(--purple-deep); }

/* ---------- Encuesta "Califica nuestro servicio" ---------- */
.survey-card {
  max-width: 720px;
  margin: 32px auto 0;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 40px;
}
.survey-q { margin-bottom: 34px; }
.survey-q h3 { color: var(--purple-deep); font-size: 1.05rem; margin-bottom: 18px; font-family: var(--font-ui); }
.survey-dots { display: flex; justify-content: space-around; gap: 12px; flex-wrap: wrap; }
.survey-dot {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.survey-dot .dot {
  width: 44px; height: 44px; border-radius: 50%;
  transition: background 0.15s ease, transform 0.15s ease;
}
.survey-dot:hover .dot { transform: translateY(-2px); }
.survey-dot.is-active .dot { box-shadow: 0 0 0 4px rgba(92,67,168,0.18); }
.survey-dot .dot-label { font-family: var(--font-ui); font-size: 0.86rem; color: var(--ink-soft); }
.survey-dot.is-active .dot-label { color: var(--purple-deep); font-weight: 700; }

.survey-slider { width: 100%; accent-color: var(--purple); height: 6px; }
.survey-slider-readout { text-align: center; margin: 10px 0 0; font-family: var(--font-ui); font-size: 0.9rem; color: var(--purple-deep); font-weight: 600; }

.survey-radios { display: flex; flex-direction: column; gap: 12px; }
.survey-radio { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-size: 0.94rem; color: var(--ink); cursor: pointer; }
.survey-radio input { accent-color: var(--purple); width: 17px; height: 17px; }

.survey-stars { display: flex; gap: 10px; justify-content: center; }
.survey-stars .star {
  background: none; border: none; cursor: pointer;
  font-size: 2rem; line-height: 1; color: var(--lavender-line);
  transition: color 0.15s ease, transform 0.15s ease;
}
.survey-stars .star:hover { transform: scale(1.1); }
.survey-stars .star.is-filled { color: var(--pink); }

.survey-q select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--lavender-line); background: var(--lavender);
  font-family: var(--font-ui); font-size: 0.94rem; color: var(--ink);
}
.survey-q textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--lavender-line); background: var(--lavender);
  font-family: var(--font-body); font-size: 0.94rem; color: var(--ink); resize: vertical;
}
.survey-submit { align-self: center; display: flex; margin: 0 auto; align-items: center; gap: 8px; }
.survey-submit svg.icon { width: 18px; height: 18px; }
.survey-thanks { text-align: center; padding: 20px 0; }
.survey-thanks h3 { color: var(--purple-deep); font-size: 1.4rem; margin-bottom: 10px; }
.survey-thanks p { color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); padding: 26px 0; border-top: 4px solid var(--pink); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-brand { display: flex; align-items: center; gap: 22px; flex-wrap: nowrap; }
.footer-identity { display: flex; flex-direction: column; gap: 6px; max-width: 280px; flex: none; }
.footer-phone { flex: none; }
.footer-icons { flex: none; }
.footer-logo { height: 46px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.footer-tagline { font-family: var(--font-body); font-size: 0.86rem; color: var(--ink-soft); margin: 0; }
.footer-phone { font-family: var(--font-ui); }
.footer-phone .label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; color: var(--ink-soft); }
.footer-phone strong { display: block; color: var(--purple-deep); font-size: 1rem; }
.footer-icons { display: flex; gap: 10px; }
.footer-icons a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  background: var(--paper);
  color: var(--purple);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.footer-icons a:hover { background: var(--pink); color: white; }
.footer-icons a svg.icon { width: 16px; height: 16px; }
.footer-bottom-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 22px;
  background: linear-gradient(to right, var(--pink), var(--purple));
}
.footer-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 40px;
  font-family: var(--font-ui);
  font-size: 0.86rem;
}
.footer-links-grid a { color: var(--purple); }
.footer-links-grid a:hover { text-decoration: underline; }

/* ---------- Documentos legales (Aviso de privacidad / Términos) ---------- */
.legal-doc { max-width: 760px; color: var(--ink); }
.legal-doc h3 { color: var(--purple-deep); font-size: 1.1rem; margin: 28px 0 10px; }
.legal-doc p { line-height: 1.75; margin-bottom: 1rem; }
.legal-doc ul { margin: 0 0 1rem; padding-left: 1.3rem; line-height: 1.75; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--teal); text-decoration: underline; }
.legal-updated { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
.legal-pending { background: var(--lavender); border-left: 4px solid var(--pink); padding: 16px 20px; border-radius: var(--radius-md); }
.footer-copy {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 18px;
}

/* ---------- Buscador ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 56, 0.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 20px 20px;
}
.search-overlay.hidden { display: none; }
.search-panel {
  width: 100%;
  max-width: 560px;
  max-height: 70vh;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--lavender-line);
  color: var(--ink-soft);
}
.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
}
.search-input-row button { color: var(--ink-soft); display: grid; place-items: center; }
.search-results { overflow-y: auto; padding: 8px; }
.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.search-result:hover, .search-result.is-active { background: var(--lavender); }
.search-result .label { font-family: var(--font-ui); font-weight: 600; color: var(--ink); font-size: 0.94rem; }
.search-result .type { font-family: var(--font-ui); font-size: 0.72rem; color: var(--pink); text-transform: uppercase; letter-spacing: 0.5px; }
.search-empty { padding: 24px 16px; text-align: center; color: var(--ink-soft); font-family: var(--font-ui); font-size: 0.9rem; }

/* ---------- Artículo: lectura completa ---------- */
.article-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 56, 0.65);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
}
.article-overlay.hidden { display: none; }
.article-panel {
  width: 100%;
  max-width: 720px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.article-cover { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.article-body { padding: 28px 32px 36px; }
.article-crumb { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.article-body .meta { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.article-body .date { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-soft); }
.article-body .reading-time { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-soft); }
.article-body .reading-time svg.icon { width: 15px; height: 15px; }
.article-body h2 { color: var(--purple-deep); margin-bottom: 10px; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.article-text p, .article-tech-body p { color: var(--ink); line-height: 1.75; }
.article-text h4, .article-tech-body h4 { color: var(--purple-deep); font-size: 1.05rem; margin: 22px 0 10px; }
.article-text ul, .article-tech-body ul { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--ink); line-height: 1.7; }
.article-text li, .article-tech-body li { margin-bottom: 4px; }

.article-toc {
  background: var(--lavender);
  border: 1px solid var(--lavender-line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.article-toc-label { display: flex; align-items: center; gap: 7px; font-family: var(--font-ui); font-weight: 700; font-size: 0.86rem; color: var(--purple-deep); }
.article-toc-label svg.icon { width: 16px; height: 16px; }
.article-toc ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.article-toc a { font-family: var(--font-ui); font-size: 0.86rem; color: var(--teal); }
.article-toc a:hover { text-decoration: underline; }

.article-tech {
  margin-top: 28px;
  border: 1px solid var(--purple-soft);
  border-radius: var(--radius-md);
  background: rgba(92,67,168,0.05);
  overflow: hidden;
}
.article-tech summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--purple-deep);
}
.article-tech summary::-webkit-details-marker { display: none; }
.article-tech summary svg.icon { width: 18px; height: 18px; flex: none; }
.article-tech summary::after {
  content: "";
  width: 9px; height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--purple-deep);
  border-bottom: 2px solid var(--purple-deep);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.article-tech[open] summary::after { transform: rotate(-135deg); }
.article-tech-body { padding: 0 20px 20px 47px; }
.article-disclaimer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--lavender-line); font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }
.article-close {
  position: fixed;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--purple-deep);
  display: grid;
  place-items: center;
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  z-index: 60;
}
.whatsapp-fab svg { width: 28px; height: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two-col, .contact-grid, .mv-grid { grid-template-columns: 1fr; }
  .map-wrap { grid-template-columns: 1fr; }
  .hero-carousel { aspect-ratio: 16 / 9; }
  /* apilado: la foto de SMIred ya no tiene texto al lado que fije su altura,
     así que el marco toma una proporción fija. */
  #red .two-col > picture { aspect-ratio: 16 / 9; align-self: auto; }
}
@media (max-width: 560px) {
  .hero-carousel { aspect-ratio: 4 / 3; }
  .footer-links-grid { grid-template-columns: 1fr; }
  /* el botón se achica en pantallas angostas; los puntos bajan a la par,
     compartiendo la misma franja inferior en vez de una fila aparte. */
  .carousel-dots { bottom: 18px; left: 16px; }
  .carousel-slide figcaption { padding: 6px 20px; }
  .carousel-cta { padding: 7px 14px; font-size: 0.78rem; }
}
@media (max-width: 720px) {
  .footer-brand { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .main-nav ul { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .main-nav {
    position: absolute;
    top: 100%; right: 16px; left: 16px;
    max-width: 300px; margin-left: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--lavender-line);
    flex-direction: column; align-items: stretch;
    padding: 10px;
    max-height: 75vh; overflow-y: auto;
    display: none;
  }
  .main-nav.mobile-open { display: flex; }
  .main-nav.mobile-open ul { display: flex; flex-direction: column; gap: 2px; width: 100%; }
  .main-nav a.nav-link { justify-content: flex-start; padding: 13px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
