/* molas · tienda de demostración
   Dirección: 00_Contexto/specbox/diseno-direccion.md */

:root {
  --rosa-polvo: #F6ECEE;
  --rosa-polvo-suave: #FBF6F7;
  --blanco: #FFFFFF;
  --tinta: #1C1A1B;
  --rosa-molas: #E57F98;   /* solo adornos: no llega a contraste de texto */
  --salvia: #5B6B50;       /* botones: 5,7:1 con blanco */
  --salvia-clara: #E6EADF;
  --piedra: #6E6468;       /* texto secundario */
  --linea: #E9DCDF;

  --titular: "Fraunces", Georgia, serif;
  --texto: "Nunito Sans", system-ui, sans-serif;

  --radio-boton: 999px;
  --radio-foto: 18px;
  --ancho: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

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

h1, h2 {
  font-family: var(--titular);
  font-variation-settings: "SOFT" 100;
  font-weight: 340;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

p { margin: 0 0 1em; max-width: 34em; }

a { color: var(--salvia); }

:focus-visible { outline: 2px solid var(--salvia); outline-offset: 3px; }

.boton {
  display: inline-block;
  border: 0;
  border-radius: var(--radio-boton);
  background: var(--salvia);
  color: var(--blanco);
  font: 600 1rem/1 var(--texto);
  padding: 0.95em 1.6em;
  text-decoration: none;
  cursor: pointer;
}
.boton:hover { background: #4C5A43; }
.boton:disabled { background: #A9B1A2; cursor: not-allowed; }

/* Aviso y cabecera */
.aviso-demo {
  margin: 0;
  max-width: none;
  background: var(--rosa-polvo);
  color: var(--tinta);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5em 16px;
}

.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 10px 16px;
}
.logo { color: var(--tinta); text-decoration: none; }
.logo svg { width: 84px; height: 84px; display: block; }
@media (min-width: 860px) { .logo svg { width: 104px; height: 104px; } }
.menu { display: none; gap: clamp(20px, 4vw, 44px); }
@media (min-width: 760px) { .menu { display: flex; } }
.menu a { color: var(--tinta); text-decoration: none; font-size: 1rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.menu a:hover { border-bottom-color: var(--rosa-molas); }

.boton-carrito {
  border: 1px solid var(--linea);
  background: var(--blanco);
  border-radius: var(--radio-boton);
  font: 600 0.95rem var(--texto);
  color: var(--tinta);
  padding: 0.55em 1em;
  cursor: pointer;
}
.contador {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  margin-left: 0.3em;
  border-radius: 999px;
  background: var(--rosa-polvo);
  font-size: 0.85em;
}

/* Portada con antes y después */
.portada {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 860px) {
  .portada { grid-template-columns: 1fr 1fr; padding-top: 40px; }
}
.portada-texto p { color: var(--piedra); font-size: 1.1rem; }

.antes-despues { margin: 0; justify-self: center; width: min(100%, 420px); }
.marco-ondulado {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--rosa-polvo);
  overflow: hidden;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 3 Q12.5 0 25 3 T50 3 T75 3 T100 3 V97 Q87.5 100 75 97 T50 97 T25 97 T0 97 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 3 Q12.5 0 25 3 T50 3 T75 3 T100 3 V97 Q87.5 100 75 97 T50 97 T25 97 T0 97 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.marco-ondulado img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.foto-antes { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.tirador {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--blanco);
  transform: translateX(-1px);
  pointer-events: none;
}
.tirador::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l-4 5 4 5M15 7l4 5-4 5' fill='none' stroke='%231C1A1B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 2px 10px rgb(28 26 27 / 0.18);
}
.deslizador {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.deslizador:focus-visible + .tirador,
.marco-ondulado:has(.deslizador:focus-visible) .tirador::after { outline: 2px solid var(--salvia); outline-offset: 2px; }
.etiqueta {
  position: absolute;
  bottom: 7%;
  background: rgb(255 255 255 / 0.88);
  border-radius: var(--radio-boton);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3em 0.8em;
  pointer-events: none;
}
.etiqueta-antes { left: 12px; }
.etiqueta-despues { right: 12px; }

/* Estilos de foto */
.estilos { padding: 8px 16px 64px; }
.estilos-cabecera, .estilos-lista { max-width: var(--ancho); margin: 0 auto; }
.estilos-cabecera p { color: var(--piedra); font-size: 1.1rem; }
.estilos-lista {
  list-style: none;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-top: 24px;
}
@media (min-width: 860px) { .estilos-lista { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; gap: 20px; } }
.estilos-lista li { scroll-snap-align: start; }
.estilos-lista img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: var(--radio-foto); background: var(--rosa-polvo); }
.estilos-lista h3 { font: 600 1.05rem var(--texto); margin: 0.8em 0 0.15em; }
.estilos-lista p { color: var(--piedra); margin: 0; font-size: 0.95rem; }

/* Prendas */
.prendas {
  background: var(--rosa-polvo-suave);
  padding: 56px 16px 64px;
}
.prendas h2, .rejilla { max-width: var(--ancho); margin-left: auto; margin-right: auto; }
.rejilla {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 16px;
}
@media (min-width: 860px) { .rejilla { grid-template-columns: repeat(4, 1fr); gap: 40px 24px; } }

.prenda button {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}
.prenda button:focus-visible { outline: 2px solid var(--salvia); outline-offset: 4px; border-radius: var(--radio-foto); }
.prenda-foto {
  aspect-ratio: 3 / 4;
  border-radius: var(--radio-foto);
  background: var(--rosa-polvo);
  overflow: hidden;
}
.prenda-foto img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.prenda-nombre { font-weight: 600; margin: 0.7em 0 0.1em; }
.prenda-precio { color: var(--piedra); margin: 0; font-size: 0.95rem; }
.puntos { display: flex; gap: 6px; margin-top: 0.5em; }
.punto { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(28 26 27 / 0.25); }

.prenda-pendiente .prenda-foto {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--linea);
  background: var(--blanco);
  color: var(--rosa-molas);
}
.prenda-pendiente svg { width: 38%; }
.prenda-pendiente .prenda-nombre { color: var(--piedra); font-weight: 400; }

/* Para tiendas */
.para-tiendas {
  background: var(--salvia-clara);
  padding: 64px 16px;
}
.para-tiendas-texto { max-width: 40rem; margin: 0 auto; }
.para-tiendas p { font-size: 1.1rem; }

.pie { padding: 28px 16px 96px; text-align: center; color: var(--piedra); font-size: 0.85rem; background: var(--rosa-polvo); }
.corazon-titulo {
  display: inline-block;
  width: 0.62em;
  height: 0.56em;
  margin-left: 0.18em;
  vertical-align: 0.02em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 20s-9-5.6-9-12a5 5 0 0 1 9-3 5 5 0 0 1 9 3c0 6.4-9 12-9 12Z' fill='none' stroke='%23E57F98' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pie p { margin: 0 auto; }
.boton-entrada {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--salvia); border-radius: var(--radio-boton); background: var(--blanco);
  color: var(--salvia); font: 600 0.85rem var(--texto); padding: 0.55em 1.1em; cursor: pointer;
}
.boton-entrada svg { width: 14px; height: 14px; }
.boton-entrada:hover { background: var(--salvia); color: var(--blanco); }
.boton-entrada:focus-visible { outline: 2px solid var(--salvia); outline-offset: 2px; }

/* Botón de la vendedora */
.boton-vendedora {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 0.45em;
  border: 0;
  border-radius: var(--radio-boton);
  background: var(--tinta);
  color: var(--blanco);
  font: 600 1rem var(--texto);
  padding: 0.85em 1.25em;
  box-shadow: 0 6px 20px rgb(28 26 27 / 0.22);
  cursor: pointer;
}
.boton-vendedora svg { width: 22px; height: 22px; color: var(--rosa-molas); }

/* Diálogos */
dialog {
  border: 0;
  padding: 0;
  color: var(--tinta);
  background: var(--blanco);
}
dialog::backdrop { background: rgb(28 26 27 / 0.45); }
.cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--rosa-polvo);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.ficha { width: min(960px, 100% - 24px); max-height: calc(100% - 24px); border-radius: 22px; }
.ficha-contenido { position: relative; display: grid; }
@media (min-width: 760px) { .ficha-contenido { grid-template-columns: 1fr 1fr; } }
.ficha-fotos { background: var(--rosa-polvo); padding: 16px; }
.ficha-fotos img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; }
.cambio-foto { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.cambio-foto button, .opciones button {
  border: 1px solid var(--linea);
  background: var(--blanco);
  border-radius: var(--radio-boton);
  font: 600 0.9rem var(--texto);
  color: var(--tinta);
  padding: 0.55em 1em;
  min-height: 44px;
  cursor: pointer;
}
.cambio-foto button[aria-pressed="true"],
.opciones button[aria-pressed="true"] { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.ficha-datos { padding: 28px 22px; }
.ficha-datos h2 { padding-right: 44px; }
.precio { font-size: 1.15rem; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 8px; }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.confirmacion { margin-top: 12px; color: var(--salvia); font-weight: 600; min-height: 1.6em; }

.panel {
  margin: 0 0 0 auto;
  height: 100%;
  max-height: none;
  width: min(420px, 100%);
}
.panel-contenido { position: relative; padding: 28px 20px; min-height: 100%; display: flex; flex-direction: column; }
.panel-contenido h2 { padding-right: 44px; }
.lineas { list-style: none; padding: 0; margin: 0; }
.linea { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.linea img { width: 64px; height: 86px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--rosa-polvo); }
.linea p { margin: 0; }
.linea-detalle { color: var(--piedra); font-size: 0.9rem; }
.cantidad { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cantidad button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--linea); background: var(--blanco);
  font-size: 1.1rem; cursor: pointer;
}
.cantidad .quitar { width: auto; height: auto; border-radius: 0; border: 0; background: none; color: var(--piedra); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.85rem; padding: 0; margin-left: auto; }
.carrito-pie { margin-top: auto; padding-top: 20px; }
.total { font-size: 1.1rem; font-weight: 600; }
.nota, .vacio { color: var(--piedra); font-size: 0.9rem; }

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

/* Vendedora virtual */
#vendedora { display: none; flex-direction: column; }
#vendedora[open] { display: flex; }
#vendedora .panel-contenido { flex: 1; min-height: 0; overflow-y: auto; }
.chat { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.burbuja { max-width: 85%; padding: 10px 14px; border-radius: 18px; line-height: 1.45; }
.burbuja p { margin: 0; }
.de-vendedora { align-self: flex-start; background: var(--rosa-polvo); border-bottom-left-radius: 6px; }
.de-clienta { align-self: flex-end; background: var(--salvia); color: var(--blanco); border-bottom-right-radius: 6px; }
.escribiendo { color: var(--piedra); font-style: italic; }
.tarjetas { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tarjeta { all: unset; cursor: pointer; display: block; }
.tarjeta img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 10px; background: var(--rosa-polvo); }
.tarjeta span { display: block; font-size: 0.8rem; line-height: 1.3; margin-top: 4px; }
.tarjeta:focus-visible { outline: 2px solid var(--salvia); outline-offset: 2px; border-radius: 10px; }
.accion { align-self: flex-start; font-size: 0.85rem; color: var(--salvia); font-weight: 600; }
.accion-boton { align-self: flex-start; }
.sugerencias { display: flex; flex-wrap: wrap; gap: 8px; }
.sugerencias button {
  border: 1px solid var(--linea); background: var(--blanco); border-radius: var(--radio-boton);
  font: 600 0.88rem var(--texto); color: var(--tinta); padding: 0.55em 1em; min-height: 40px; cursor: pointer;
}
.chat-escribir { display: flex; gap: 8px; padding: 12px 20px 20px; border-top: 1px solid var(--linea); }
.chat-escribir input {
  flex: 1; min-width: 0; border: 1px solid var(--linea); border-radius: var(--radio-boton);
  font: 1rem var(--texto); padding: 0.75em 1em;
}
.chat-escribir input:focus-visible { outline: 2px solid var(--salvia); outline-offset: 1px; }
.chat-escribir .boton { padding: 0.75em 1.2em; }

/* Entrada: el corazón se dibuja, aparece «molas» y la página se abre sola */
.entrada {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; align-content: center; gap: 8px;
  background: var(--rosa-polvo-suave);
  transition: opacity 0.7s ease, visibility 0.7s;
}
.entrada svg { width: min(220px, 55vw); height: auto; }
.entrada-corazon { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dibujar 1.4s ease-in-out 0.2s forwards; }
.entrada-nombre { opacity: 0; animation: aparecer 0.6s ease 1.4s forwards; }
.entrada.fuera { opacity: 0; visibility: hidden; }
.sin-entrada .entrada { display: none; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .entrada-corazon { animation: none; stroke-dashoffset: 0; }
  .entrada-nombre { animation: none; opacity: 1; }
}

.cabecera-acciones { display: flex; align-items: center; gap: 8px; }
@media (max-width: 480px) { .boton-entrada { font-size: 0; gap: 0; padding: 0.55em 0.7em; } .boton-entrada svg { width: 16px; height: 16px; } }

/* Contacto: correo y WhatsApp */
.contacto-botones { display: flex; flex-wrap: wrap; gap: 10px; }
.boton-claro { background: var(--blanco); color: var(--salvia); box-shadow: inset 0 0 0 1.5px var(--salvia); }
.boton-claro:hover { background: var(--salvia); color: var(--blanco); }

/* Enlaces a las otras webs */
.otras-webs { margin-top: 22px; }
.otras-webs > p { margin: 0 auto 12px; }
.otras-webs ul { list-style: none; padding: 0; margin: 0 auto; max-width: 900px; display: grid; gap: 10px; }
@media (min-width: 760px) { .otras-webs ul { grid-template-columns: repeat(3, 1fr); } }
.otras-webs ul a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 12px 14px; border-radius: 14px; background: var(--blanco);
  color: var(--tinta); text-decoration: none; text-align: left;
  box-shadow: 0 0 0 1px var(--linea);
}
.otras-webs ul a:hover { box-shadow: 0 0 0 1.5px var(--salvia); }
.otras-webs img, .marca-24h { width: 44px; height: 44px; flex: none; border-radius: 50%; }
.marca-24h {
  display: grid; place-items: center; font: 700 0.85rem var(--texto); font-style: normal;
  color: var(--blanco); background: var(--salvia);
}
.otras-webs span { font-size: 0.85rem; color: var(--piedra); line-height: 1.35; }
.otras-webs b { display: block; color: var(--tinta); font-size: 0.95rem; }

/* El logo late con suavidad de vez en cuando: tun, tun… y descansa */
.logo svg { transform-origin: 50% 55%; animation: latido 6s ease-in-out 3s infinite; }
@keyframes latido {
  0%, 12%, 100% { transform: scale(1); }
  4% { transform: scale(1.05); }
  8% { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .logo svg { animation: none; } }
.sugerencias[hidden] { display: none; }
