/* ==========================================================================
   Italmed 4.2.2 · Ajustes Visuales Limpios sobre 4.1.4
   - Paleta sincronizada con el Logo Oficial de Italmed (Azul Cian #0d74be → Turquesa Clínico #0b9692)
   - Barra superior (.itm4-topbar) con el degradado del logo de Italmed
   - Cero interferencia con la barra de administración de WordPress (#wpadminbar)
   - Escala tipográfica moderada y proporcionada (sin textos gigantes)
   - Tarjetas del inicio limpias (blancas, sin recargar fondos ni bordes)
   - Centrado de "Cómo llegar", "¿Qué examen busca?", "Opiniones" y "Convenios"
   - Cero azul sobre azul y botones de WhatsApp siempre en verde con texto blanco
   ========================================================================== */

/* 1. PALETA DEL LOGO ITALMED Y BARRA SUPERIOR ("LA BARRITA DE ARRIBA") */
:root,
.itm4 {
  --i4-bg: #f3f7fa;
  --i4-surface: #ffffff;
  --i4-line: #dbe6f0;
  --i4-line-soft: #eaf0f6;
  --i4-ink: #0f2942;
  --i4-muted: #4b627a;
  --i4-blue: #0d74be;
  --i4-blue-dark: #095a96;
  --i4-blue-tint: #eaf4fc;
  --i4-teal: #0b9692;
  --i4-teal-tint: #e6f6f5;
  --i4-green: #15803d;
  --i4-green-text: #146c35;
  --i4-green-tint: #e8f5ec;
  --i4-navy: #0c3b5e;
}

/* Barra superior con el degradado exacto del logo de Italmed (Azul Cian a Turquesa) */
html body .itm4-topbar {
  background: linear-gradient(90deg, #0b6fb5 0%, #128cc4 52%, #0b9692 100%) !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16) !important;
}
html body .itm4-topbar span,
html body .itm4-topbar a {
  color: #ffffff !important;
}
html body .itm4-topbar .itm4-topbar__ico {
  color: #ffffff !important;
}

/* Nombre junto al logo en cabecera armonizado con los dos tonos del logo */
html body .itm4-header .itm4-brand__txt strong {
  color: #0d74be !important;
}
html body .itm4-header .itm4-brand__txt small {
  color: #0b8a85 !important;
}

/* Pie de página en azul petróleo profundo acorde al logo (en vez de negro) */
html body #colophon.itm4-footer {
  background: linear-gradient(135deg, #0a3556 0%, #0b4f7c 58%, #09636b 100%) !important;
}

/* 2. ESCALA TIPOGRÁFICA PROPORCIONADA Y MODERADA (Sin agrandar textos)
   Nota: No se toca #wpadminbar para no alterar los iconos Dashicons de WordPress */
html body :is(
  .itm4 h1#itm4-h1,
  .itm4 .itm4-svc-hero h1,
  .service-hero-premium h1,
  .page-hero-premium h1,
  .spal-hero h1,
  #itm-cotizador-page #itm-cot-hero h1,
  #itm-resultados-page #itm-res-hero h1,
  #itm-con-hero h1,
  #sr-hero h1,
  .service-intro-card h1,
  .s-ficha h1
) {
  font-size: clamp(1.6rem, 1.25rem + 1.35vw, 2.15rem) !important;
  line-height: 1.16 !important;
  font-weight: 800 !important;
  letter-spacing: -0.022em !important;
}

html body :is(
  .itm4 .itm4-head h2,
  .itm4 .itm4-section h2,
  .service-section h2,
  .service-title-center,
  .v5-section-heading .section-title,
  .itm-local-seo-copy .section-title,
  .itm-local-network-copy h2,
  .s-search .s-title,
  .s-section > h2
) {
  font-size: clamp(1.25rem, 1.1rem + 0.65vw, 1.55rem) !important;
  line-height: 1.24 !important;
  font-weight: 800 !important;
  letter-spacing: -0.018em !important;
}

html body :is(
  .itm4 .itm4-lead,
  .service-hero-premium .hero-text,
  .page-hero-premium p,
  .spal-hero .spal-hero-sub,
  #itm-cotizador-page .cot-hero-sub,
  #itm-resultados-page #itm-res-hero p,
  .v5-section-heading .section-subtitle,
  .itm-local-seo-copy .section-subtitle,
  .s-search .s-sub
) {
  font-size: 0.98rem !important;
  line-height: 1.55 !important;
}

/* 3. FONDOS LIMPIOS SIN CRUCETAS Y TARJETAS DE INICIO SOBRIAS */
#itm-cot-hero::before,
#itm-cot-hero::after,
.service-hero-premium::before,
.service-hero-premium::after {
  display: none !important;
  content: none !important;
  background-image: none !important;
}

/* Foto de fachada en el inicio con marco blanco limpio */
.itm4 .itm4-hero__media img {
  border: 4px solid #ffffff !important;
  box-shadow: 0 12px 28px -8px rgba(13, 116, 190, 0.16) !important;
}

/* Banner destacado "Agendar Rayos X" en portada con el degradado del logo */
.itm4 .itm4-banner {
  background: linear-gradient(90deg, #0d74be 0%, #0b9692 100%) !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 16px 20px !important;
  box-shadow: 0 8px 22px -6px rgba(13, 116, 190, 0.28) !important;
}
.itm4 .itm4-banner .itm4-banner__text strong {
  color: #ffffff !important;
}
.itm4 .itm4-banner .itm4-banner__text span {
  color: #e6f6f5 !important;
}
.itm4 .itm4-banner .itm4-banner__arrow {
  color: #ffffff !important;
}

/* Enlace de consulta en la tabla de Laboratorio */
.itm4 .itm4-lab-wa-link {
  color: var(--i4-green-text) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
.itm4 .itm4-lab-wa-link:hover {
  text-decoration: underline !important;
}

/* 4. CENTRADO DE MÓDULOS ("COMO LLEGAR", "¿QUÉ EXAMEN BUSCA?", OPINIONES, CONVENIOS) */
html body .itm-local-seo-copy,
html body .v5-section-heading {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 720px !important;
}
html body :is(.itm-local-seo-copy, .v5-section-heading) :is(h2, p, .section-title, .section-subtitle, .section-badge) {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
}

/* Buscador "¿Qué examen busca?" centrado y limpio */
html body .s-search {
  background: #ffffff !important;
  border: 1px solid var(--i4-line) !important;
  border-radius: 20px !important;
  padding: 28px 22px !important;
  max-width: 880px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}
html body .s-search :is(.s-title, .s-sub, .s-note, .s-status) {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
}
html body .s-search .s-modes,
html body .s-search .s-prev {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
  width: auto !important;
}
html body .s-search .s-mode {
  margin: 0 !important;
}
html body .s-search .s-box {
  width: 100% !important;
  max-width: 680px !important;
  margin: 12px auto !important;
}
html body .s-search .s-chips {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 6px auto 4px !important;
}
html body .s-search .s-results {
  width: 100% !important;
  max-width: 740px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: left !important;
}

/* Bloque "Pacientes de sectores cercanos" en 2 columnas equilibradas sin las 3 mini-fotos */
html body .itm-local-network-media {
  display: none !important;
}
html body .itm-local-network-inner {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  align-items: center !important;
}
@media (min-width: 860px) {
  html body .itm-local-network-inner {
    grid-template-columns: 1.05fr 1fr !important;
    gap: 28px !important;
  }
}

/* 5. ICONOS DE TARJETAS EN PÁGINAS DE SERVICIO: 52×52 px PAREJOS (image_2a9442.png) */
html body :is(
  .v5-mini-card-icon,
  .feature-icon,
  .service-card-icon,
  .prep-icon,
  .highlight-icon,
  .step-icon,
  .con-info-icon,
  .plat-icon,
  .info-card-icon,
  .spal-icon,
  .service-icon
) {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  flex: 0 0 48px !important;
  border-radius: 13px !important;
  padding: 0 !important;
  margin: 0 0 12px 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
html body :is(
  .v5-mini-card-icon,
  .feature-icon,
  .service-card-icon,
  .prep-icon,
  .highlight-icon,
  .step-icon,
  .con-info-icon,
  .plat-icon,
  .info-card-icon,
  .spal-icon,
  .service-icon
) > :is(i, svg, .itm4-ico) {
  width: 26px !important;
  height: 26px !important;
  font-size: 26px !important;
  line-height: 1 !important;
  margin: 0 !important;
}

/* Evitar cualquier colisión de tarjetas en grillas de servicios */
html body :is(.service-feature-card, .service-step-card, .service-faq-card, .service-card) {
  height: auto !important;
  box-sizing: border-box !important;
}

/* 6. BLOQUES DE CIERRE (.service-cta-final, .cta-card, .itm4-cta) Y CONTRASTE DE BOTONES
      - Degradado Azul-Turquesa del logo o tarjeta limpia con botones diferenciados
      - Cero azul sobre azul
      - Botones de WhatsApp SIEMPRE en verde (#15803d) con texto e icono blancos */
html body :is(.service-cta-final, .cta-card, .itm4 .itm4-cta, .rx-final-cta) {
  background: linear-gradient(135deg, #ffffff 0%, #f0f8fc 100%) !important;
  background-image: linear-gradient(135deg, #ffffff 0%, #f0f8fc 100%) !important;
  border: 1px solid #c5dff0 !important;
  border-left: 5px solid #0d74be !important;
  border-radius: 20px !important;
  padding: 24px 26px !important;
  box-shadow: 0 10px 26px -8px rgba(13, 116, 190, 0.10) !important;
  color: var(--i4-ink) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 14px !important;
  text-align: left !important;
}
html body :is(.service-cta-final, .cta-card, .itm4 .itm4-cta, .rx-final-cta) :is(h2, h3, strong) {
  color: var(--i4-ink) !important;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem) !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  margin: 0 !important;
  text-shadow: none !important;
}
html body :is(.service-cta-final, .cta-card, .itm4 .itm4-cta, .rx-final-cta) :is(p, span:not(.btn-lbl)) {
  color: var(--i4-muted) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}

/* Botones de WhatsApp: SIEMPRE verde con texto e icono blancos */
html body :is(
  a.service-cta-btn[href*="wa.me"],
  a.service-cta-btn-secondary[href*="wa.me"],
  .itm4 .itm4-cta a[href*="wa.me"],
  .itm4-btn.is-wa,
  .itm4-wa-mini,
  .s-btn--wa,
  .btn-ayuda.wsp,
  #itm-resultados-page .plat-card.lab .btn-plataforma:not(.btn-plataforma--secundario),
  #itm-cot-sidebar .btn-caj,
  #sr-whatsapp,
  .sr-btn-whatsapp,
  .v5-hero-actions a[href*="wa.me"],
  .hero-buttons a[href*="wa.me"],
  .itm-lab-contact
) {
  background: #15803d !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1.5px solid #15803d !important;
  border-radius: 12px !important;
  min-height: 48px !important;
  padding: 0 20px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
}
html body :is(
  a.service-cta-btn[href*="wa.me"],
  a.service-cta-btn-secondary[href*="wa.me"],
  .itm4 .itm4-cta a[href*="wa.me"],
  .itm4-btn.is-wa,
  .itm4-wa-mini,
  .s-btn--wa,
  .btn-ayuda.wsp,
  #itm-resultados-page .plat-card.lab .btn-plataforma:not(.btn-plataforma--secundario),
  #itm-cot-sidebar .btn-caj,
  #sr-whatsapp,
  .sr-btn-whatsapp,
  .v5-hero-actions a[href*="wa.me"],
  .hero-buttons a[href*="wa.me"],
  .itm-lab-contact
) :is(i, svg, span, strong, small, kubai-icon) {
  color: #ffffff !important;
  fill: currentColor !important;
}

/* Botones primarios azules (Reservar / Abrir plataforma / Enviar):
   SIEMPRE fondo azul del logo (#0d74be) y texto + icono 100% blancos */
html body :is(
  #itm-resultados-page .plat-card.azul .btn-plataforma,
  #itm-resultados-page .plat-card.rojo .btn-plataforma,
  .itm4-btn.is-primary,
  .itm4-header__cta,
  .btn-hero-primary:not([href*="wa.me"]),
  .s-btn--p,
  .sr-btn-enviar,
  #itm-cot-sidebar .btn-agendar,
  .v5-hero-actions .btn-new-solid:not([href*="wa.me"]),
  .service-cta-btn:not([href*="wa.me"]),
  .itm4 .itm4-cta a:not([href*="wa.me"])
) {
  background: #0d74be !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1.5px solid #0d74be !important;
  border-radius: 12px !important;
  text-decoration: none !important;
}
html body :is(
  #itm-resultados-page .plat-card.azul .btn-plataforma,
  #itm-resultados-page .plat-card.rojo .btn-plataforma,
  .itm4-btn.is-primary,
  .itm4-header__cta,
  .btn-hero-primary:not([href*="wa.me"]),
  .s-btn--p,
  .sr-btn-enviar,
  #itm-cot-sidebar .btn-agendar,
  .v5-hero-actions .btn-new-solid:not([href*="wa.me"]),
  .service-cta-btn:not([href*="wa.me"]),
  .itm4 .itm4-cta a:not([href*="wa.me"])
) :is(i, svg, span, strong, small, kubai-icon) {
  color: #ffffff !important;
  fill: currentColor !important;
}

/* Botones secundarios (no WhatsApp): Blanco con borde y texto azul */
html body :is(.service-cta-btn-secondary, .cta-card a.btn-hero-secondary):not([href*="wa.me"]):not([href*="whatsapp"]) {
  background: #ffffff !important;
  color: #0d74be !important;
  border: 1.5px solid #0d74be !important;
  border-radius: 12px !important;
  min-height: 48px !important;
  padding: 0 20px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
}
html body :is(.service-cta-btn-secondary, .cta-card a.btn-hero-secondary):not([href*="wa.me"]):not([href*="whatsapp"]) :is(i, svg, span, kubai-icon) {
  color: #0d74be !important;
}
