/* ReLi Cartones · sitio de enlace
   Sin animaciones CSS por keyframes ni fundidos de opacidad: todo se revela con máscaras, recortes y escalas. */

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../fonts/inter-tight.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #EDEBE6;
  --sheet: #F4F2ED;
  --ink: #141414;
  --muted: #6D6A63;
  --cobalt: #1F3FB0;
  --verm: #D9441F;
  --kraft: #A8703A;
  --kraft-d: #7E5128;
  --wa: #25D366;
  --rule: rgba(20, 20, 20, .9);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --H: min(46vh, 31vw);
  --notice: 26px;
  --sans: "Inter Tight", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}
@media (max-height: 680px) and (min-width: 768px) { :root { --H: min(38vh, 31vw); } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  overflow: hidden; user-select: none; -webkit-user-select: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
.show-m { display: none; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

@media (pointer: fine) {
  html, body, button, a, .tape, .chip { cursor: none; }
  input, textarea, select { cursor: text; }
}

/* ---------- Etiquetas ---------- */
.lbl { font-family: var(--sans); font-weight: 600; font-size: 10.5px; line-height: 1; letter-spacing: .09em; text-transform: uppercase; }
.box {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
  border: 1px solid var(--rule); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.box:hover { background: var(--ink); color: var(--paper); }
.box.solid { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.box.solid:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Aviso superior ---------- */
.notice {
  position: fixed; inset: 0 0 auto 0; height: var(--notice); margin: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
  background: var(--ink); color: var(--paper); font-size: 9.5px; white-space: nowrap; overflow: hidden;
}
.notice .sep { opacity: .55; }
.notice-link { margin-left: 6px; color: #fff; text-underline-offset: 2px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed; top: var(--notice); left: 0; right: 0; height: 84px; padding: 0 32px; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.tb-left { justify-self: start; }
.tb-right { justify-self: end; display: flex; gap: 8px; }
.logo img { height: 44px; width: auto; }

/* ---------- Pestañas ---------- */
.tabs {
  position: fixed; left: 50%; top: calc(50% - var(--H) / 2 - 86px); transform: translateX(-50%);
  display: flex; z-index: 20;
}
.tab {
  position: relative; z-index: 1; height: 23px; padding: 0 11px; margin-left: -1px;
  border: 1px solid var(--rule); white-space: nowrap; transition: color .45s var(--ease);
}
.tab:first-of-type { margin-left: 0; }
.tab.on { color: #fff; }
.tab-ind {
  position: absolute; left: 0; top: 0; height: 23px; width: 0; background: var(--cobalt);
  transition: width .6s var(--ease), transform .6s var(--ease);
}

/* ---------- Estante 3D ---------- */
.shelf {
  position: fixed; left: 0; right: 0; top: calc(50% - var(--H) / 2 - 40px); height: calc(var(--H) + 80px);
  perspective: 2200px; perspective-origin: 50% 50%; touch-action: pan-y; z-index: 10;
}
.stage { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.tape { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.face {
  position: absolute; top: calc(var(--H) / -2); height: var(--H);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 2px; overflow: hidden;
}
.face svg { width: 100%; height: 100%; display: block; }
.face::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--shade, 0); pointer-events: none; }
.sp { width: var(--ws); left: calc(var(--ws) / -2); transform: translateZ(calc(var(--d) / 2)); }
.cv {
  width: var(--d); left: calc(var(--d) / -2); transform: rotateY(90deg) translateZ(calc(var(--ws) / 2));
  box-shadow: 0 30px 60px -28px rgba(20, 16, 10, .55); overflow: visible;
}
.cv svg { border-radius: 2px; }
.ct { font-family: var(--serif); font-weight: 600; }
.cs { font-family: var(--sans); font-weight: 700; }
.probe { position: absolute; visibility: hidden; height: var(--H); width: 1px; left: -9999px; top: 0; }

/* ---------- Botón de reproducción ---------- */
.play {
  position: fixed; left: 0; top: 0; width: 42px; height: 42px; margin: -21px 0 0 -21px; z-index: 25;
  border-radius: 50%; border: 1px solid var(--cobalt); color: var(--cobalt); background: rgba(237, 235, 230, .75);
  display: grid; place-items: center; transform: scale(0); will-change: transform;
}
.play svg { transform: translateX(2px); }

/* ---------- Pie del estante ---------- */
.caption {
  position: fixed; left: 50%; top: calc(50% + var(--H) / 2 + 30px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 9px; pointer-events: none; z-index: 20;
}
.caption .ml { position: relative; overflow: hidden; width: min(92vw, 760px); text-align: center; }
.caption .ml > span { display: block; }
.caption .ml > span + span { position: absolute; left: 0; right: 0; top: 0; }
.cap-title { font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.12; letter-spacing: -.01em; }
.cap-sub { color: var(--cobalt); font-weight: 500; }
.cap-year { font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }

.arrow {
  position: fixed; top: calc(50% + var(--H) / 2 + 40px); width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center; z-index: 20;
}
.arrow.prev { left: 20px; }
.arrow.next { right: 20px; }

.footer {
  position: fixed; left: 32px; right: 32px; bottom: 26px; display: flex; justify-content: space-between; gap: 16px; z-index: 20;
}
.footer a { color: var(--ink); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- WhatsApp flotante ---------- */
.wa-fab {
  position: fixed; right: 24px; bottom: 64px; z-index: 70; width: 58px; height: 58px; border-radius: 50%;
  background: var(--wa); color: #fff; display: grid; place-items: center; text-decoration: none;
  box-shadow: 0 10px 24px -10px rgba(20, 20, 20, .55);
  transition: transform .45s var(--ease);
}
.wa-fab:hover { transform: scale(1.06); }
.wa-tip {
  position: absolute; right: 70px; top: 50%; padding: 7px 10px; background: var(--ink); color: #fff;
  white-space: nowrap; transform: translateY(-50%) scaleX(0); transform-origin: right center;
  transition: transform .45s var(--ease);
}
.wa-fab:hover .wa-tip, .wa-fab:focus-visible .wa-tip { transform: translateY(-50%) scaleX(1); }

/* ---------- Grano de papel ---------- */
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; mix-blend-mode: multiply; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .42 0 0 0 0 .38 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  .cursor {
    display: block; position: fixed; left: 0; top: 0; width: 58px; height: 58px; margin: -29px 0 0 -29px;
    z-index: 100; pointer-events: none; will-change: transform;
  }
}
.c-ring {
  position: absolute; inset: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: transparent;
  transition: transform .5s var(--ease), background-color .4s var(--ease), border-color .4s var(--ease);
}
.c-dot {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--ink); transition: transform .4s var(--ease);
}
.c-label {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font: 600 10px/1.25 var(--sans); letter-spacing: .1em; text-transform: uppercase; text-align: center;
  transform: scale(0); transition: transform .45s var(--ease);
}
.cursor.spine .c-ring { transform: scale(.72); }
.cursor.btn .c-ring { transform: scale(.55); }
.cursor.btn .c-dot { transform: scale(0); }
.cursor.open .c-ring { transform: scale(1.75); background: var(--cobalt); border-color: var(--cobalt); }
.cursor.open .c-dot { transform: scale(0); }
.cursor.open .c-label { transform: scale(1); }
.cursor.off .c-ring, .cursor.off .c-dot { transform: scale(0); }

/* ---------- Ficha ---------- */
.detail {
  position: fixed; inset: 0; z-index: 60; background: var(--sheet); visibility: hidden;
  overflow: hidden; user-select: text; -webkit-user-select: text;
}
.detail.is-open { visibility: visible; }
.d-close { position: absolute; left: 32px; top: 31px; z-index: 2; }
.d-logo { position: absolute; left: 0; right: 0; top: 0; height: 84px; display: grid; place-items: center; pointer-events: none; }
.d-logo img { height: 40px; width: auto; }
.d-grid {
  height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; padding: 110px 6vw 56px 7vw; align-items: center;
}
.d-text { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.ml { overflow: hidden; }
.detail .ml { padding-bottom: 2px; }
.mi { display: block; margin: 0; }
.d-sub { color: var(--cobalt); }
.d-title { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5.4vw, 84px); line-height: 1; letter-spacing: -.025em; }
.d-meta { color: var(--muted); }
.d-syn { font-family: var(--serif); font-size: 17px; line-height: 1.5; max-width: 42ch; }
.d-credit { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.d-note { font-size: 12px; line-height: 1.5; color: var(--muted); max-width: 52ch; }
.d-poster { height: 100%; display: grid; place-items: center; min-height: 0; }
.d-poster svg { height: min(100%, 78vh); aspect-ratio: 474 / 900; width: auto; display: block; }

.btn-main, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  font: 600 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--cobalt); transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn-main { background: var(--cobalt); color: #fff; }
.btn-main:hover { background: var(--ink); border-color: var(--ink); }
.btn-ghost { color: var(--cobalt); }
.btn-ghost:hover { background: var(--cobalt); color: #fff; }
.btn-wa { background: #128C4A; border-color: #128C4A; }
.btn-wa[aria-disabled="true"] { background: #8a8a85; border-color: #8a8a85; pointer-events: none; }

/* ---------- Cotizador y visor ---------- */
.quote, .media { position: fixed; inset: 0; z-index: 80; user-select: text; -webkit-user-select: text; }
.media { z-index: 85; }
.q-scrim { position: absolute; inset: 0; background: rgba(20, 20, 20, .45); }
.q-panel, .m-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100vw);
  background: var(--sheet); display: flex; flex-direction: column; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35);
}
.m-panel { width: min(980px, 100vw); }
.q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 32px 14px; }
.q-kicker { color: var(--cobalt); margin: 0 0 10px; }
.q-title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.q-steps { display: flex; gap: 0; list-style: none; margin: 0 32px; padding: 0; }
.q-steps li { flex: 1; padding: 9px 0; border-top: 2px solid rgba(20, 20, 20, .15); color: var(--muted); transition: border-color .4s var(--ease), color .4s var(--ease); }
.q-steps li.on { border-color: var(--cobalt); color: var(--ink); }
.q-body { flex: 1; overflow-y: auto; padding: 18px 32px 24px; }
.q-help { font-family: var(--serif); font-size: 17px; margin: 0 0 16px; }
.q-products { display: grid; gap: 10px; }
.q-prod {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 12px;
  border: 1px solid rgba(20, 20, 20, .2); background: #fff; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.q-prod.on { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.q-prod-art { width: 64px; height: 64px; border: 1px solid rgba(20, 20, 20, .2); background: #F1E7D0; }
.q-prod-art svg { width: 100%; height: 100%; display: block; }
.q-prod-name { font-family: var(--serif); font-size: 20px; line-height: 1.1; margin: 0 0 3px; }
.q-prod-desc { font-size: 13px; color: var(--muted); margin: 0; }
.q-prod-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.q-toggle { flex: none; }
.q-prod.on .q-toggle { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.q-qty { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.q-prod:not(.on) .q-qty { display: none; }
.stepper { display: inline-flex; border: 1px solid var(--rule); height: 36px; }
.stepper button { width: 36px; font-size: 18px; line-height: 1; }
.stepper button:hover { background: var(--ink); color: #fff; }
.stepper input { width: 84px; border: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); text-align: center; font: 600 15px var(--sans); background: transparent; }
.q-qty select { height: 36px; border: 1px solid var(--rule); background: #fff; font: 500 14px var(--sans); padding: 0 8px; }
.q-field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0 0 16px; padding: 0; min-width: 0; flex: 1; }
.q-field legend { padding: 0; margin-bottom: 8px; }
.q-field input, .q-field textarea {
  width: 100%; border: 1px solid rgba(20, 20, 20, .35); background: #fff; padding: 10px 12px; border-radius: 2px;
  font: 400 15px/1.4 var(--sans); color: var(--ink); resize: vertical;
}
.q-field input:focus, .q-field textarea:focus { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
.q-row { display: flex; gap: 14px; }
.q-preview { font: 400 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace !important; background: #F8F6F1 !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; padding: 0 14px; border: 1px solid var(--rule); font: 500 13px var(--sans);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.chip:hover { background: rgba(31, 63, 176, .08); }
.chip.on { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.q-err { color: #B3261E; font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.q-legal { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0; }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 32px 24px; border-top: 1px solid rgba(20, 20, 20, .12); }
.q-foot-r { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.m-tabs { display: flex; margin: 0 32px; }
.m-tab { text-transform: uppercase; height: 30px; padding: 0 14px; border: 1px solid var(--rule); margin-left: -1px; transition: background-color .35s var(--ease), color .35s var(--ease); }
.m-tab:first-child { margin-left: 0; }
.m-tab.on { background: var(--ink); color: #fff; }
.m-stage { flex: 1; min-height: 0; padding: 16px 32px; overflow: auto; }
.ig-host { width: 100%; aspect-ratio: 16 / 9; background: #F1E7D0; border: 1px solid rgba(20, 20, 20, .2); overflow: hidden; }
.ig-host svg { width: 100%; height: 100%; display: block; }
.m-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.m-bar { flex: 1; height: 3px; background: rgba(20, 20, 20, .15); position: relative; overflow: hidden; }
.m-bar span { position: absolute; inset: 0; background: var(--cobalt); transform-origin: left center; transform: scaleX(0); }
.m-video { width: 100%; aspect-ratio: 16 / 9; background: #111; display: block; }

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  :root { --H: min(60vw, 40svh); --notice: 24px; }
  .hide-m { display: none !important; }
  .show-m { display: inline; }
  .notice { font-size: 8.5px; gap: 6px; }
  .topbar { height: 64px; padding: 0 16px; }
  .topbar .lbl { font-size: 9px; }
  .logo img { height: 30px; }
  .tabs { top: calc(50% - var(--H) / 2 - 70px); }
  .tab { padding: 0 7px; font-size: 9px; }
  .cap-title { font-size: 24px; }
  .arrow.prev { left: 6px; }
  .arrow.next { right: 6px; }
  .footer { left: 16px; right: 16px; bottom: 18px; font-size: 9px; }
  .footer > span:first-child { max-width: 58vw; white-space: normal; line-height: 1.3; }
  .wa-fab { right: 14px; bottom: 54px; width: 52px; height: 52px; }
  .detail { overflow-y: auto; }
  .d-grid { display: flex; flex-direction: column; height: auto; padding: 84px 22px 40px; gap: 24px; }
  .d-poster { order: -1; height: 46svh; width: 100%; }
  .d-poster svg { height: 46svh; }
  .d-title { font-size: 42px; }
  .d-syn { font-size: 16px; }
  .d-close { left: 16px; top: 21px; }
  .d-logo { height: 64px; }
  .d-logo img { height: 28px; }
  .q-head { padding: 20px 18px 10px; }
  .q-steps, .m-tabs { margin: 0 18px; }
  .q-body, .m-stage { padding: 14px 18px 18px; }
  .q-foot { padding: 12px 18px 18px; flex-wrap: wrap; }
  .q-row { flex-direction: column; gap: 0; }
  .q-title { font-size: 28px; }
}
