/* ===== Enfermed — estilos generales ===== */
:root {
  --primary: #1a4f8a;
  --primary-dark: #0f2a44;
  --secondary: #6fb62c;
  --text: #122436;
  --text-muted: #5a6b78;
  --border: #e6ebf0;
  --bg-soft: #f8fafb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: var(--text);
}

h1, h2, h3 { font-family: 'Sora', 'Work Sans', sans-serif; margin: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* ===== Header ===== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 48px;
  gap: 24px;
}
.logo img { height: 44px; width: auto; }
nav.main-nav { display: flex; gap: 32px; }
nav.main-nav a { font-size: 15px; font-weight: 600; color: var(--text); }
nav.main-nav a:hover { color: var(--primary); }

.whatsapp-header-wrap { position: relative; }

.btn-whatsapp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 11px 20px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-whatsapp-header .chevron { transition: transform .2s ease; }
.btn-whatsapp-header[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.whatsapp-header-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
  padding: 8px;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 150;
}
.whatsapp-header-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.whatsapp-header-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
}
.whatsapp-header-menu a:hover { background: #f2f7fb; }
.whatsapp-header-menu a strong { font-size: 14px; color: var(--primary); }
.whatsapp-header-menu a span { font-size: 13px; color: var(--text-muted); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
  padding: 72px 48px;
  background: linear-gradient(180deg, #f3f8fb 0%, #ffffff 100%);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eaf3ff;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
}
.hero h1 { font-size: 46px; line-height: 1.15; color: var(--text); margin: 22px 0 18px; }
.hero p.lead { font-size: 17px; line-height: 1.6; color: var(--text-muted); max-width: 480px; margin: 0 0 26px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 14px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
}
.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  background: none;
}

/* Hero carousel */
.img-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15,42,68,0.16);
  background: #eef3f7;
}
.img-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .4s ease;
}
.img-carousel img.active { opacity: 1; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity .2s ease;
}
.img-carousel:hover .carousel-arrow,
.img-carousel:focus-within .carousel-arrow {
  opacity: 1;
}
/* En pantallas táctiles no existe "hover": se muestran siempre */
@media (hover: none) {
  .carousel-arrow { opacity: 1; }
}
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  gap: 7px;
  justify-content: center;
  z-index: 2;
}
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.5);
}
.carousel-dots button.active { background: #ffffff; }

/* ===== Trust bar ===== */
.trust-bar { background: var(--primary-dark); padding: 34px 48px; overflow: hidden; }
.trust-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}
.trust-label { color: #9fb8ce; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; flex-shrink: 0; }
.trust-logos-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}
.trust-logos-track {
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  animation: logos-scroll 22s linear infinite;
}
.trust-logos-wrapper:hover .trust-logos-track { animation-play-state: paused; }
@keyframes logos-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.trust-logos-track .logo-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 48px;
  overflow: hidden;
  flex-shrink: 0;
}
.trust-logos-track .logo-card img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (prefers-reduced-motion: reduce) {
  .trust-logos-track { animation: none; }
}

/* ===== Nosotros ===== */
.nosotros {
  padding: 64px 48px;
  background: var(--bg-soft);
}
.nosotros .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 48px;
  align-items: center;
}
.eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.nosotros h2, .categorias h2, .servicios-medicos h2, .sucursales h2 { font-size: 30px; color: var(--text); margin: 10px 0 14px; }
.nosotros p, .categorias > p, .servicios-medicos p, .sucursales > p { font-size: 16px; color: var(--text-muted); line-height: 1.6; }

/* ===== Categorías ===== */
.categorias { padding: 72px 48px; }
.categorias .heading { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.category-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.category-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: #eaf3ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-card h3 { font-size: 17px; color: var(--text); }
.category-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.category-card a.link { font-size: 14px; font-weight: 700; color: var(--primary); }

/* ===== Servicios médicos ===== */
.servicios-medicos { background: #f2f9f0; padding: 64px 48px; }
.servicios-medicos .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 48px;
  align-items: center;
}
.servicios-medicos .eyebrow { color: var(--secondary); }
.servicios-medicos ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 12px; }
.servicios-medicos li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #28422f; }

/* Sección de la Sucursal Yaruquí: mismo estilo, fondo alterno */
.servicios-medicos.alt { background: #ffffff; }

.branch-photo .img-carousel { height: 200px; aspect-ratio: auto; border-radius: 0; box-shadow: none; }

/* ===== Promociones ===== */
.promociones { padding: 64px 48px; background: var(--bg-soft); }
.promociones .heading { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.promo-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.promo-card img { width: 100%; height: auto; display: block; }
.promo-card .promo-cta {
  margin: 16px;
  text-align: center;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}
.agendar-cita { padding: 64px 48px; background: #ffffff; }
.agendar-cita .heading { max-width: 640px; margin: 0 auto 32px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.agendar-cita .eyebrow { display: block; }
#form-cita {
  max-width: 560px; margin: 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 14px; font-weight: 700; color: var(--text); }
.form-field input, .form-field select {
  padding: 12px 14px;
  border: 1px solid #d5dde3;
  border-radius: 8px;
  font-size: 15px;
  background: #ffffff;
  font-family: inherit;
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-note { font-size: 13px; color: var(--text-muted); margin-top: -6px; }

/* ===== Sucursales ===== */
.sucursales { padding: 72px 48px; }
.sucursales .heading { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.branch-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; }
.branch-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.branch-photo { width: 100%; height: 200px; overflow: hidden; }
.branch-photo img { width: 100%; height: 100%; object-fit: cover; }
.branch-photo.placeholder {
  background: #dfeaf2; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.branch-photo.placeholder span { color: #6c8494; font-size: 13px; font-weight: 600; }
.branch-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.branch-body h3 { font-size: 18px; color: var(--text); }
.branch-body p.address-link a { font-size: 14px; color: var(--text-muted); text-decoration: underline; }
.branch-contact { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.branch-contact span { font-size: 14px; color: #28422f; }
.branch-body .btn-outline { margin-top: 10px; width: fit-content; padding: 10px 18px; font-size: 14px; }

/* ===== CTA final ===== */
.cta-final {
  background: var(--primary);
  padding: 56px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-final h2 { color: #ffffff; font-size: 26px; max-width: 520px; }
.btn-whatsapp-cta {
  background: var(--secondary); color: #ffffff; padding: 16px 30px;
  border-radius: 8px; font-weight: 700; font-size: 16px; white-space: nowrap;
}

/* ===== Footer ===== */
footer.site-footer { background: var(--primary-dark); color: #c9d7e4; padding: 56px 48px 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 32px; }
.footer-logo-card { background: #ffffff; padding: 8px 14px; border-radius: 8px; width: fit-content; }
.footer-logo-card img { height: 32px; width: auto; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col span.title { font-weight: 700; color: #ffffff; font-size: 14px; }
.footer-col a, .footer-col span.info { font-size: 13px; color: #9fb8ce; }
.footer-col p { font-size: 13px; line-height: 1.6; color: #9fb8ce; margin: 0; }
.social-icons { display: flex; gap: 12px; }
.social-icons a {
  width: 36px; height: 36px; border-radius: 50%; background: #16385a;
  display: flex; align-items: center; justify-content: center;
}
.footer-bottom {
  border-top: 1px solid #1c3f60; margin-top: 40px; padding-top: 20px; text-align: center;
}
.footer-bottom span { font-size: 12px; color: #7d97ac; }

/* ===== Botón flotante WhatsApp ===== */
.whatsapp-float-wrap {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.whatsapp-float {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--secondary);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.whatsapp-float-menu {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
  padding: 8px;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.whatsapp-float-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.whatsapp-float-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
}
.whatsapp-float-menu a:hover { background: #f2f7fb; }
.whatsapp-float-menu a strong { font-size: 14px; color: var(--primary); }
.whatsapp-float-menu a span { font-size: 13px; color: var(--text-muted); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .header-inner { padding: 14px 20px; }
  nav.main-nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: #ffffff;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  nav.main-nav.open { max-height: 400px; }
  nav.main-nav a { padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: flex; }
  .btn-whatsapp-header span.label { display: none; }

  .hero, .nosotros .grid, .servicios-medicos .grid { grid-template-columns: 1fr; padding: 40px 20px; }
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 32px; }
  .nosotros, .categorias, .servicios-medicos, .promociones, .agendar-cita, .sucursales { padding: 48px 20px; }
  .nosotros .img-carousel { order: -1; }

  .category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .branch-grid { grid-template-columns: 1fr; }
  .trust-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .trust-logos-wrapper { width: 100%; }
  .cta-final { flex-direction: column; text-align: center; padding: 40px 20px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; }
  footer.site-footer { padding: 40px 20px 20px; }
  .form-row { grid-template-columns: 1fr; }
  #form-cita { padding: 24px; }
}

@media (max-width: 520px) {
  .category-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
