/* ===========================================================
   COLORES DE MARCA
   =========================================================== */
:root {
  --tinta: #3b0b13;
  --tinta-suave: #6e4f52;
  --papel: #fcfaee;
  --arena: #f0e4d7;
  --acento: #3b0b13;
  --acento-texto: #fcfaee;
  --dorado: #d4a02a;
  --linea: rgba(59, 11, 19, .14);
  --vidrio: rgba(252, 250, 238, .72);
  --fuente-titulos: "Cormorant Garamond", Georgia, serif;
  --fuente-texto: "futura-pt", "Futura PT", "Jost", system-ui, sans-serif;
  --panel: 470px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-weight: 300;
  background:
    radial-gradient(ellipse 70% 60% at 50% 58%, #fffdf6 0%, transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 100%, #efe3d2 0%, transparent 60%),
    var(--papel);
}
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--fuente-titulos); font-weight: 600; margin: 0; letter-spacing: -.01em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; margin: 0; }

#escena { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; touch-action: none; }
#escena:active { cursor: grabbing; }

/* ---------- Carga ---------- */
.cargando {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--papel);
  transition: opacity 1s .2s, visibility 1s .2s;
}
.cargando span { font-family: var(--fuente-titulos); font-weight: 600; letter-spacing: .4em; font-size: 22px; animation: latir 1.6s ease-in-out infinite; }
.cargando.fuera { opacity: 0; visibility: hidden; }
@keyframes latir { 50% { opacity: .35; } }

/* ---------- Encabezado ---------- */
.arriba { position: fixed; inset: 0 0 auto 0; z-index: 5; pointer-events: none; text-align: center; padding: 22px 28px 0; }
.logo {
  position: absolute; left: 32px; top: 26px; pointer-events: auto;
  font-family: var(--fuente-titulos); font-weight: 600; letter-spacing: .14em; font-size: 18px;
  color: var(--tinta); text-decoration: none;
}
.titulo { transition: opacity .6s, transform .6s; }
.titulo h1 { font-size: clamp(30px, 3.6vw, 54px); line-height: 1; margin-top: 18px; }
.titulo h1 em { font-style: italic; font-weight: 500; }
.titulo p { margin: 10px 0 0; font-size: 14px; color: var(--tinta-suave); letter-spacing: .04em; }

/* ---------- Botones de los sentidos (alrededor de la caja) ---------- */
.sentidos { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.sentido {
  position: absolute; pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.8);
  background: var(--vidrio);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 40px -22px rgba(59,11,19,.45);
  cursor: pointer;
  text-align: left;
  animation: flotar 6s ease-in-out infinite;
  transition: opacity .5s, transform .5s, box-shadow .3s, background .3s;
}
.sentido:nth-child(2) { animation-delay: -1.2s; } .sentido:nth-child(3) { animation-delay: -2.4s; }
.sentido:nth-child(4) { animation-delay: -3.6s; } .sentido:nth-child(5) { animation-delay: -4.8s; }
.sentido:hover { background: rgba(255,253,246,.95); box-shadow: 0 22px 50px -20px rgba(59,11,19,.55); }
.sentido__icono {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--acento); color: var(--acento-texto);
  transition: background .4s;
}
.sentido__icono svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sentido.completo .sentido__icono { background: var(--dorado); }
.sentido b { display: block; font-family: var(--fuente-titulos); font-weight: 600; font-size: 23px; line-height: 1; }
.sentido small { display: block; font-size: 12px; color: var(--tinta-suave); margin-top: 3px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes flotar { 50% { translate: 0 -7px; } }

.s-vista  { left: 7vw;  top: 40vh; }
.s-gusto  { left: 10vw; top: 60vh; }
.s-oido   { left: 50%;  top: 25vh; transform: translateX(-50%); }
.s-tacto  { right: 7vw; top: 40vh; }
.s-olfato { right: 10vw; top: 60vh; }

body.con-panel .sentidos .sentido, body.con-panel .titulo { opacity: 0; pointer-events: none; }
body.con-panel .titulo { transform: translateY(-14px); }

/* ---------- Color de la caja ---------- */
.color-caja {
  position: fixed; right: 28px; top: 22px; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 16px; border-radius: 999px;
  background: var(--vidrio); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.8);
  font-size: 13px; color: var(--tinta-suave);
  transition: opacity .5s;
}
.color-caja b { font-weight: 400; color: var(--tinta); }
.color-caja button {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s, box-shadow .2s;
}
.color-caja button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--tinta); transform: scale(1.1); }
body.con-panel .color-caja { opacity: 0; pointer-events: none; }

/* ---------- Barra inferior ---------- */
.barra {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 8px;
  padding: 7px; border-radius: 999px;
  background: var(--vidrio); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 18px 40px -22px rgba(59,11,19,.45);
  transition: transform .6s, opacity .5s;
}
body.con-panel .barra { transform: translateX(calc(-50% - var(--panel) / 2)); }
.barra__caja { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 6px 14px; font-size: 15px; }
.barra__icono { font-size: 18px; }
.barra__total { font-family: var(--fuente-titulos); font-weight: 600; font-size: 22px; padding-left: 10px; border-left: 1px solid var(--linea); }

.boton {
  font: inherit; cursor: pointer;
  border: 1px solid var(--acento); background: transparent; color: var(--acento);
  border-radius: 999px; padding: 10px 20px;
  transition: background .2s, color .2s, transform .2s, opacity .2s;
  white-space: nowrap;
}
.boton:hover { background: var(--acento); color: var(--acento-texto); }
.boton--lleno { background: var(--acento); color: var(--acento-texto); }
.boton--lleno:hover { transform: translateY(-1px); }
.boton:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.boton--ancho { width: 100%; padding: 14px; font-size: 16px; }

/* Detalle de la caja */
.detalle {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 8;
  width: min(420px, calc(100vw - 32px));
  background: rgba(253,251,242,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 20px; padding: 16px 18px;
  box-shadow: 0 24px 60px -24px rgba(59,11,19,.5);
  max-height: 55vh; overflow: auto;
}
.detalle[hidden] { display: none; }
.detalle h3 { font-size: 24px; margin-bottom: 6px; }
.detalle ul { list-style: none; margin: 0; padding: 0; }
.detalle li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--linea); font-size: 14px; }
.detalle li em { font-style: normal; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tinta-suave); width: 56px; flex: none; }
.detalle li b { font-weight: 300; flex: 1; }
.detalle li button { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--tinta-suave); }
.detalle .suma { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; }
.detalle .suma strong { font-family: var(--fuente-titulos); font-size: 26px; }

/* ---------- Panel lateral ---------- */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 10;
  width: var(--panel); max-width: 100vw;
  background: rgba(253, 251, 242, .93);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-left: 1px solid rgba(255,255,255,.9);
  box-shadow: -30px 0 80px -40px rgba(59,11,19,.45);
  transform: translateX(105%);
  transition: transform .7s cubic-bezier(.7,0,.2,1);
  display: flex; flex-direction: column;
}
.panel.abierto { transform: none; }
.panel__cerrar {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--linea); background: #fff; cursor: pointer; font-size: 22px; line-height: 1;
}
.panel__contenido { overflow: auto; padding: 30px 30px 40px; flex: 1; }

.pestanas { display: flex; gap: 6px; margin: 0 50px 26px 0; flex-wrap: wrap; }
.pestanas button {
  border: 1px solid var(--linea); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.pestanas button[aria-current="true"] { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.pestanas i { width: 6px; height: 6px; border-radius: 50%; background: var(--dorado); font-style: normal; }

.panel h2 { font-size: 40px; line-height: 1.02; margin: 6px 0 8px; }
.panel h2 em { font-style: italic; font-weight: 500; }
.panel .regla { color: var(--tinta-suave); font-size: 14px; margin: 0 0 16px; }
.buscar { margin-bottom: 16px; }

.rejilla-productos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.producto {
  background: #fff; border: 1px solid var(--linea); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.producto:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(59,11,19,.5); }
.producto.elegido { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.producto img { width: 100%; aspect-ratio: 1 / .85; object-fit: cover; display: block; background: var(--arena); }
.producto div { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.producto h3 { font-size: 18px; line-height: 1.1; flex: 1; }
.producto .precio { font-size: 14px; color: var(--tinta-suave); }
.producto .boton { padding: 7px 10px; font-size: 13px; }
.producto .etiqueta { font-size: 11px; color: var(--dorado); text-transform: uppercase; letter-spacing: .1em; }

.listas { display: grid; gap: 10px; }
.lista {
  text-align: left; border: 1px solid var(--linea); background: #fff; border-radius: 16px;
  padding: 14px 16px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center;
  transition: border-color .2s, transform .2s;
}
.lista:hover { transform: translateX(3px); }
.lista[aria-checked="true"] { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.lista__ondas { grid-row: span 2; display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.lista__ondas i { width: 4px; border-radius: 2px; background: var(--c, var(--acento)); }
.lista strong { font-family: var(--fuente-titulos); font-weight: 600; font-size: 22px; line-height: 1.1; }
.lista span { font-size: 13px; color: var(--tinta-suave); }
.propia { margin: 18px 0; background: var(--arena); border-radius: 16px; padding: 16px; }
.propia h3 { font-size: 22px; }
.propia p { font-size: 13px; color: var(--tinta-suave); margin: 4px 0 10px; }
.fila { display: flex; gap: 8px; }
.fila input { flex: 1; min-width: 0; }
.spotify iframe { display: block; width: 100%; border: 0; border-radius: 12px; margin-top: 12px; }
.subtitulo { font-size: 24px; margin: 22px 0 12px; }

input, textarea {
  font: inherit; color: var(--tinta); width: 100%;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--linea); background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 4px rgba(59,11,19,.1); }
.campo { display: grid; gap: 6px; margin-bottom: 12px; position: relative; }
.campo > span { font-size: 14px; }
.campo.error input, .campo.error textarea { border-color: #b3261e; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.contador { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: var(--tinta-suave); }
.nota { font-size: 13px; color: var(--tinta-suave); }
.aviso { color: #b3261e; font-size: 14px; min-height: 1.2em; margin: 6px 0 10px; }
.resumen { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.resumen li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--linea); }
.resumen li span:first-child { color: var(--tinta-suave); }

/* ---------- Globo (nombre al pasar sobre un objeto) ---------- */
.globo {
  position: fixed; z-index: 20; pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  background: var(--tinta); color: var(--acento-texto);
  padding: 7px 12px; border-radius: 10px; font-size: 13px; white-space: nowrap;
}
.globo small { opacity: .7; }
.globo[hidden] { display: none; }

.aviso-flotante {
  position: fixed; left: 50%; bottom: 100px; z-index: 30;
  transform: translate(-50%, 16px);
  background: var(--tinta); color: var(--acento-texto);
  padding: 11px 18px; border-radius: 999px; font-size: 14px;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; pointer-events: none; transition: .35s;
  max-width: calc(100vw - 32px);
}
.aviso-flotante.ver { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.aviso-flotante button { border: 0; background: none; color: var(--dorado); cursor: pointer; text-decoration: underline; padding: 0; }

.gracias {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; text-align: center; padding: 24px;
  background: rgba(252,250,238,.55); backdrop-filter: blur(4px);
}
.gracias[hidden] { display: none; }
.gracias > div { max-width: 480px; background: rgba(253,251,242,.95); border-radius: 24px; padding: 34px 30px; box-shadow: 0 30px 80px -30px rgba(59,11,19,.5); }
.gracias h2 { font-size: 46px; margin: 8px 0; }
.gracias p { color: var(--tinta-suave); }
.gracias .boton { padding: 13px 30px; margin-top: 8px; }

/* ---------- Móvil ---------- */
@media (max-width: 1240px) and (min-width: 761px) {
  .s-vista, .s-tacto { top: 42vh; } .s-vista { left: 2.5vw; } .s-tacto { right: 2.5vw; }
  .s-gusto { left: 4vw; } .s-olfato { right: 4vw; }
  .sentido { padding: 7px 16px 7px 7px; gap: 9px; }
  .sentido__icono { width: 34px; height: 34px; }
  .sentido b { font-size: 19px; }
  .sentido small { max-width: 120px; }
  .color-caja > span { display: none; }
}
@media (max-width: 760px) {
  :root { --panel: 100vw; }
  .logo { left: 18px; top: 18px; font-size: 15px; }
  .arriba { padding-top: 40px; }
  .titulo h1 { font-size: 30px; }
  .titulo p { font-size: 12px; }
  .sentidos {
    inset: auto 0 84px 0; display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px 10px;
    scrollbar-width: none; pointer-events: auto;
  }
  .sentidos::-webkit-scrollbar { display: none; }
  .sentido { position: static; transform: none !important; flex: none; padding: 6px 16px 6px 6px; gap: 8px; animation: none; }
  .sentido__icono { width: 34px; height: 34px; }
  .sentido b { font-size: 18px; }
  .sentido small { max-width: 110px; }
  .color-caja { left: 50%; transform: translateX(-50%); top: 118px; bottom: auto; padding: 6px 10px; gap: 7px; }
  .color-caja span { display: none; }
  .color-caja button { width: 22px; height: 22px; }
  .barra { bottom: calc(16px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); justify-content: space-between; }
  body.con-panel .barra { opacity: 0; pointer-events: none; transform: translateX(-50%); }
  .barra__caja { padding: 6px 8px; gap: 6px; font-size: 14px; }
  .barra__total { font-size: 19px; padding-left: 8px; }
  .barra .boton { padding: 10px 14px; font-size: 14px; }
  .panel {
    top: auto; height: 68vh; width: 100vw;
    border-radius: 24px 24px 0 0; border-left: 0;
    transform: translateY(105%);
  }
  .panel__contenido { padding: 22px 18px 30px; }
  .panel h2 { font-size: 30px; }
  .pestanas { flex-wrap: nowrap; overflow-x: auto; margin-right: 46px; }
  .pestanas button { flex: none; }
  .dos { grid-template-columns: 1fr; }
  .detalle { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .sentido { animation: none; }
}
