/* ============================================
   Consultorio Odontológico — estilos globales
   Mobile first · variables · accesibilidad básica
   ============================================ */

:root {
  /* Paleta salud / odontología */
  --color-bg: #f5fafc;
  --color-surface: #ffffff;
  --color-ice: #e8f4fc;
  --color-sky: #7dd3fc;
  --color-primary: #0369a1;
  --color-primary-dark: #0c4a6e;
  --color-accent: #0284c7;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-whatsapp: #25d366;
  --color-whatsapp-hover: #1ebe57;

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(12, 74, 110, 0.08);
  --shadow-md: 0 8px 30px rgba(12, 74, 110, 0.12);
  --header-h: 64px;
  --transition: 0.22s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

address {
  font-style: normal;
}

.container {
  width: min(100% - 1.5rem, 1100px);
  margin-inline: auto;
}

/* ========== Header / Nav ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(3, 105, 161, 0.08);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.nav__logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__logo:hover {
  text-decoration: none;
  color: var(--color-primary);
}

.nav__logo-accent {
  color: var(--color-primary);
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: var(--color-ice);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.nav__toggle:hover {
  background: #d4ebf7;
}

.nav__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Menú móvil: fixed = ancho completo (el .nav va dentro de .container) */
.nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: 1rem min(1.5rem, 5vw) 1.25rem;
  border-bottom: 1px solid rgba(3, 105, 161, 0.1);
  box-shadow: var(--shadow-md);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.25s;
  z-index: 99;
}

.nav__menu.is-open {
  max-height: 480px;
  opacity: 1;
  visibility: visible;
}

.nav__link {
  display: block;
  padding: 0.65rem 0.75rem;
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.nav__link:hover {
  background: var(--color-ice);
  color: var(--color-primary);
  text-decoration: none;
}

/* Hamburguesa → X cuando abierto */
.nav__toggle.is-open .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.is-open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-open .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop: barra horizontal */
@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__menu {
    position: static;
    z-index: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .nav__link {
    padding: 0.5rem 0.85rem;
  }
}

/* ========== Botones ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn__icon {
  flex-shrink: 0;
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn--whatsapp:hover {
  background: var(--color-whatsapp-hover);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn--outline {
  background: var(--color-surface);
  color: var(--color-primary-dark);
  border-color: rgba(3, 105, 161, 0.35);
  box-shadow: var(--shadow-sm);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  background: var(--color-ice);
  color: var(--color-primary-dark);
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid rgba(3, 105, 161, 0.25);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--color-ice);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.btn--lg {
  padding: 0.85rem 1.35rem;
  font-size: 1rem;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding-block: 2.5rem 3rem;
  overflow: hidden;
}

/* Fondo del hero: foto + degradado de respaldo si la imagen tarda o falla */
.hero__bg {
  position: absolute;
  inset: 0;
  background-color: #e0f2fe;
  background-image:
    linear-gradient(165deg, rgba(224, 242, 254, 0.3) 0%, rgba(240, 249, 255, 0.2) 100%),
    url("assets/img/hero-principal.jpg");
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  /* Degradado: texto legible a la izquierda, foto visible a la derecha */
  background: linear-gradient(
    105deg,
    rgba(248, 251, 252, 0.96) 0%,
    rgba(248, 251, 252, 0.88) 32%,
    rgba(240, 249, 255, 0.55) 52%,
    rgba(12, 74, 110, 0.2) 100%
  );
  z-index: 1;
}

@media (min-width: 768px) {
  .hero__bg {
    background-position: center 22%;
  }

  .hero__overlay {
    background: linear-gradient(
      105deg,
      rgba(248, 251, 252, 0.94) 0%,
      rgba(248, 251, 252, 0.78) 36%,
      rgba(240, 249, 255, 0.35) 55%,
      rgba(12, 74, 110, 0.12) 100%
    );
  }
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-primary-dark);
  margin: 0 0 1rem;
  max-width: 22ch;
}

.hero__subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
  max-width: 42ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .hero__actions .btn {
    flex: 0 1 auto;
  }
}

/* ========== Secciones genéricas ========== */
.section {
  padding-block: 3rem;
}

.section__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section__title--light {
  color: #fff;
}

.section__lead {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* ========== Servicios ========== */
.services {
  background: var(--color-surface);
}

.services__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .services__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.services__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: linear-gradient(180deg, #ffffff 0%, var(--color-ice) 100%);
  border: 1px solid rgba(3, 105, 161, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.services__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(3, 105, 161, 0.2);
}

.services__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(3, 105, 161, 0.1);
  color: var(--color-primary);
  margin-bottom: 0.85rem;
}

.services__name {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.services__desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* Imagen de instrumental entre texto y grilla (evita CLS con aspect-ratio) */
.services__visual {
  margin: 0 0 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(3, 105, 161, 0.1);
  aspect-ratio: 16 / 9;
  width: 100%;
  margin-inline: auto;
}

.services__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.services__visual:hover img {
  transform: scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
  .services__visual:hover img {
    transform: none;
  }
}

/* ========== Zonas de atención ========== */
.zones {
  background: var(--color-bg);
  border-block: 1px solid rgba(3, 105, 161, 0.08);
}

.zones__inner {
  max-width: 40rem;
}

.zones__text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.zones__text strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ========== Preguntas frecuentes ========== */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.faq__item {
  background: var(--color-surface);
  border: 1px solid rgba(3, 105, 161, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.faq__q {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.faq__a {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ========== Sobre nosotros ========== */
.about {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}

.about__layout {
  display: grid;
  gap: 2rem;
  align-items: center;
  max-width: 960px;
  margin-inline: auto;
}

.about__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  aspect-ratio: 4 / 3;
  width: min(100%, 440px);
  margin-inline: auto;
}

.about__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.about__copy {
  text-align: center;
}

.about__text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  opacity: 0.95;
}

@media (min-width: 768px) {
  .about__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 2.5rem;
    max-width: none;
  }

  .about__media {
    width: 100%;
    margin-inline: 0;
  }

  .about__copy {
    text-align: left;
  }
}

/* ========== Contacto ========== */
.contact {
  background: var(--color-bg);
}

.contact__grid {
  display: grid;
  gap: 1.5rem;
}

.contact__card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(3, 105, 161, 0.08);
}

.contact__layout {
  display: grid;
  gap: 1.15rem;
  justify-items: center;
}

.contact__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin: 0 0 0.35rem;
}

.contact__value {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  color: var(--color-text);
}

.contact__value a {
  color: inherit;
  font-weight: 600;
}

.contact__value a:hover {
  color: var(--color-primary);
}

.contact__map-wrap {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(3, 105, 161, 0.15);
  box-shadow: var(--shadow-sm);
  background: #dbeafe;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}

.contact__map {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}

.contact__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1rem;
}

.btn--contact {
  padding: 0.62rem 1rem;
  font-size: 0.875rem;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

@media (min-width: 480px) {
  .contact__map {
    height: 250px;
  }
}

@media (min-width: 900px) {
  .contact__layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
    gap: 1.5rem;
    align-items: start;
    justify-items: stretch;
  }

  .contact__value:last-of-type {
    margin-bottom: 0;
  }
}

/* ========== Footer ========== */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.88);
  padding-block: 2rem;
  text-align: center;
  font-size: 0.9375rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer__name {
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.footer__line {
  margin: 0;
}

.footer a {
  color: #bae6fd;
}

.footer a:hover {
  color: #fff;
}

/* ========== FAB WhatsApp ========== */
.fab-wa {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.fab-wa:hover {
  transform: scale(1.06);
  background: var(--color-whatsapp-hover);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
  text-decoration: none;
}

/* Botón volver arriba: mismo tamaño/huella que WhatsApp */
.fab-top {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + 56px + 0.75rem);
  z-index: 89;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition), visibility var(--transition);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fab-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fab-top:hover {
  transform: scale(1.06);
  background: var(--color-primary-dark);
  box-shadow: 0 8px 28px rgba(12, 74, 110, 0.35);
}

.fab-top:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.75);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .fab-top {
    right: 1.5rem;
    bottom: calc(1.5rem + 60px + 0.9rem);
    width: 60px;
    height: 60px;
  }

  .fab-wa {
    right: 1.5rem;
    bottom: 1.5rem;
    width: 60px;
    height: 60px;
  }
}

/* ========== Animaciones ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.7s ease forwards;
  opacity: 0;
}

.fade-in--delay-1 {
  animation-delay: 0.12s;
}

.fade-in--delay-2 {
  animation-delay: 0.24s;
}

.fade-in--delay-3 {
  animation-delay: 0.36s;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
