/* Guía BSM° · sistema visual
   Layout: app mobile first. Barra de búsqueda fija arriba, navegación fija abajo en celular,
   contenido en una columna; desde 900px pasa a grilla con navegación en la cabecera. */
:root {
  color-scheme: dark;
  /* color */
  --ink: #222222;        /* fondo de marca */
  --surface: #2a2a2a;    /* tarjetas */
  --surface-2: #323232;  /* inputs, chips */
  --line: #3d3d3d;
  --paper: #eaeaea;      /* texto principal */
  --muted: #a7b3b8;      /* texto secundario, levemente azulado */
  --gold: #f3ce2c;       /* sello y acento principal */
  --sky: #6ccbfa;        /* interacción */
  --deep: #093c51;       /* bloques de autoridad */
  --mist: #94c6d8;
  /* tipo */
  --display: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --fs-xs: .78rem; --fs-sm: .9rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.7rem; --fs-2xl: 2.4rem;
  /* espacio */
  --gutter: 16px; --radius: 14px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { background: var(--ink); color: var(--paper); }
body { font-family: var(--display); font-size: var(--fs-md); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--sky); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }

.app { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 0 calc(var(--nav-h) + 88px); }

/* Aviso de datos de ejemplo */
.demo-flag { font-size: var(--fs-xs); color: var(--ink); background: var(--mist); text-align: center; padding: 6px var(--gutter); letter-spacing: .02em; }

/* Cabecera y búsqueda */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--ink); padding-block: 12px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.brand a { color: var(--paper); text-decoration: none; font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.01em; }
.brand a span { color: var(--gold); }
.brand small { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--paper); font: inherit; font-size: 16px; outline: none; }
.search input::placeholder { color: var(--muted); }

.desk-nav { display: none; }

/* Navegación inferior (celular) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(34,34,34,.96); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); backdrop-filter: blur(8px); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 9px 4px 10px; text-decoration: none; color: var(--muted); font-size: var(--fs-xs); }
.tabbar a[aria-current="page"] { color: var(--gold); }

/* CTA de compra (vitrina) */
.buybar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 25; padding: 10px var(--gutter); background: linear-gradient(to top, var(--ink) 70%, transparent); }
.buybar a { display: flex; justify-content: center; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto; background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 700; border-radius: 999px; padding: 14px 20px; }
.buybar a small { font-weight: 500; opacity: .75; }

/* Secciones */
.view { display: grid; gap: 28px; padding-block: 22px; }
.eyebrow { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: var(--fs-xl); font-weight: 700; }
.section-head a { font-size: var(--fs-sm); text-decoration: none; }

/* Portada */
.cover { display: grid; gap: 16px; padding-block: 8px; }
.cover .ejemplar { justify-self: start; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 5px 12px; }
.cover h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.cover h1 em { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--gold); }
.cover p { color: var(--muted); max-width: 52ch; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fact { background: var(--deep); border-radius: var(--radius); padding: 14px 12px; display: grid; gap: 2px; }
.fact b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.fact span { font-size: var(--fs-xs); color: var(--mist); }

/* Chips de filtro */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: var(--fs-sm); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.filters { display: grid; gap: 10px; }
.selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.selects select { width: 100%; min-width: 0; background: var(--surface-2); color: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: var(--fs-sm); }

/* Tarjetas de ganadoras */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; background: var(--surface); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.card:hover { border-color: var(--line); }
.card .shot { aspect-ratio: 4 / 5; max-width: 100%; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card .shot svg { width: 46%; height: auto; }
.card h3 { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.card .meta { font-size: var(--fs-xs); color: var(--muted); }
.seal { position: absolute; top: 18px; left: 18px; width: 42px; height: 42px; }
.lock { position: absolute; top: 18px; right: 18px; background: rgba(34,34,34,.85); color: var(--paper); border-radius: 999px; padding: 4px 9px; font-size: var(--fs-xs); display: flex; gap: 5px; align-items: center; }

/* Ficha */
.ficha { display: grid; gap: 22px; }
.ficha-head { display: grid; gap: 14px; }
.ficha .shot { aspect-ratio: 4 / 5; max-width: 340px; width: 100%; border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; position: relative; }
.ficha .shot svg.bottle { width: 40%; height: auto; }
.ficha .shot .seal { width: 64px; height: 64px; top: 14px; left: 14px; }
.ficha h1 { font-size: var(--fs-xl); font-weight: 700; }
.ficha .brandline { color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.specs div { background: var(--surface); padding: 12px; display: grid; gap: 2px; min-width: 0; }
.specs dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.specs dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.block { background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.block h2 { font-size: var(--fs-lg); font-weight: 700; }
.nota { font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; color: var(--paper); }
.placeholder { color: var(--muted); font-family: var(--display); font-size: var(--fs-sm); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; }
.video { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 10px; background: var(--deep); display: grid; place-items: center; color: var(--mist); font-size: var(--fs-sm); text-align: center; padding: 16px; }
.pyramid { width: 100%; max-width: 300px; justify-self: center; }
.pyramid text { fill: var(--muted); font-family: var(--display); font-size: 11px; }
.pyramid .val { fill: var(--paper); font-weight: 600; }
.back { justify-self: start; text-decoration: none; font-size: var(--fs-sm); }

/* Bloqueo en vitrina */
.locked { position: relative; display: grid; gap: 14px; justify-items: start; background: var(--deep); border-radius: var(--radius); padding: 20px; }
.locked h2 { font-size: var(--fs-lg); }
.locked p { color: var(--mist); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 999px; padding: 12px 18px; border: 0; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }

/* Listado */
.list { display: grid; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row .name { font-weight: 500; display: flex; gap: 8px; align-items: center; min-width: 0; }
.row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .price { font-variant-numeric: tabular-nums; color: var(--paper); }
.row .sub { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--gold); }
.dot.off { background: transparent; border: 1px solid var(--line); }
.count { font-size: var(--fs-sm); color: var(--muted); }
.blur { filter: blur(5px); user-select: none; }

/* Método */
.metodo { display: grid; gap: 16px; max-width: 65ch; }
.metodo h1 { font-size: var(--fs-xl); }
.metodo p { color: var(--muted); }
.axes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.axes div { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.axes b { display: block; color: var(--gold); }

.footer { color: var(--muted); font-size: var(--fs-xs); display: grid; gap: 10px; padding-block: 24px 8px; border-top: 1px solid var(--line); }
.switch { display: flex; gap: 6px; flex-wrap: wrap; }

.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* Tablet */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cover h1 { font-size: 3rem; }
  .ficha-head { grid-template-columns: 300px 1fr; align-items: start; }
}

/* Escritorio */
@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  .app { padding-block: 0 96px; }
  .tabbar { display: none; }
  .top { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
  .desk-nav { display: flex; gap: 18px; }
  .desk-nav a { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); }
  .desk-nav a[aria-current="page"] { color: var(--gold); }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .buybar { bottom: 0; }
  .ficha { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .ficha-head { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color .15s ease, transform .15s ease; }
  .card:hover { transform: translateY(-2px); }
}

/* Perfil BSM° (puntos) */
.bsm { display: grid; gap: 10px; }
.bsm-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 3.4em; align-items: center; gap: 10px; }
.bsm-row b { font-size: var(--fs-lg); color: var(--gold); font-weight: 700; text-align: center; }
.bsm-row span:not(.dots) { font-size: var(--fs-sm); color: var(--paper); text-transform: uppercase; letter-spacing: .06em; min-width: 0; }
.bsm-row em { font-style: normal; font-size: var(--fs-sm); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 7px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #3d3d3d; }
.dots i.on { background: var(--gold); }
div.row { cursor: default; }

/* Comparador (lado a lado, estilo ficha técnica) */
.cmp { --n: 2; gap: 22px; }
.cmp-cells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.cmp .c3, .cmp .pyramid .s3 { display: none; }
.cmp-cell { display: grid; gap: 6px; justify-items: center; text-align: center; min-width: 0; }
.cmp-sticky { position: sticky; top: var(--top-h, 120px); z-index: 15; background: var(--ink); padding-block: 10px; border-bottom: 1px solid var(--line); }
.cmp-pick { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 0 0 10px; }
.cmp-pick .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cmp-pick select { flex: 1; min-width: 0; width: 100%; background: transparent; color: var(--paper); border: 0; padding: 10px 8px 10px 0; font: inherit; font-size: var(--fs-sm); text-overflow: ellipsis; }
.cmp-pick select option, .cmp-pick select optgroup { background: var(--surface-2); color: var(--paper); }
.cmp-shot { position: relative; width: 100%; max-width: 180px; aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; }
.cmp-shot svg.bottle { width: 44%; height: auto; }
.cmp-shot .seal { top: 8px; left: 8px; width: 36px; height: 36px; }
.cmp-cell h3 { font-size: var(--fs-md); font-weight: 600; line-height: 1.25; margin-top: 6px; }
.cmp-cell .meta { font-size: var(--fs-xs); color: var(--muted); }
.cmp-price { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-link { font-size: var(--fs-sm); text-decoration: none; }
.cmp-sec { display: grid; border-top: 1px solid var(--line); padding-top: 18px; }
.cmp-sec > h2 { font-size: var(--fs-xl); font-weight: 700; margin-bottom: 8px; }
.cmp-row { padding-block: 16px; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .cmp-cell { gap: 8px; align-content: start; }
.cmp-label { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; }
.cmp-note { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.cmp-row .dots { gap: 5px; }
.cmp-row .dots i { width: 11px; height: 11px; }
.cmp-val { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-yes { color: var(--c, var(--gold)); font-size: var(--fs-lg); font-weight: 700; line-height: 1; }
.cmp-no { color: var(--muted); }
.cmp-sello { color: var(--ink); background: var(--gold); border-radius: 999px; padding: 3px 10px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; }
.cmp-pyr { display: grid; justify-items: center; padding-block: 8px 4px; }
.cmp-pyr .pyramid { max-width: 320px; }
.cmp-btn { justify-self: start; }
@media (min-width: 640px) {
  .cmp-row .dots { gap: 7px; }
  .cmp-row .dots i { width: 13px; height: 13px; }
}
@media (min-width: 900px) {
  .cmp.cols-3 { --n: 3; }
  .cmp.cols-3 .c3 { display: grid; }
  .cmp.cols-3 .pyramid .s3 { display: inline; }
  .cmp-cells { gap: 28px; }
}
.cmp-cell .dots i.on { background: var(--c, var(--gold)); }
@media (max-width: 639px) { .cmp-shot { max-width: 130px; } }
/* Foco del gráfico superpuesto */
.cmp-focus { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 6px; }
.cmp-fbtn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.cmp-fbtn .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; opacity: .6; }
.cmp-fbtn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-fbtn[aria-pressed="true"] { color: var(--paper); border-color: var(--c); }
.cmp-fbtn[aria-pressed="true"] .sw { opacity: 1; }
.cmp .cmp-fbtn.c3 { display: none; }
@media (min-width: 900px) { .cmp.cols-3 .cmp-fbtn.c3 { display: inline-flex; } }
.brand .logo { display: block; height: 24px; width: auto; }
@media (min-width: 900px) { .brand .logo { height: 26px; } }
/* Portada: índice de la Guía */
.portal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: grid; align-content: start; gap: 8px; min-height: 150px; padding: 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--paper); text-decoration: none; }
.tile svg { color: var(--muted); }
.tile b { font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; text-wrap: balance; }
.tile span { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.tile.main { border-color: var(--gold); }
.tile.main svg { color: var(--gold); }
.tile:hover { border-color: var(--muted); }
.tile.main:hover { border-color: var(--gold); background: var(--surface-2); }
@media (min-width: 900px) { .portal { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tile { min-height: 170px; padding: 22px 20px; } }
@media (prefers-reduced-motion: no-preference) { .tile { transition: border-color .15s ease, transform .15s ease; } .tile:hover { transform: translateY(-2px); } }
.relato { color: var(--muted); font-family: var(--display); font-size: var(--fs-sm); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; }

/* Cuenta: registro, ingreso, recuperar contraseña */
.auth { display: grid; gap: 16px; max-width: 420px; }
.auth-form { display: grid; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px; }
.auth-form h2 { font-size: var(--fs-lg); }
.campo { display: grid; gap: 6px; }
.campo span { font-size: var(--fs-sm); color: var(--muted); }
.campo input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--paper); font: inherit; font-size: 16px; padding: 11px 12px; min-width: 0; }
.campo input:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.auth-form .btn { justify-self: start; }
.auth-form .btn[disabled] { opacity: .6; cursor: wait; }
.linkbtn { justify-self: start; background: none; border: 0; padding: 0; color: var(--sky); cursor: pointer; font-size: var(--fs-sm); }
.auth-msg { color: var(--gold); font-size: var(--fs-sm); }
.footer .switch span { align-self: center; }
.footer .switch a.chip { text-decoration: none; color: var(--paper); }

/* Foto real del producto */
.shot img.foto, .cmp-shot img.foto { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.card .shot, .ficha .shot, .cmp-shot { overflow: hidden; }
