/* Base compartida (Home y Agendar): reset, utilidades, nav, botones, footer */

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #ffffff; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; }
a:hover { opacity: .85; }

/* contenedor de página: tipografía base y recorte de desbordes decorativos (flores, átomo) */
.site {
  font-family: var(--dua-font-sans);
  color: var(--dua-marino);
  background: #ffffff;
  width: 100%;
  overflow: clip;
}

.mono { font-family: var(--dua-font-mono); text-transform: uppercase; letter-spacing: .08em; }
.sig { font-family: var(--dua-font-firma); font-weight: 400; letter-spacing: 0; text-transform: none; }
.wrap {
  max-width: var(--dua-wrap-max);
  margin: 0 auto;
  padding-left: var(--dua-wrap-pad);
  padding-right: var(--dua-wrap-pad);
  box-sizing: border-box;
}

/* degradados de marca (archivo + color de respaldo) */
.g-calido { background: #9b1d4a url(../backgrounds/gradiente-calido.svg) center / cover no-repeat; }
.g-aura { background: #c81a5c url(../backgrounds/gradiente-aura.svg) center / cover no-repeat; }

/* grano sobre degradados (opacidad por elemento con --grain, 0.28–0.5) */
.grain { position: relative; isolation: isolate; }
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: url(../backgrounds/grano.svg) 0 0 / 240px 240px repeat;
  mix-blend-mode: overlay; opacity: var(--grain, .5);
}

/* vidrio */
.glass {
  background: rgba(255, 255, 255, .52);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 24px 60px -28px rgba(48, 49, 79, .28);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: -9999px; top: 16px; z-index: 1100; padding: 12px 18px; border-radius: 999px;
  background: var(--dua-marino); color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;
}
.skip-link:focus { left: 16px; }

/* foco visible coherente (el color sigue al texto del elemento) */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible { outline-color: var(--dua-marino); outline-offset: 2px; }

/* ===================== NAV ===================== */
/* Variables del hero: claro por defecto; la variante B las redefine en home.css */
:root {
  --hero-ink: var(--dua-marino);
  --hero-sig: var(--dua-rosa-firma);
  --hero-lead: var(--dua-texto-2);
  --hero-cta-bg: var(--dua-cta);
  --hero-cta-fg: #ffffff;
}

.nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
  padding-top: 26px;
  padding-bottom: 26px;
}
.nav a { text-decoration: none; }
.nav__side { display: flex; gap: 28px; font-size: 11px; font-weight: 500; color: var(--hero-ink); transition: color .5s ease; }
.nav__side--left { justify-self: start; }
.nav__side--right { justify-self: end; }
.nav__pending { cursor: default; }
.nav__logo { display: grid; justify-self: center; }
.nav__logo img { grid-area: 1 / 1; height: 52px; width: auto; display: block; }
.nav__logo-b { opacity: 0; transition: opacity .5s ease; }
.nav__logo-a { transition: opacity .5s ease; }
[data-hero="b"] .nav__logo-b { opacity: 1; }
[data-hero="b"] .nav__logo-a { opacity: 0; }
.nav__end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 28px; }
.nav__cta {
  display: flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  border-color: rgba(48, 49, 79, .14); font-size: 15px; font-weight: 500; white-space: nowrap; box-sizing: border-box;
  color: var(--hero-ink); transition: color .5s ease;
}
.nav__toggle { display: none; }
.nav__menu { display: none; }

@media (max-width: 900px) {
  .nav__side { display: none; }
  .nav__toggle {
    display: flex; align-items: center; justify-content: center; justify-self: start;
    width: 44px; height: 44px; margin-left: -10px; padding: 0; border: 0; border-radius: 999px; background: none;
    color: var(--hero-ink); cursor: pointer; transition: color .5s ease;
  }
  .nav__toggle-bars { position: relative; display: block; width: 22px; height: 14px; }
  .nav__toggle-bars::before, .nav__toggle-bars::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .3s var(--dua-ease-hover), top .3s var(--dua-ease-hover);
  }
  .nav__toggle-bars::before { top: 1px; }
  .nav__toggle-bars::after { top: 11px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { top: 6px; transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { top: 6px; transform: rotate(-45deg); }
  .nav__menu {
    position: absolute; left: var(--dua-wrap-pad); right: var(--dua-wrap-pad); top: calc(100% - 8px); z-index: 20;
    display: flex; flex-direction: column; padding: 8px 20px 20px; border-radius: 28px;
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 30px 60px -28px rgba(48, 49, 79, .45);
    color: var(--dua-marino);
    opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top center; visibility: hidden; pointer-events: none;
    transition: opacity .25s ease, transform .25s var(--dua-ease-hover), visibility 0s linear .25s;
  }
  .nav__menu.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .nav__menu a, .nav__menu .nav__pending {
    display: flex; align-items: center; min-height: 52px; font-size: 12px; font-weight: 500;
    border-bottom: 1px solid var(--dua-linea-suave); text-decoration: none;
  }
  .nav__menu .nav__pending { color: var(--dua-texto-3); }
  .nav__menu .nav__menu-cta {
    justify-content: center; gap: 10px; min-height: 54px; margin-top: 16px; border: 0; border-radius: 999px;
    background: var(--dua-cta); color: #ffffff; font-family: var(--dua-font-sans); font-size: 16px; letter-spacing: 0; text-transform: none;
  }
}
@media (max-width: 640px) {
  .nav__end .nav__cta { display: none; }
  .nav { padding-top: 18px; padding-bottom: 18px; }
}

/* ===================== BOTONES ===================== */
.btn-glass {
  display: flex; align-items: center; min-height: 54px; padding: 0 28px; border-radius: 999px;
  border-color: rgba(48, 49, 79, .16); font-size: 16px; font-weight: 500; text-decoration: none; box-sizing: border-box;
}
.btn-cta {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 28px; border-radius: 999px;
  background-color: var(--hero-cta-bg); color: var(--hero-cta-fg); font-size: 16px; font-weight: 500; text-decoration: none; box-sizing: border-box;
  transition: background-color .5s ease, color .5s ease;
}
.btn-cta svg { flex: none; }

/* ===================== FOOTER ===================== */
.footer { background: var(--dua-marino); color: #ffffff; border-radius: var(--dua-r-seccion) var(--dua-r-seccion) 0 0; }
.footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .18); font-size: 10px; font-weight: 500; color: var(--dua-footer-texto-2);
}
.footer a { text-decoration: none; }

/* ===================== SWITCH DE VERSION DEL HERO (revisión con cliente) ===================== */
.hero-switch {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 900;
  display: none; align-items: center; gap: 10px; padding: 5px 5px 5px 16px; border-radius: 999px;
  background: var(--dua-marino); color: #d4d5e4; border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 14px 34px -12px rgba(20, 21, 40, .65), 0 2px 6px rgba(20, 21, 40, .25);
  visibility: hidden; transform: translateY(10px);
  transition: transform .5s var(--dua-ease-hover);   /* sin fundido de opacidad: mezclaría los colores y falsearía el contraste medido */
}
.js .hero-switch { display: flex; }
.hero-switch.is-ready { visibility: visible; transform: none; }
.hero-switch__label { font-size: 10px; font-weight: 600; color: #d4d5e4; white-space: nowrap; }
.hero-switch__seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.hero-switch__thumb {
  position: absolute; top: 0; bottom: 0; left: 0; width: 50%; border-radius: 999px; background: var(--dua-cta);
  transition: transform .4s var(--dua-ease-hover), background-color .4s ease;
}
.hero-switch[data-active="b"] .hero-switch__thumb { transform: translateX(100%); background: var(--dua-amarillo-limon); }
.hero-switch__opt {
  position: relative; z-index: 1; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none;
  color: #d4d5e4; font: 500 13px/1 var(--dua-font-sans); white-space: nowrap; cursor: pointer; transition: color .4s ease;
}
.hero-switch__opt[aria-pressed="true"] { color: #ffffff; }
.hero-switch[data-active="b"] .hero-switch__opt[aria-pressed="true"] { color: var(--dua-marino); }
.hero-switch :focus-visible { outline-color: #ffffff; outline-offset: 2px; }
@media (pointer: coarse) { .hero-switch__opt { min-height: 44px; } }
/* Netlify (plan Free) pone una insignia de 197 x 64 px abajo a la derecha: en pantallas angostas el switch sube para no taparse con ella */
@media (max-width: 479px) {
  .hero-switch { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 72px); }
}
@media (max-width: 560px) {
  .hero-switch { padding-left: 5px; gap: 0; }
  .hero-switch__label { display: none; }
  .hero-switch__opt { padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav__side, .nav__cta, .nav__logo-a, .nav__logo-b, .btn-cta, .nav__toggle,
  .hero-switch, .hero-switch__thumb, .hero-switch__opt, .nav__menu { transition: none; }
}
