/* =========================================================
   MEDICLEANBSC - Hoja de estilos
   Paleta de la marca: azul profundo, celeste y blanco.
   Organizada por secciones para que sea fácil de editar.
   ========================================================= */

/* ---------- Variables de color y medidas ---------- */
:root {
  --azul-profundo: #134c6b;   /* color principal (titulos, navbar) */
  --azul: #1e7bb8;            /* color de acento (botones, enlaces) */
  --celeste: #4db8e8;         /* detalles y degradados */
  --celeste-claro: #eaf6fc;   /* fondos suaves */
  --verde: #25d366;           /* boton de WhatsApp */
  --texto: #233a47;           /* texto normal */
  --texto-suave: #5b7383;     /* texto secundario */
  --blanco: #ffffff;
  --borde: #dbe9f1;
  --sombra: 0 8px 24px rgba(19, 76, 107, 0.10);
  --radio: 16px;
  --ancho-max: 1140px;
}

/* ---------- Reset básico ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--texto);
  line-height: 1.6;
  background: var(--blanco);
}

img { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; }

.container {
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--azul); color: var(--blanco); box-shadow: var(--sombra); }
.btn--primary:hover { background: var(--azul-profundo); }

.btn--ghost { background: transparent; color: var(--azul-profundo); border-color: var(--azul); }
.btn--ghost:hover { background: var(--celeste-claro); }

.btn--whatsapp { background: var(--verde); color: var(--blanco); }
.btn--mail { background: var(--azul-profundo); color: var(--blanco); }

/* =========================================================
   BARRA DE NAVEGACIÓN
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--borde);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
}
.navbar__brand { display: flex; align-items: center; gap: 10px; }
.navbar__logo { height: 92px; width: auto; }
.navbar__brand-text {
  display: none; /* solo aparece si el logo no carga */
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--azul-profundo);
}
.navbar__menu { display: flex; align-items: center; gap: 26px; }
.navbar__menu a { font-weight: 500; color: var(--texto); transition: color 0.15s; }
.navbar__menu a:hover { color: var(--azul); }
.navbar__cta {
  background: var(--azul);
  color: var(--blanco) !important;
  padding: 9px 18px;
  border-radius: 50px;
  font-weight: 600;
}
.navbar__cta:hover { background: var(--azul-profundo); }

/* Botón hamburguesa */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.navbar__toggle span {
  width: 26px; height: 3px;
  background: var(--azul-profundo);
  border-radius: 3px;
  transition: 0.3s;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: linear-gradient(135deg, var(--celeste-claro) 0%, #d6ecf7 100%);
  padding: 70px 0;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
}
.hero__eyebrow {
  color: var(--azul);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hero__title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--azul-profundo);
}
.hero__title span { color: var(--azul); }
.hero__subtitle {
  margin: 18px 0 28px;
  font-size: 1.1rem;
  color: var(--texto-suave);
  max-width: 520px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  color: var(--azul-profundo);
  font-weight: 500;
  font-size: 0.95rem;
}
.hero__image { text-align: center; }
.hero__image img {
  max-height: 380px;
  margin: 0 auto;
  filter: drop-shadow(0 16px 24px rgba(19, 76, 107, 0.22));
  animation: flotar 4s ease-in-out infinite;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* =========================================================
   SECCIONES GENERALES
   ========================================================= */
.section { padding: 72px 0; }
.section--alt { background: var(--celeste-claro); }
.section__title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--azul-profundo);
  margin-bottom: 14px;
}
.section__intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
  color: var(--texto-suave);
  font-size: 1.05rem;
}

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 22px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 26px 22px;
  box-shadow: var(--sombra);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(19, 76, 107, 0.16); }
.card h3 { color: var(--azul-profundo); font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--texto-suave); font-size: 0.96rem; }
.card__icon { font-size: 2rem; margin-bottom: 12px; }

.card--accent { border-top: 4px solid var(--azul); }
.card--soft {
  text-align: center;
  background: var(--celeste-claro);
  border: 1px dashed var(--celeste);
}
.section--alt .card--soft { background: var(--blanco); }
.card--soft h3 { margin: 0; font-size: 1.02rem; }

/* ---------- Columnas divididas ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}
.split__col {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 28px;
  box-shadow: var(--sombra);
}
.split__title { color: var(--azul-profundo); margin-bottom: 16px; font-size: 1.2rem; }
.checklist { list-style: none; }
.checklist li {
  padding: 8px 0 8px 30px;
  position: relative;
  color: var(--texto);
  border-bottom: 1px solid var(--borde);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--azul);
  font-weight: 700;
}

/* ---------- Pasos del proceso ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.step {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--sombra);
}
.step__num {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--azul);
  color: var(--blanco);
  font-weight: 800;
  font-size: 1.3rem;
  border-radius: 50%;
}
.step h3 { color: var(--azul-profundo); font-size: 1.05rem; margin-bottom: 8px; }
.step p { color: var(--texto-suave); font-size: 0.94rem; }

/* =========================================================
   CONTACTO
   ========================================================= */
.section--contact {
  background: linear-gradient(135deg, var(--azul-profundo) 0%, var(--azul) 100%);
  color: var(--blanco);
}
.section--contact .section__title { color: var(--blanco); }
.section--contact .section__intro { color: rgba(255, 255, 255, 0.9); }
.contact { text-align: center; }
.contact__buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.contact__info {
  list-style: none;
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 1.05rem;
}

/* =========================================================
   PIE DE PÁGINA
   ========================================================= */
.footer {
  background: #0e3a52;
  color: rgba(255, 255, 255, 0.85);
  padding: 36px 0;
  text-align: center;
}
.footer__brand { font-weight: 800; font-size: 1.3rem; letter-spacing: 1px; color: var(--blanco); }
.footer__slogan { font-style: italic; margin: 6px 0 14px; color: var(--celeste); }
.footer__copy { font-size: 0.88rem; opacity: 0.8; }

/* =========================================================
   CHATBOT
   ========================================================= */
/* Botón flotante de WhatsApp (abajo a la derecha) */
.whatsapp-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  display: flex; align-items: center; gap: 10px;
}
.whatsapp-float__label {
  background: var(--blanco);
  color: var(--azul-profundo);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 14px;
  border-radius: 50px;
  box-shadow: 0 6px 18px rgba(19, 76, 107, 0.18);
  white-space: nowrap;
}
.whatsapp-float__icon {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover .whatsapp-float__icon { transform: scale(1.08); }

@media (max-width: 480px) {
  /* En pantallas pequeñas ocultamos el texto para no tapar contenido */
  .whatsapp-float__label { display: none; }
}

/* Botón "Preguntas frecuentes" que abre el chat (abajo a la izquierda) */
.chat-fab {
  position: fixed;
  left: 22px; bottom: 22px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 12px;
  border: none;
  border-radius: 50px;
  background: var(--azul);
  color: var(--blanco);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(19, 76, 107, 0.35);
  z-index: 60;
  transition: transform 0.15s ease, background 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px); background: var(--azul-profundo); }
.chat-fab img { width: 40px; height: 40px; object-fit: contain; }

.chat-window {
  position: fixed;
  left: 22px; bottom: 92px;
  width: 350px;
  max-width: calc(100vw - 44px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--blanco);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(19, 76, 107, 0.30);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
  /* Oculto por defecto */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.chat-window.open { opacity: 1; visibility: visible; transform: translateY(0); }

.chat-header {
  background: var(--azul-profundo);
  color: var(--blanco);
  padding: 14px 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-close {
  background: none; border: none; color: var(--blanco);
  font-size: 1.1rem; cursor: pointer; opacity: 0.85;
}
.chat-close:hover { opacity: 1; }

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--celeste-claro);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
}
.msg--bot { background: var(--blanco); color: var(--texto); border: 1px solid var(--borde); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg--user { background: var(--azul); color: var(--blanco); align-self: flex-end; border-bottom-right-radius: 4px; }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
}
.chat-suggestions button {
  background: var(--celeste-claro);
  border: 1px solid var(--celeste);
  color: var(--azul-profundo);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.chat-suggestions button:hover { background: var(--celeste); color: var(--blanco); }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
}
.chat-input input {
  flex: 1;
  border: 1px solid var(--borde);
  border-radius: 50px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}
.chat-input input:focus { border-color: var(--azul); }
.chat-input button {
  background: var(--azul);
  color: var(--blanco);
  border: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.chat-input button:hover { background: var(--azul-profundo); }

/* =========================================================
   RESPONSIVE (tablets y celulares)
   ========================================================= */
@media (max-width: 980px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  /* Menú móvil */
  .navbar__toggle { display: flex; }
  .navbar__menu {
    position: absolute;
    top: 112px; left: 0; right: 0;
    background: var(--blanco);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 20px;
    border-bottom: 1px solid var(--borde);
    box-shadow: var(--sombra);
    /* oculto por defecto */
    display: none;
  }
  .navbar__menu.open { display: flex; }
  .navbar__menu a { padding: 12px 4px; border-bottom: 1px solid var(--borde); }
  .navbar__cta { text-align: center; margin-top: 8px; }

  /* Hero en una columna */
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__title { font-size: 2.1rem; }
  .hero__actions, .hero__badges { justify-content: center; }
  .hero__image { order: -1; }
  .hero__image img { max-height: 260px; }
}

@media (max-width: 560px) {
  .cards--3, .cards--4, .steps, .split { grid-template-columns: 1fr; }
  .hero__title { font-size: 1.8rem; }
  .section__title { font-size: 1.6rem; }
  .contact__info { gap: 12px; }
}
