/* ==========================================================
   Centro Médico Limache - Hoja de estilos
   ========================================================== */

:root {
  --navy: #182b54;
  --green: #9abd2d;
  --yellow: #f1b514;
  --text: #2e2e2e;
  --dark: #1f1f1f;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Poppins", Arial, sans-serif;
  --font-info: Calibri, Arial, Helvetica, sans-serif; /* datos de contacto: tipografía simple y legible */
  --max-width: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; font-family: var(--font-body); color: var(--text); background: #fff; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 148px; }
.logo img { display: block; width: 110px; }

.main-nav ul { display: flex; gap: 2rem; }
.main-nav a {
  display: block; padding: .35rem 0; text-decoration: none; text-transform: uppercase;
  font-size: .9rem; color: #444; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--yellow); }

.social-links { display: flex; gap: .6rem; justify-content: flex-end; }
.social-links a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; }
.social-links img { display: block; width: 100%; height: 100%; }
.social-mail { background: #617379; }
.social-mail img { width: 62%; height: 62%; filter: invert(1); }

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: center; min-height: 400px;
  color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  background: url("../img/hero-contacto.jpg") center / cover no-repeat;
}
.hero h1 { font-family: var(--font-heading); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.hero p { margin-top: 1.25rem; font-family: var(--font-heading); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }

/* ---------- Formulario ---------- */
.contact-form-section { padding: 5rem 0 6rem; }
.contact-form-section h2 {
  text-align: center; margin-bottom: 1rem;
  font-family: var(--font-heading); font-size: 2.25rem; font-weight: 700; color: var(--green);
}
.intro { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.contact-form-section h3 { margin-bottom: 2.5rem; font-size: 1.6rem; font-weight: 400; color: #212226; }

.form-grid { display: grid; gap: .75rem 1.75rem; grid-template-columns: 1fr 1fr; }
.form-group--full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: .25rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: .55rem .75rem; font: inherit; color: #000;
  background: #fff; border: 1px solid var(--green); border-radius: 0;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; }
.form-group textarea { min-height: 90px; resize: vertical; }

.btn {
  display: block; width: min(100%, 275px); margin: .5rem auto 0; padding: .75rem 1rem;
  border: 0; cursor: pointer; font: inherit; color: #fff; background: var(--navy); transition: opacity .2s;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.form-status { margin-top: 1rem; padding: .75rem 1rem; font-weight: 600; color: #fff; text-align: center; }
.form-status a { color: #fff; text-decoration: underline; }
.form-status.is-loading { background: #17a2b8; }
.form-status.is-success { background: #28a745; }
.form-status.is-error   { background: #dc3545; }

/* ---------- Mapa y datos de contacto ---------- */
.location { display: grid; grid-template-columns: 3fr 2fr; color: #fff; background: var(--navy); }
.map iframe { display: block; width: 100%; height: 100%; min-height: 420px; border: 0; }
.contact-info { display: flex; align-items: center; padding: 2.5rem 2rem; }
.info-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: 1fr 1fr; width: 100%; font-style: normal; text-align: center; }

/* ---------- Pie de página ---------- */
.site-footer { color: #fff; }
.info-item img { display: block; width: 40px; height: 40px; margin: 0 auto 1.25rem; }
.info-item h3 { margin-bottom: .75rem; font-family: var(--font-info); font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.info-item p { font-family: var(--font-info); font-size: 1.05rem; line-height: 1.6; }
.info-item a { text-decoration: none; }
.info-item a:hover { text-decoration: underline; }

.footer-copy { padding: 2rem 0; background: var(--dark); font-size: .875rem; }
.footer-copy a { text-decoration: none; }
.footer-copy a:hover { text-decoration: underline; }

/* ---------- Flotantes ---------- */
.whatsapp-btn { position: fixed; z-index: 1000; right: 10px; bottom: 130px; width: 62px; }
.whatsapp-btn img { display: block; width: 100%; }

.chat-bubble {
  position: fixed; z-index: 999; right: 25px; bottom: 95px;
  display: flex; align-items: center; gap: 8px; padding: 12px 22px; border: 0; cursor: pointer;
  font: 500 15px/1.2 "Helvetica Neue", Arial, sans-serif; color: #1a1a1a; white-space: nowrap;
  background: #fff; border-radius: 20px 20px 4px 20px; box-shadow: 0 4px 18px rgba(0, 0, 0, .15);
  animation: float 3s ease-in-out infinite;
}
.chat-bubble::after { content: ""; position: absolute; bottom: -7px; right: 15px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.chat-bubble[hidden] { display: none; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .chat-bubble { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .location { grid-template-columns: 1fr; }
  .map iframe { min-height: 320px; }
}
@media (max-width: 700px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 0; padding-top: .5rem; padding-bottom: .5rem; }
  .logo { grid-column: 1; grid-row: 1; }
  .logo img { width: 80px; }
  .social-links { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; }
  .main-nav ul { gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
  .hero { min-height: 260px; }
  .form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   Página "Conócenos"
   ========================================================== */
:root { --blue-soft: #96acd0; --cream: #f7f2f2; --blob: #ffc836; }

.title-serif { font-family: var(--font-heading); font-size: 2.25rem; font-weight: 700; color: var(--green); text-align: center; }
.title-sans { font-family: "Source Sans 3", var(--font-body); font-size: 2.6rem; font-weight: 700; color: var(--navy); text-align: center; }

/* Hero */
.hero--home {
  min-height: 500px; background-color: var(--navy);
  background-image: url("../img/hero-conocenos.jpg");
  background-position: center 34%;
  padding-top: 4rem; /* baja el texto para no tapar los rostros */
}
/* Mismos tamaños de texto que el banner de Contacto */
.hero .hero-kicker { margin: 0; font-family: var(--font-heading); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.hero.hero--home h1 { margin-top: 1.25rem; font-family: var(--font-body); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; line-height: 1.6; }
.btn--hero { display: inline-block; width: auto; margin: 2rem 0 0; padding: 1.1rem 3.2rem; text-decoration: none; font-weight: 600; text-shadow: none; }

/* Bienvenida */
.welcome { padding: 5rem 0; }
.welcome p { max-width: 680px; margin: 1.25rem auto 0; text-align: center; }

/* Especialidades */
.specialties { padding: 4.5rem 0 5rem; background: var(--cream); }
.specialty-list { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 2rem; margin-top: 3.5rem; }
.specialty { display: flex; align-items: center; gap: 2.5rem; padding-left: 4.5rem; }
.specialty-icon { flex: none; width: 95px; height: auto; }
.specialty h3 { margin-bottom: .6rem; font-family: "Source Sans 3", var(--font-body); font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.specialty p { color: var(--navy); }

/* Únete al equipo */
.join-team { padding: 5rem 0; color: #fff; background: var(--blue-soft); }
.join-grid { display: grid; grid-template-columns: 1fr 3fr; gap: 3rem; align-items: end; max-width: 1280px; }
.join-photo { width: 100%; height: auto; border-radius: 20px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.join-content hr { width: 60px; margin: 0 0 1.5rem; border: 0; border-top: 1px solid #fff; }
.join-content h2 { margin-bottom: 1rem; font-family: "Source Sans 3", var(--font-body); font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 700; line-height: 1.4; }
.join-content h3 { margin: .75rem 0 1.5rem; font-size: 1.25rem; font-weight: 600; }
.join-content .form-group input,
.join-content .form-group textarea { background: #f6f6f6; border: 1px solid #5b3fd1; }
.join-content .form-group input[type="file"] { padding: .35rem; background: transparent; border: 0; }
.btn--right { display: block; width: 200px; margin: 1.5rem 0 0 auto; border: 1px solid #5b3fd1; font-weight: 600; }

/* Galería */
.gallery { padding: 1rem 0 5rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.gallery-grid img { display: block; width: 100%; aspect-ratio: 7 / 10; object-fit: cover; }

/* Banda amarilla */
.cta-band { padding: 5.5rem 0; text-align: center; color: #fff; background: var(--yellow); }
.cta-title { max-width: 620px; margin: 0 auto; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 400; line-height: 1.3; }
.cta-sub { margin-top: 1rem; font-weight: 600; }


@media (max-width: 900px) {
  .specialty { padding-left: 1rem; }
  .join-grid { grid-template-columns: 1fr; }
  .join-photo { max-width: 280px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .specialty-list { grid-template-columns: 1fr; }
  .specialty { gap: 1.5rem; }
  .title-sans { font-size: 2rem; }
}

/* ==========================================================
   Página "Inicio"
   ========================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Hero (el texto va a la derecha para no tapar el rostro de la foto) */
.hero--inicio {
  min-height: 520px; padding-top: 0;
  background-image: url("../img/hero-inicio.jpg"); /* foto con sus colores originales, sin filtro */
  background-position: center 30%;
}
/* El texto va sobre un panel propio (no sobre la foto) para que se lea sin teñirla */
.hero-text { max-width: 560px; margin-left: auto; padding: 2rem 2.25rem; background: rgba(24, 43, 84, .82); border-radius: 12px; text-shadow: none; }

/* Presentación */
.intro-section { padding: 5rem 0; }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.intro-text .title-serif { margin-bottom: 1.5rem; text-align: left; line-height: 1.2; }
.intro-text p + p { margin-top: 1rem; }
.intro-photo { justify-self: center; width: min(100%, 322px); height: auto; }

/* Especialidades */
.areas { padding: 4rem 0; background: var(--cream); }
.area-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; }
.area, .area-btn { display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.area img, .area-btn img { width: 70px; height: 70px; }
.area h3, .area-btn h3 { font-size: 1.1rem; font-weight: 600; color: var(--navy); }
.area-btn { width: 100%; padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.area-btn:hover img, .area-btn:focus-visible img { transform: scale(1.1); }
.area-btn img { transition: transform .2s; }
.area-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 6px; }
.area-hint { font-size: .8rem; color: var(--green); text-decoration: underline; }

/* Profesionales al pasar el mouse (o enfocar/tocar) sobre cada especialidad */
.area { position: relative; outline: none; cursor: default; }
.area svg { display: block; transition: transform .2s; }
.area:hover svg, .area:focus svg { transform: scale(1.08); }
.area:focus-visible { outline: 2px solid var(--navy); outline-offset: 6px; }

.area-pros {
  position: absolute; top: 100%; left: 50%; z-index: 20;
  width: 210px; margin-top: .25rem; padding: .9rem 1rem;
  text-align: left; font-size: .9rem; color: var(--text);
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.area-pros::before {
  content: ""; position: absolute; top: -6px; left: 50%;
  width: 12px; height: 12px; background: #fff;
  transform: translateX(-50%) rotate(45deg);
}
.area-pros-title { margin-bottom: .4rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--green); }
.area-pros li { padding: .15rem 0; font-weight: 500; color: var(--navy); }

.area:hover .area-pros,
.area:focus .area-pros,
.area:focus-within .area-pros { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.area:hover, .area:focus { z-index: 21; }
@media (prefers-reduced-motion: reduce) { .area-pros, .area svg { transition: none; } }

/* Servicios */
.services { padding: 4rem 0 5rem; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.service { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy); }
.service img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Efecto de leve acercamiento al pasar el mouse (el .service ya recorta con overflow: hidden) */
.service img { transition: transform .5s ease; will-change: transform; }
.service:hover img, .service:focus-within img { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .service img { transition: none; } } /* sin animación, pero el zoom se mantiene */
.service-caption {
  position: absolute; inset: auto 0 0; padding: 2.5rem 1rem 1rem; text-align: center; color: #fff;
  background: linear-gradient(0deg, rgba(24, 43, 84, .9), rgba(24, 43, 84, 0));
}
.service-caption h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: .03em; }
.service-btn { display: inline-block; margin-top: .6rem; padding: .35rem 1.2rem; font-size: .85rem; text-decoration: none; color: var(--navy); background: var(--yellow); }
.service-btn:hover { opacity: .9; }

/* Bono FONASA */
.bono { padding: 4.5rem 0 5rem; text-align: center; background: var(--cream); }
.bono hr { width: 80px; margin: 1.5rem auto; border: 0; border-top: 2px solid var(--yellow); }
.bono p { max-width: 640px; margin: 0 auto; }
.bono-links { display: flex; gap: .75rem; justify-content: center; margin: 1.5rem 0 2rem; }
.bono-links a { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; }
.bono-links img { display: block; width: 100%; height: 100%; }
.bono-links .social-mail img { width: 62%; height: 62%; filter: invert(1); }

/* Ventanas emergentes (profesionales) */
.pro-dialog { width: min(92vw, 380px); padding: 2rem; text-align: center; color: var(--text); border: 0; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.pro-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.pro-dialog h2 { margin-bottom: 1.25rem; font-family: var(--font-heading); font-size: 1.6rem; color: var(--green); }
.pro-dialog li { margin-bottom: .5rem; font-size: 1.1rem; font-weight: 600; color: var(--navy); }
.pro-dialog .btn { margin-top: 1.5rem; }

@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; }
  .area-list, .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .hero--inicio { min-height: 420px; }
  .hero-text { margin: 0 auto; padding: 1.5rem 1.25rem; text-align: center; }
  .area-list, .service-grid { grid-template-columns: 1fr; }
}
