/* Care For Me · estilos compartidos (index.html y quiz.html) · v3 "vidrio olivo"
   Paleta Care For Me sobre fondo olivo profundo, resplandores difusos, tarjetas redondeadas
   y botones en píldora. Gloock para nombres de ritual y precios; Jost para todo lo demás. */

/* ===================== Fuentes locales ===================== */
@font-face { font-family: "Gloock"; src: url("../fonts/Gloock-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-VF.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/Caveat-VF.ttf") format("truetype"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ===================== Tokens ===================== */
:root {
  /* Paleta de marca */
  --olivo: #3D4A38;
  --olivo-noche: #2B3427;
  --olivo-linea: #5A6650;
  --leche: #F6EFE6;
  --arena: #EADBC8;
  --piel: #D9B4A0;
  --barro: #3A2A22;
  --barro-suave: #6B5649;
  --terracota: #9E4F33;
  --on-terracota: #FBF6EF;
  --terracota-claro: #EBA98F;
  --salvia: #6E6D4E;
  --linea: #CDB8A5;

  /* Fondo y vidrio */
  --fondo: #1D2219;
  --texto: #F6EFE6;
  --texto-2: #C9C0B0;
  --texto-3: #A39C8C;
  --vidrio: rgba(246, 239, 230, 0.07);
  --vidrio-fuerte: rgba(246, 239, 230, 0.12);
  --borde-vidrio: rgba(246, 239, 230, 0.12);
  --sombra-oscura: rgba(20, 24, 17, 0.82);
  --acento: #EBA98F;
  --on-acento: #1D2219;

  /* Tintas fijas sobre cartulina */
  --tinta-oscura: #3A2A22;
  --tinta-clara: #F6EFE6;

  --ritual-calma: #E3B3AE;
  --ritual-luz: #EFE7D8;
  --ritual-renueva: #6B2631;
  --ritual-firmeza: #D6CCC0;
  --ritual-nutre: #C9A07A;
  --ritual-purifica: #2E2A28;
  --ritual-despierta: #A3A96B;
  --ritual-detox: #5E6B66;

  --font-display: "Gloock", "Bodoni Moda", Didot, Georgia, serif;
  --font-sans: "Jost", "Futura PT", Futura, "Century Gothic", system-ui, sans-serif;
  --font-mano: "Caveat", "Segoe Print", cursive;

  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px;
  --space-5: 40px; --space-6: 64px; --space-7: 96px;

  --r-sm: 12px; --r-md: 18px; --r-lg: 24px; --r-xl: 32px; --r-pill: 999px;

  --ancho: 1200px;
  --margen: 16px;
  --alto-cabecera: 64px;
  --alto-franja: 28px;
  --velocidad: 0.25s;
  --suave: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-cabecera) + var(--alto-franja) + 12px);
  background: var(--fondo);
}
body {
  margin: 0; min-height: 100vh;
  background: transparent; color: var(--texto);
  font-family: var(--font-sans); font-size: 16px; line-height: 26px; font-weight: 400;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.ventas-abiertas { --alto-franja: 0px; }
body:has(dialog[open]) { overflow: hidden; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--foco, var(--acento)); outline-offset: 3px; }

body.ventas-abiertas [data-solo="pre"],
body:not(.ventas-abiertas) [data-solo="venta"] { display: none !important; }

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===================== Fondo con resplandores ===================== */
.fondo { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--fondo); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; will-change: transform; }
.blob--1 { width: 56vmax; height: 56vmax; left: -18vmax; top: -16vmax; background: var(--olivo-linea); opacity: 0.42; animation: deriva-1 26s ease-in-out infinite alternate; }
.blob--2 { width: 42vmax; height: 42vmax; right: -14vmax; top: 18vh; background: #7E8752; opacity: 0.28; animation: deriva-2 32s ease-in-out infinite alternate; }
.blob--3 { width: 38vmax; height: 38vmax; left: 20vw; bottom: -22vmax; background: var(--olivo); opacity: 0.55; animation: deriva-3 30s ease-in-out infinite alternate; }
@keyframes deriva-1 { to { transform: translate(10vw, 8vh) scale(1.1); } }
@keyframes deriva-2 { to { transform: translate(-12vw, 14vh) scale(0.9); } }
@keyframes deriva-3 { to { transform: translate(14vw, -10vh) scale(1.15); } }

/* ===================== Tipografía ===================== */
.titulo {
  font-family: var(--font-sans); font-weight: 400;
  font-size: clamp(44px, 10vw, 92px); line-height: 1; letter-spacing: -0.025em;
}
.h2, h2 {
  font-family: var(--font-sans); font-weight: 400;
  font-size: clamp(32px, 6vw, 56px); line-height: 1.04; letter-spacing: -0.02em;
}
.h3 { font-family: var(--font-sans); font-weight: 500; font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.gloock { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; }
.resalta { color: var(--acento); }
.lead { font-size: 18px; line-height: 28px; font-weight: 300; color: var(--texto-2); }
.small { font-size: 13px; line-height: 20px; }
.texto-2 { color: var(--texto-2); }
.texto-3 { color: var(--texto-3); }
.label {
  font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.nota-mano { font-family: var(--font-mano); font-weight: 500; font-size: 24px; line-height: 1.1; }
.enlace { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ===================== Vidrio y superficies ===================== */
.vidrio {
  background: var(--vidrio);
  border: 1px solid var(--borde-vidrio);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
/* Superficie clara (como la tarjeta blanca de la referencia): leche con tinta barro. */
.claro {
  background: var(--leche); color: var(--barro);
  --texto-2: #5E4B40; --texto-3: #6B5649;
  --foco: var(--terracota);
}
/* Cartulina de ritual: su color con su tinta. --c viene en línea. */
.tarjeta-color { background-color: var(--c, var(--ritual-luz)); color: var(--tinta-oscura); --foco: var(--tinta-oscura); --tinta: var(--tinta-oscura); }
.tarjeta-color[data-tinta="clara"] { color: var(--tinta-clara); --foco: var(--tinta-clara); --tinta: var(--tinta-clara); }

/* ===================== Botones ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.2; font-weight: 500; letter-spacing: 0.01em;
  text-align: center; text-decoration: none;
  transition: transform 0.2s var(--suave), background-color var(--velocidad), color var(--velocidad), border-color var(--velocidad);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-grande { min-height: 64px; padding: 18px 34px; font-size: 18px; }
.btn-chico { min-height: 40px; padding: 8px 18px; font-size: 14px; }
.btn-ancho { width: 100%; }
.flecha { display: inline-block; transition: transform 0.25s var(--suave); }
.btn:hover .flecha { transform: translate(3px, -3px); }

.btn-primario { background: var(--acento); color: var(--on-acento); }
.btn-primario:hover { background: #F2BCA6; }
.claro .btn-primario { background: var(--terracota); color: var(--on-terracota); }
.claro .btn-primario:hover { background: var(--barro); }
.btn-vidrio { background: var(--vidrio-fuerte); border-color: var(--borde-vidrio); color: var(--texto); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.btn-vidrio:hover { background: rgba(246, 239, 230, 0.2); }
.claro .btn-vidrio { background: rgba(58, 42, 34, 0.06); border-color: rgba(58, 42, 34, 0.18); color: var(--barro); }
.claro .btn-vidrio:hover { background: rgba(58, 42, 34, 0.12); }
.btn-claro { background: var(--leche); color: var(--barro); }
.btn-claro:hover { background: #fff; }
.tarjeta-color .btn-vidrio { background: rgba(255, 255, 255, 0.18); border-color: color-mix(in srgb, var(--tinta) 30%, transparent); color: var(--tinta); }

/* Botón redondo (como el de "play" de la referencia) */
.btn-redondo {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--sombra-oscura); color: var(--leche);
  transition: transform 0.25s var(--suave), background-color var(--velocidad);
}
.btn-redondo:hover { transform: scale(1.08); }
.btn-redondo:active { transform: scale(0.94); }
.btn-redondo--claro { background: var(--leche); color: var(--barro); }
.btn-redondo--acento { background: var(--acento); color: var(--on-acento); }
.btn-redondo--chico { width: 40px; height: 40px; }
.mas, .mas::after { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
.mas { position: relative; }
.mas::after { content: ""; position: absolute; inset: 0; transform: rotate(90deg); }
.btn-redondo.agregado .mas { transform: rotate(45deg) scale(0); transition: transform 0.2s; }
.btn-redondo.agregado::after { content: ""; position: absolute; width: 8px; height: 15px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }

.btn-cerrar {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 8px 16px;
  border: 1px solid currentColor; border-radius: var(--r-pill);
  background: transparent; font-size: 14px; font-weight: 500;
}
.btn-cerrar::after { content: "×"; font-size: 22px; line-height: 1; font-weight: 300; }
.btn-cerrar--redondo { width: 44px; padding: 0; justify-content: center; border: 0; background: var(--vidrio-fuerte); color: var(--texto); }
.btn-cerrar--redondo::after { font-size: 26px; }

/* ===================== Chips ===================== */
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 42px; padding: 8px 18px;
  border: 1px solid var(--borde-vidrio); border-radius: var(--r-pill);
  background: var(--vidrio); color: var(--texto);
  font-size: 14px; line-height: 1.2; font-weight: 500; white-space: nowrap;
  transition: background-color var(--velocidad), color var(--velocidad), border-color var(--velocidad);
}
.chip:hover { background: var(--vidrio-fuerte); }
.chip[aria-pressed="true"] { background: var(--leche); color: var(--barro); border-color: var(--leche); }
.burbuja {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--acento); color: var(--on-acento);
  font-size: 12px; font-weight: 600; line-height: 1;
}
.chip-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 28%, transparent);
  font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap;
}
.chip-mini--lleno { background: var(--sombra-oscura); color: var(--leche); border-color: transparent; }
.punto-color { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(246, 239, 230, 0.25); flex: none; }

/* Precio en píldora oscura: se lee igual sobre cualquier cartulina */
.pill-precio {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 7px 16px 6px; border-radius: var(--r-pill);
  background: var(--sombra-oscura); color: var(--leche);
  font-family: var(--font-display); font-size: 20px; line-height: 1;
}
.pill-precio s { font-size: 14px; opacity: 0.7; text-decoration-thickness: 1px; }

/* ===================== Campos (superficie clara) ===================== */
.campo { display: grid; gap: 6px; }
.campo > label, .campo > legend { font-size: 14px; line-height: 20px; font-weight: 500; }
.campo input:not([type="radio"]):not([type="checkbox"]), .campo select, .campo textarea {
  width: 100%; min-height: 52px; padding: 12px 18px;
  border: 1px solid rgba(58, 42, 34, 0.3); border-radius: var(--r-md);
  background: #FFFDF9; color: var(--barro);
  font-size: 16px; line-height: 24px;
}
.campo textarea { min-height: 96px; resize: vertical; }
.campo [aria-invalid="true"] { border-color: var(--terracota); border-width: 2px; }
.campo-error { font-size: 13px; line-height: 18px; color: var(--terracota); font-weight: 500; }
.campo-ayuda { font-size: 13px; line-height: 20px; color: var(--texto-3); }

/* ===================== Faja (si falta una foto) ===================== */
.faja {
  display: none; position: absolute; inset: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--tinta, currentColor); text-align: center;
}
.faja-nombre { font-family: var(--font-display); font-size: 36px; line-height: 1; }
.sin-foto > .faja { display: flex; }

/* Jabón flotando */
.flota { animation: flotar 6s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }

/* ===================== Estructura ===================== */
.contenedor { width: 100%; max-width: calc(var(--ancho) + var(--margen) * 2); margin-inline: auto; padding-inline: var(--margen); }
.seccion { position: relative; padding-block: var(--space-6); }
.seccion-cabeza { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); max-width: 760px; }
.etiqueta {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start;
  padding: 7px 16px 7px 10px; border-radius: var(--r-pill);
  background: var(--vidrio); border: 1px solid var(--borde-vidrio);
  font-size: 13px; line-height: 18px; font-weight: 500; color: var(--texto-2);
}
.etiqueta img { width: 20px; height: 20px; }
.etiqueta .punto-vivo { width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--acento); box-shadow: 0 0 0 0 rgba(235, 169, 143, 0.6); animation: latir 2.4s infinite; }
@keyframes latir { 0% { box-shadow: 0 0 0 0 rgba(235, 169, 143, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(235, 169, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(235, 169, 143, 0); } }

.saltar { position: absolute; left: var(--space-3); top: -100px; z-index: 100; padding: 12px 20px; border-radius: var(--r-pill); background: var(--leche); color: var(--barro); text-decoration: none; font-weight: 500; }
.saltar:focus { top: var(--space-2); }

/* ===================== Aviso ===================== */
.aviso {
  position: fixed; left: 50%; bottom: 104px; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 22px; border-radius: var(--r-pill);
  background: var(--leche); color: var(--barro);
  font-size: 14px; line-height: 20px; font-weight: 500; text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: opacity var(--velocidad), transform 0.35s var(--suave);
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ===================== Diálogos ===================== */
dialog { padding: 0; border: 0; max-width: none; max-height: none; color: inherit; }
dialog::backdrop { background: rgba(14, 17, 12, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes subir { from { transform: translateY(100%); } }
@keyframes bajar { to { transform: translateY(100%); } }
@keyframes entrar-derecha { from { transform: translateX(100%); } }
@keyframes salir-derecha { to { transform: translateX(100%); } }
@keyframes aparecer { from { opacity: 0; transform: scale(0.98); } }

/* ===================== Movimiento ===================== */
.js .revelar { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--suave), transform 0.8s var(--suave); transition-delay: var(--retraso, 0s); }
.js .revelar.visible { opacity: 1; transform: none; }

@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; }
  .js .revelar { opacity: 1; transform: none; }
  .blob, .flota { animation: none; }
}

@media (min-width: 768px) {
  :root { --margen: 32px; }
}
@media (min-width: 1024px) {
  :root { --margen: 40px; --alto-cabecera: 76px; }
  .seccion { padding-block: var(--space-7); }
}
