/*
 * Sistema de diseño — Vilella Medical Center
 * Tokens, tipografía y componentes tomados del sitio institucional vilella.com.ar
 * (colores, escala tipográfica fluida y radios son los mismos que usa esa web).
 */

/* ===== FUENTES ===== */
@font-face {
  font-family: 'Miller Display';
  src: url('../font/fonnts.com-Miller_Display_Roman.woff2') format('woff2'),
       url('../font/fonnts.com-Miller_Display_Roman.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Miller Display';
  src: url('../font/fonnts.com-Miller_Display_Light.woff2') format('woff2'),
       url('../font/fonnts.com-Miller_Display_Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gill Sans';
  src: url('../font/Gill Sans Medium.woff2') format('woff2'),
       url('../font/Gill Sans Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gill Sans';
  src: url('../font/Gill Sans Light.woff2') format('woff2'),
       url('../font/Gill Sans Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ===== TOKENS ===== */
:root {
  --azul: #16254c;
  --gris-oscuro: #404040;
  --texto: #575756;
  --gris-78: #b7b7b7;
  --gris-72: #b5b5b5;
  --gris-95: #f0f0f0;
  --gris-medio: #ececeb;
  --gris-borde: #dfdfdf;
  --neutro-97: #f5f5f5;
  --blanco: #ffffff;

  --radio: 0.625rem;
  --cabecera-alto: 84px;

  /* escala fluida del sitio institucional */
  --texto-1: clamp(32px, calc(32px + (64 - 32) * ((100vw - 320px) / 1600)), 64px);
  --texto-2: clamp(20px, calc(20px + (32 - 20) * ((100vw - 320px) / 1600)), 32px);
  --texto-3: clamp(14px, calc(14px + (16 - 14) * ((100vw - 320px) / 1600)), 16px);
  --texto-4: clamp(16px, calc(16px + (24 - 16) * ((100vw - 320px) / 1600)), 24px);
  --texto-5: clamp(16px, calc(16px + (20 - 16) * ((100vw - 320px) / 1600)), 20px);
  --texto-7: clamp(24px, calc(24px + (40 - 24) * ((100vw - 320px) / 1600)), 40px);
  --texto-menu: clamp(13px, calc(13px + (15 - 13) * ((100vw - 320px) / 1600)), 15px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--blanco);
  color: var(--texto);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  font-weight: 300;
  font-size: var(--texto-3);
  line-height: 1.6;
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: 'Miller Display', Georgia, serif; font-weight: 300; line-height: 1.15; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

.contenedor {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Las secciones con ancla frenan debajo de la cabecera fija, no detrás de ella. */
section[id] { scroll-margin-top: calc(var(--cabecera-alto) + 16px); }

.seccion { padding: clamp(64px, 9vw, 140px) 0; }
.seccion--gris { background-color: var(--neutro-97); }
.seccion--medio { background-color: var(--gris-medio); }
.seccion--textura {
  background-color: var(--neutro-97);
  background-image: url('../img/vilella/pattern-1.webp');
  background-size: 900px auto;
}

.solo-lectores {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== TÍTULOS DE SECCIÓN (bloque de dos líneas) ===== */
.titulo { margin-bottom: clamp(32px, 4vw, 64px); }
.titulo__sobre {
  display: block;
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto);
}
.titulo__principal {
  display: block;
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-1);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--gris-oscuro);
}
.titulo--centrado { text-align: center; }

.bajada {
  max-width: 60ch;
  font-size: var(--texto-5);
  color: var(--texto);
}
.titulo--centrado + .bajada { margin-left: auto; margin-right: auto; text-align: center; }

/* ===== BOTONES ===== */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  background-color: var(--neutro-97);
  color: var(--texto);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  font-size: var(--texto-menu);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.boton:hover, .boton:focus-visible {
  background-color: var(--azul);
  border-color: var(--azul);
  color: var(--blanco);
}
.boton--principal {
  background-color: var(--azul);
  border-color: var(--azul);
  color: var(--blanco);
}
.boton--principal:hover, .boton--principal:focus-visible {
  background-color: transparent;
  color: var(--azul);
}
.boton--fantasma { background-color: transparent; }
.boton--bloque { display: flex; width: 100%; margin-top: 12px; }
.boton svg { width: 18px; height: 18px; fill: currentColor; }

.enlace-mas {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--texto);
  border-bottom: 1px solid var(--gris-78);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.enlace-mas:hover { color: var(--azul); border-color: var(--azul); }

/* ===== CABECERA ===== */
.cabecera {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gris-borde);
  transition: transform 0.3s ease;
}
/* En mobile, la cabecera se oculta mientras se ve el hero y reaparece al pasarlo (ver main.js). */
@media (max-width: 1023px) {
  .cabecera--oculta { transform: translateY(-100%); }
}
.cabecera__barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--cabecera-alto);
}
.cabecera__logo img { height: 46px; width: auto; }
.cabecera__nav { display: none; align-items: center; gap: clamp(18px, 2.4vw, 38px); margin-left: auto; }
.cabecera__enlace {
  font-size: var(--texto-menu);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--texto);
  transition: color 0.25s ease;
}
.cabecera__enlace:hover { color: var(--azul); }

/* Botón hamburguesa. Los iconos llevan pointer-events: none a propósito: si el
   toque cae sobre el <svg> hijo, el navegador móvil no sintetiza el click. */
.hamburguesa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--texto);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hamburguesa svg { width: 26px; height: 26px; pointer-events: none; }
.hamburguesa__cerrar { display: none; }
.hamburguesa[aria-expanded="true"] .hamburguesa__abrir { display: none; }
.hamburguesa[aria-expanded="true"] .hamburguesa__cerrar { display: block; }

.menu-movil {
  display: none;
  border-top: 1px solid var(--gris-borde);
  background-color: var(--blanco);
  padding: 12px 0 28px;
}
.menu-movil[data-abierto="true"] { display: block; }
.menu-movil a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--gris-95);
  font-size: var(--texto-5);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.menu-movil .boton { display: flex; margin-top: 24px; border-bottom: 0; }

@media (min-width: 1024px) {
  .cabecera__nav { display: flex; }
  .hamburguesa { display: none; }
  .menu-movil { display: none !important; }
  .cabecera__logo img { height: 54px; }
}

/* ===== HERO ===== */
.hero { padding-top: var(--cabecera-alto); background-color: var(--blanco); }
.hero__grilla { display: grid; grid-template-columns: 1fr; }
.hero__marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: clamp(40px, 7vw, 80px) 24px;
}
.hero__isotipo { width: clamp(150px, 20vw, 240px); }
.hero__lema {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--gris-78);
  font-size: var(--texto-3);
  letter-spacing: 0.04em;
}
.hero__foto { position: relative; }
.hero__foto img { width: 100%; height: 100%; object-fit: cover; }
.hero__credito {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 6px 12px;
  background-color: rgba(22, 37, 76, 0.75);
  color: var(--blanco);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .hero__grilla { grid-template-columns: 38% 62%; align-items: stretch; }
  .hero__foto { min-height: min(76vh, 720px); }
}

/* ===== LLAMADA PRINCIPAL ===== */
.llamada { padding: clamp(56px, 8vw, 110px) 0 0; text-align: center; }
.llamada__titulo {
  font-size: var(--texto-1);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--gris-oscuro);
}
.llamada__texto { margin: 24px auto 40px; max-width: 52ch; font-size: var(--texto-5); }
.llamada__botones { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.llamada__botones .boton { min-width: 260px; }

/* Línea vertical con punto, igual que la del sitio institucional. */
.hilo { display: flex; flex-direction: column; align-items: center; padding: 48px 0 0; }
.hilo__linea { width: 1px; height: clamp(60px, 9vw, 120px); background-color: var(--gris-78); }
.hilo__punto { width: 9px; height: 9px; border: 1px solid var(--gris-78); border-radius: 50%; }

/* ===== TARJETAS ===== */
.grilla-tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.tarjeta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 26px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  background-color: var(--blanco);
  text-align: center;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.tarjeta:hover { border-color: var(--azul); transform: translateY(-4px); }
.tarjeta__icono { width: 54px; height: 54px; object-fit: contain; }
.tarjeta__titulo {
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-4);
  color: var(--gris-oscuro);
}
.tarjeta__texto { margin: 0; font-size: var(--texto-3); }
.tarjeta .enlace-mas { margin-top: auto; padding-top: 12px; }

/* Con 6 servicios, tres columnas cierran la grilla en dos filas parejas. */
@media (min-width: 1100px) {
  .grilla-tarjetas { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* ===== CENTRO MÉDICO / CIFRAS ===== */
.centro { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.centro__foto img { width: 100%; border-radius: var(--radio); }
.cifras { display: grid; gap: 26px; }
.cifra { display: grid; gap: 4px; }
.cifra__numero {
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-7);
  color: var(--azul);
}
.cifra__detalle { margin: 0; font-size: var(--texto-3); }

/* En mobile las cifras se ocultan: apiladas alargan demasiado la sección. */
@media (max-width: 767px) {
  .cifras { display: none; }
}

@media (min-width: 900px) {
  .centro { grid-template-columns: 1fr 1fr; }
  .cifras { grid-template-columns: repeat(2, 1fr); gap: 36px; }
}


/* ===== BANDA DE CIERRE ===== */
.cierre { position: relative; color: var(--blanco); }
.cierre__foto { position: absolute; inset: 0; }
.cierre__foto img { width: 100%; height: 100%; object-fit: cover; }
.cierre__velo { position: absolute; inset: 0; background-color: rgba(22, 37, 76, 0.7); }
.cierre__contenido { position: relative; padding: clamp(64px, 8vw, 120px) 0; text-align: center; }
.cierre__titulo { font-size: var(--texto-1); text-transform: uppercase; color: var(--blanco); }
.cierre__texto { margin: 16px 0 32px; font-size: var(--texto-5); }

/* ===== ÁREAS DESTACADAS (foto + texto alternados) ===== */
.area { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.area + .area { margin-top: clamp(48px, 6vw, 96px); }
.area__foto img { width: 100%; border-radius: var(--radio); }
.area__titulo { font-size: var(--texto-7); color: var(--gris-oscuro); margin-bottom: 16px; }
.area__texto { font-size: var(--texto-3); max-width: 56ch; }
.area__dato {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: var(--radio);
  background-color: var(--gris-medio);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .area { grid-template-columns: 1fr 1fr; }
  .area--invertida .area__foto { order: 2; }
}

/* ===== BANDA HISTÓRICA ===== */
.historia { position: relative; color: var(--blanco); }
.historia__foto { position: absolute; inset: 0; }
.historia__foto img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.historia__velo { position: absolute; inset: 0; background-color: rgba(22, 37, 76, 0.62); }
.historia__contenido {
  position: relative;
  padding: clamp(72px, 10vw, 150px) 0;
  text-align: center;
}
.historia__anio {
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-2);
  letter-spacing: 0.3em;
}
.historia__titulo {
  font-size: var(--texto-1);
  text-transform: uppercase;
  color: var(--blanco);
  margin: 8px 0 16px;
}
.historia__pie { margin: 0; font-size: var(--texto-5); letter-spacing: 0.06em; }

/* ===== CONTACTO ===== */
.contacto { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 64px); }
.mapa { position: relative; padding-bottom: 62%; border-radius: var(--radio); overflow: hidden; }
.mapa iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.horarios { display: grid; gap: 20px; }
.horario__nombre {
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-4);
  color: var(--gris-oscuro);
}
.horario p { margin: 0; font-size: var(--texto-3); }

@media (min-width: 900px) { .contacto { grid-template-columns: 1.15fr 0.85fr; } }

/* ===== PIE ===== */
.pie { background-color: var(--gris-medio); padding: clamp(48px, 6vw, 80px) 0 32px; }
.pie__grilla { display: grid; grid-template-columns: 1fr; gap: 32px; }
.pie__logo { width: 190px; margin-bottom: 18px; }
.pie__titulo {
  font-family: 'Miller Display', Georgia, serif;
  font-size: var(--texto-4);
  color: var(--gris-oscuro);
  margin-bottom: 12px;
}
.pie p { margin: 0 0 8px; font-size: var(--texto-3); }
.pie strong { font-weight: 500; }
.redes { display: flex; gap: 12px; margin-top: 16px; }
.redes a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gris-78);
  border-radius: var(--radio);
  color: var(--texto);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.redes a:hover { background-color: var(--azul); border-color: var(--azul); color: var(--blanco); }
.redes svg { width: 18px; height: 18px; fill: currentColor; }
.pie__legal {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gris-78);
  font-size: 12px;
  text-align: center;
}

@media (min-width: 768px) { .pie__grilla { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pie__grilla { grid-template-columns: 1.2fr 1fr 1fr 1fr; } }

/* Orden prolijo del pie en mobile: bloques centrados y separados por líneas divisorias
   con el mismo ritmo de espaciado (28px) entre todas, incluida la línea final. */
@media (max-width: 767px) {
  .pie { padding-bottom: 48px; }
  .pie__grilla { gap: 0; text-align: center; }
  .pie__grilla > div { padding: 28px 0; border-top: 1px solid var(--gris-78); }
  .pie__grilla > div:first-child { padding-top: 0; border-top: 0; }
  .pie__logo { margin-left: auto; margin-right: auto; }
  .redes { justify-content: center; }
  .pie__legal { margin-top: 28px; padding-top: 28px; }
}

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--azul);
  color: var(--blanco);
  box-shadow: 0 6px 20px rgba(22, 37, 76, 0.28);
  transition: transform 0.25s ease;
}
.whatsapp:hover { transform: scale(1.06); }
.whatsapp svg { width: 28px; height: 28px; fill: currentColor; pointer-events: none; }

/* ===== BOTÓN "SOLICITAR TURNO" FLOTANTE (mobile) ===== */
.boton-flotante {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 95;
  box-shadow: 0 10px 28px rgba(22, 37, 76, 0.32);
  transition: transform 0.3s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.boton-flotante--oculto { transform: translateX(-50%) translateY(160%); }
@media (min-width: 1024px) { .boton-flotante { display: none; } }

/* ===== FORMULARIO (turnovilella.html) ===== */
.form-card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  background-color: var(--blanco);
}
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--texto-3);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--texto);
}
.form-input, .form-select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  background-color: var(--blanco);
  color: var(--texto);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  font-size: var(--texto-3);
  font-weight: 300;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(22, 37, 76, 0.08);
}
.campo { margin-bottom: 20px; }
.hidden-iframe { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
