/* ==========================================================
   QUEKO — base.css
   Estilos compartidos por todas las páginas (mobile first).
   Requiere variables.css antes.
   ========================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-texto);
  color: var(--texto-2);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--texto); font-weight: var(--peso-bold); }

/* ---------- Layout ---------- */
.contenedor {
  width: 100%;
  max-width: var(--contenedor);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.seccion { padding: var(--seccion-y) 0; }

/* Bloques de color (alternan con blanco) */
.bloque-azul  { background: var(--azul); color: var(--texto-inverso-2); }
.bloque-tinta { background: var(--tinta); color: var(--texto-inverso-2); }
.bloque-gris  { background: var(--gris-fondo); }
.bloque-azul :is(h1, h2, h3),
.bloque-tinta :is(h1, h2, h3) { color: var(--texto-inverso); }

/* ---------- Tipografía ---------- */
.titulo-1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-titulo);
  letter-spacing: var(--ls-titulo);
}
.titulo-2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-titulo);
  letter-spacing: var(--ls-titulo);
}
.titulo-3 {
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.texto-grande { font-size: 1.125rem; max-width: 36em; }

/* Highlight (Manual v1.2): una palabra en itálica con marcador en el 30 % inferior.
   Sobre blanco/gris = azul · sobre azul o tinta = lima. */
.resaltado,
.resaltado-caja {
  font-style: italic;
  background-image: var(--highlight);
  padding: 0 0.05em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
:is(.bloque-azul, .bloque-tinta) :is(.resaltado, .resaltado-caja) { background-image: var(--highlight-lima); }

/* Etiqueta mono y numeración 01, 02, 03 */
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--azul);
  margin-bottom: var(--esp-4);
}
.etiqueta .num {
  display: inline-grid;
  place-items: center;
  min-width: 2.2em;
  height: 2.2em;
  border-radius: var(--radio-pill);
  background: var(--azul);
  color: var(--texto-inverso);
}
.bloque-azul .etiqueta,
.bloque-tinta .etiqueta { color: var(--texto-inverso); }
:is(.bloque-azul, .bloque-tinta) .etiqueta .num { background: var(--lima); color: var(--tinta); }

.encabezado-seccion { margin-bottom: var(--esp-7); max-width: var(--contenedor-texto); }
.encabezado-seccion .titulo-2 { margin-bottom: var(--esp-4); }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-2);
  min-height: 48px;
  padding: 0 var(--esp-5);
  border: 0;
  border-radius: var(--radio);
  font: var(--peso-semi) var(--fs-body)/1 var(--font-base);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.boton:hover { transform: translateY(-1px); }
.boton-azul   { background: var(--azul); color: var(--texto-inverso); }
.boton-blanco { background: var(--blanco); color: var(--azul); }
/* Botones secundarios: verde lima con texto tinta (Manual v1.2) */
.boton-borde,
.boton-borde-inverso { background: var(--lima); color: var(--tinta); }
.boton-borde:hover,
.boton-borde-inverso:hover { filter: brightness(0.94); }

/* ---------- Header / menú ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
}
.header .contenedor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.header-logo img { height: 38px; width: auto; }

.menu-boton {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radio);
  background: var(--azul);
  color: var(--texto-inverso);
  cursor: pointer;
}
.menu-boton span,
.menu-boton span::before,
.menu-boton span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.menu-boton span::before { position: absolute; top: -6px; }
.menu-boton span::after  { position: absolute; top: 6px; }

.menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--blanco);
  border-bottom: 1px solid var(--borde);
  padding: var(--esp-3) var(--gutter) var(--esp-5);
}
.menu.abierto { display: block; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a {
  display: block;
  padding: var(--esp-3) 0;
  font-weight: var(--peso-semi);
  font-size: 1.125rem;
  color: var(--texto);
  border-bottom: 1px solid var(--borde);
}
.menu a[aria-current="page"] { color: var(--azul); }

@media (min-width: 900px) {
  .menu-boton { display: none; }
  .menu {
    display: block;
    position: static;
    padding: 0;
    border: 0;
    background: none;
  }
  .menu ul { display: flex; align-items: center; gap: var(--esp-6); }
  .menu a { padding: 0; border: 0; font-size: var(--fs-body); }
  .menu a:hover { color: var(--azul); }
  .menu li:last-child a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--esp-5);
    border-radius: var(--radio);
    background: var(--azul);
    color: var(--texto-inverso);
  }
}

/* ---------- Imágenes ---------- */
.foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radio-l);
}
/* Íconos (SVG como máscara para tomar el color del texto).
   La imagen se pone en el HTML: style="mask-image:url(...)" */
.icono {
  display: block;
  width: 48px;
  height: 48px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

/* ---------- Formulario ---------- */
.formulario {
  display: grid;
  gap: var(--esp-4);
  padding: var(--esp-6) var(--esp-5);
  background: var(--blanco);
  border-radius: var(--radio-l);
  box-shadow: 0 1px 0 var(--borde), 0 24px 48px -24px rgba(14, 17, 22, 0.25);
}
.formulario .titulo-3 { margin-bottom: var(--esp-1); font-weight: var(--peso-bold); color: var(--texto); }
.campo { display: grid; gap: var(--esp-1); }
.campo label { font-size: var(--fs-small); font-weight: var(--peso-semi); color: var(--texto); }
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--esp-3) var(--esp-4);
  border: 1.5px solid var(--borde-fuerte);
  border-radius: var(--radio);
  background: var(--blanco);
  font: inherit;
  color: var(--texto);
}
.campo textarea { min-height: 110px; resize: vertical; }
.campo :is(input, select, textarea):focus { outline: none; border-color: var(--azul); }
.formulario .boton { width: 100%; }
.formulario-nota { font-size: var(--fs-small); color: var(--texto-suave); }
.formulario-aviso {
  display: none;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--radio);
  background: var(--gris-fondo);
  font-size: var(--fs-small);
  color: var(--texto-2);
}
.formulario-aviso.visible { display: block; }
.formulario-aviso.ok    { background: rgba(18, 166, 107, 0.12); color: #0b6b45; }
.formulario-aviso.error { background: rgba(214, 48, 49, 0.10); color: #a32020; }
.formulario .boton[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.campo .opcional { font-weight: var(--peso-regular); color: var(--texto-suave); }

/* ---------- Footer ---------- */
.footer { background: var(--tinta); color: var(--texto-inverso-2); padding: var(--esp-8) 0 var(--esp-6); }
.footer-grid { display: grid; gap: var(--esp-6); }
.footer-logo img { height: 40px; width: auto; }
.footer-texto { margin-top: var(--esp-4); max-width: 22em; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--esp-2); }
.footer a:hover { color: var(--lima); }
.footer-titulo { font-family: var(--font-mono); font-size: var(--fs-label); text-transform: uppercase; color: var(--texto-inverso); margin-bottom: var(--esp-3); }
.footer-legal { margin-top: var(--esp-7); padding-top: var(--esp-5); border-top: 1px solid var(--borde-inverso); font-size: var(--fs-small); }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-flotante {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-2);
  width: 56px;
  height: 56px;
  border-radius: var(--radio-pill);
  background: var(--whatsapp);
  color: var(--blanco);
  font-weight: var(--peso-semi);
  box-shadow: 0 10px 24px -8px rgba(14, 17, 22, 0.45);
  transition: transform .15s ease;
}
.whatsapp-flotante:hover { transform: translateY(-2px); }
.whatsapp-flotante svg { width: 28px; height: 28px; flex: none; }
.whatsapp-flotante span { display: none; }
@media (min-width: 900px) {
  .whatsapp-flotante { width: auto; padding: 0 var(--esp-5) 0 var(--esp-4); right: var(--esp-6); bottom: var(--esp-6); }
  .whatsapp-flotante span { display: inline; }
}
/* Espacio para que el botón no tape el pie en celular */
.footer { padding-bottom: calc(var(--esp-6) + 64px); }
@media (min-width: 900px) { .footer { padding-bottom: var(--esp-6); } }
