/* paginas.css — páginas SEO de WxK (/piezas, /pieza/:id) */
/* Design tokens: igual que index.html */
:root {
  --ink: #0e0f12;
  --ink2: #16181d;
  --bone: #e7e9ee;
  --mut: #7a808c;
  --line: #262a31;
  --volt: #c6f24e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Big Shoulders Display', sans-serif; line-height: .92; letter-spacing: -.01em; }
.volt { color: var(--volt); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 600px) { .wrap { padding: 0 24px; } }

/* ── nav ── */
nav.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14,15,18,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 12px;
}
.nav-brand {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: 28px; letter-spacing: .02em; flex-shrink: 0;
}
.nav-brand i { font-style: normal; color: var(--volt); }
.nav-links {
  display: flex; gap: 20px; align-items: center; font-size: 13px;
}
.nav-links a { color: var(--mut); white-space: nowrap; }
.nav-links a:hover { color: var(--bone); }
.btn {
  display: inline-block; background: var(--volt); color: #141414;
  font-weight: 700; padding: 9px 18px; border-radius: 10px;
  font-size: 13px; transition: transform .12s; white-space: nowrap;
  cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--bone); border: 1px solid var(--line); }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* ── migas ── */
.migas {
  font-size: 13px; color: var(--mut);
  padding: 16px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.migas a { color: var(--mut); }
.migas a:hover { color: var(--bone); }
.migas span { color: var(--bone); }

/* ── page header ── */
.page-header { padding: 32px 0 24px; }
.page-header h1 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: clamp(36px, 6vw, 72px);
  line-height: .92; letter-spacing: -.01em;
}
.page-header .sub {
  color: var(--mut); font-size: 15px; margin-top: 12px; max-width: 680px;
}
.page-header .sub strong { color: var(--bone); }

/* ── aviso afiliado ── */
.aviso-afiliado {
  background: rgba(198,242,78,.07);
  border: 1px solid rgba(198,242,78,.18);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--mut);
  margin: 20px 0;
  line-height: 1.5;
}

/* ── mejor para ── */
.mejor-para {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 24px 0 32px;
}
.mejor-card {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.mejor-card .etiqueta {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--volt); font-weight: 700;
}
.mejor-card .mejor-nombre {
  font-weight: 700; font-size: 15px;
}
.mejor-card .mejor-grams {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--mut);
}
.mejor-card .mejor-precio {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700;
}
.mejor-card .gluca-pill {
  display: inline-block;
  background: rgba(198,242,78,.12); color: var(--volt);
  border: 1px solid rgba(198,242,78,.25);
  border-radius: 8px; padding: 3px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700;
}
.mejor-card .btn-ali {
  margin-top: 6px;
}

/* ── tabla comparativa ── */
.tabla-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 24px 0;
}
table.comp {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
table.comp th {
  background: var(--ink2); color: var(--mut);
  font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 14px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.comp td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.comp tr:last-child td { border-bottom: none; }
table.comp tr:hover td { background: rgba(255,255,255,.02); }
.td-img { width: 52px; }
.td-img img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 8px; display: block;
}
.td-img .no-img {
  width: 44px; height: 44px; background: var(--ink2);
  border-radius: 8px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.pieza-nombre a { color: var(--bone); font-weight: 500; }
.pieza-nombre a:hover { color: var(--volt); }
.pieza-nombre .pieza-marca { color: var(--mut); font-size: 12px; }
.td-grams {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  white-space: nowrap;
}
.badge-med {
  display: inline-block;
  background: rgba(198,242,78,.12); color: var(--volt);
  border: 1px solid rgba(198,242,78,.25);
  border-radius: 6px; padding: 2px 6px;
  font-size: 10px; letter-spacing: .04em; font-weight: 700;
  margin-left: 4px; white-space: nowrap;
}
.badge-dec {
  display: inline-block;
  background: rgba(122,128,140,.12); color: var(--mut);
  border: 1px solid rgba(122,128,140,.25);
  border-radius: 6px; padding: 2px 6px;
  font-size: 10px; letter-spacing: .04em; font-weight: 700;
  margin-left: 4px; white-space: nowrap;
}
.td-precio {
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.td-ahorro {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--volt);
  white-space: nowrap;
}
.td-ahorro.neg { color: var(--mut); }
.td-gluca {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  white-space: nowrap;
}
.stars { color: var(--volt); font-size: 13px; }
.btn-sm {
  display: inline-block;
  background: var(--volt); color: #141414;
  font-weight: 700; font-size: 12px; padding: 6px 12px;
  border-radius: 8px; white-space: nowrap;
  transition: transform .1s;
}
.btn-sm:hover { transform: translateY(-1px); }
.btn-sm.search { background: transparent; border: 1px solid var(--volt); color: var(--volt); }

/* tabla responsive en móvil: convierte filas en bloques */
@media (max-width: 640px) {
  .tabla-wrap { overflow-x: unset; border: none; border-radius: 0; }
  table.comp { display: block; }
  table.comp thead { display: none; }
  table.comp tbody { display: flex; flex-direction: column; gap: 12px; }
  table.comp tr {
    display: grid;
    grid-template-columns: 52px 1fr 1fr;
    grid-template-rows: auto auto;
    background: var(--ink2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    gap: 8px;
    border-bottom: 1px solid var(--line) !important;
  }
  table.comp tr:hover td { background: transparent; }
  table.comp td {
    padding: 0; border-bottom: none !important;
    display: flex; flex-direction: column; justify-content: center;
  }
  .td-img { grid-row: 1 / 3; align-self: center; }
  .td-img img, .td-img .no-img { width: 44px; height: 44px; }
  .pieza-nombre { grid-column: 2 / 4; grid-row: 1; }
  .td-grams { grid-column: 2; grid-row: 2; }
  .td-precio { grid-column: 3; grid-row: 2; font-size: 13px; }
  table.comp td.td-grams, table.comp td.td-precio, table.comp td.td-ahorro-c, table.comp td.td-gluca { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
  .td-ahorro-c { grid-column: 2; grid-row: 3; font-size: 13px; }
  .td-gluca { grid-column: 3; grid-row: 3; font-size: 13px; }
  .gl-u { display: inline; color: var(--mut); font-size: 11px; }
  .td-accion { grid-column: 1 / 4; grid-row: 4; padding-top: 8px; }
  table.comp tr { grid-template-rows: auto auto auto auto; }
}

/* ── tarjetas índice /piezas ── */
.tipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.tipo-card {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s;
}
.tipo-card:hover { border-color: var(--volt); }
.tipo-card .tipo-titulo {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 24px;
}
.tipo-card .tipo-best {
  font-size: 13px; color: var(--mut);
}
.tipo-card .tipo-best strong { color: var(--bone); }
.tipo-card .tipo-stats {
  display: flex; gap: 14px; font-size: 12px; color: var(--mut);
}
.tipo-card .tipo-link {
  margin-top: auto;
  font-size: 13px; font-weight: 600; color: var(--volt);
}

/* ── ficha de producto ── */
.ficha-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px;
  margin: 28px 0;
  align-items: start;
}
@media (max-width: 760px) {
  .ficha-grid { grid-template-columns: 1fr; }
}
.ficha-img {
  position: sticky; top: 76px;
}
.ficha-img img {
  width: 100%; max-width: 340px;
  aspect-ratio: 1; object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: block;
  min-height: 120px;
}
.ficha-img .no-img-lg {
  width: 100%; max-width: 340px; aspect-ratio: 1;
  background: var(--ink2); border-radius: 18px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
@media (max-width: 760px) {
  .ficha-img img { max-height: 280px; }
  .ficha-img .no-img-lg { max-height: 200px; }
}
.ficha-body { min-width: 0; }
.ficha-brand { color: var(--mut); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.ficha-body h1 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: clamp(28px, 5vw, 52px);
  line-height: .95;
  margin-bottom: 20px;
}
.ficha-peso {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex; gap: 20px; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ficha-peso .grams-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 40px;
  color: var(--volt);
}
.ficha-peso .grams-unit {
  font-family: 'JetBrains Mono', monospace;
  color: var(--mut); font-size: 14px; margin-top: 2px;
}
.ficha-peso .peso-fuente { font-size: 12px; color: var(--mut); }
.ficha-precio-box {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.ficha-precio-box .precio-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 32px;
}
.ficha-precio-box .precio-nota {
  font-size: 12px; color: var(--mut); margin-top: 4px;
}
.ficha-ahorro {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  font-size: 14px; color: var(--mut);
  margin-bottom: 20px;
}
.ficha-ahorro .gluca-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 20px;
  color: var(--volt);
}
.ficha-ahorro .ahorro-g {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--bone);
}
.ficha-valoracion {
  font-size: 13px; color: var(--mut); margin-bottom: 16px;
}
.ficha-stars { font-size: 16px; color: var(--volt); }
.btn-principal {
  display: block; width: 100%;
  background: var(--volt); color: #141414;
  font-weight: 700; font-size: 16px;
  padding: 16px 24px; border-radius: 14px;
  text-align: center;
  transition: transform .12s;
  margin-bottom: 12px;
}
.btn-principal:hover { transform: translateY(-2px); }
.btn-principal.search-btn {
  background: transparent; color: var(--volt);
  border: 2px solid var(--volt);
}

/* ── cupón ── */
.cupon-box {
  background: rgba(198,242,78,.07);
  border: 1px solid rgba(198,242,78,.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.cupon-box .cupon-titulo {
  font-weight: 700; font-size: 13px; color: var(--volt); margin-bottom: 6px;
}
.cupon-box .cupon-codigo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700; letter-spacing: .1em;
  color: var(--bone);
}
.cupon-box .cupon-detalle {
  font-size: 12px; color: var(--mut); margin-top: 4px;
}
.btn-cupon {
  display: inline-block; margin-top: 10px;
  background: var(--volt); color: #141414;
  font-weight: 700; font-size: 13px;
  padding: 8px 16px; border-radius: 8px;
  cursor: pointer; border: none;
  transition: transform .1s;
}
.btn-cupon:hover { transform: translateY(-1px); }
.cupon-fallback { font-size: 12px; color: var(--mut); margin-top: 4px; display: none; }

/* ── alternativas ── */
.alternativas { margin: 32px 0; }
.alternativas h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 28px; margin-bottom: 16px;
}

/* ── otros tipos ── */
.otros-tipos { margin: 40px 0 20px; }
.otros-tipos h3 {
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 12px;
}
.tipos-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tipo-pill {
  background: var(--ink2); border: 1px solid var(--line);
  border-radius: 20px; padding: 6px 14px;
  font-size: 13px; color: var(--mut);
  transition: border-color .12s, color .12s;
}
.tipo-pill:hover { border-color: var(--volt); color: var(--bone); }
.tipo-pill.active { border-color: var(--volt); color: var(--volt); }

/* ── pie ── */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 48px;
}
footer.site-footer .foot-inner {
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: flex-start;
}
footer.site-footer .foot-brand {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: 20px;
}
footer.site-footer .foot-brand i { font-style: normal; color: var(--volt); }
footer.site-footer .foot-aviso {
  font-size: 12px; color: var(--mut); max-width: 560px; line-height: 1.5;
  margin-top: 8px;
}
footer.site-footer .foot-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
footer.site-footer .foot-links a {
  font-size: 12px; color: var(--mut); padding: 4px 10px;
  background: var(--ink2); border: 1px solid var(--line); border-radius: 14px;
}
footer.site-footer .foot-links a:hover { color: var(--bone); border-color: var(--mut); }

/* ── section sin ref ── */
.sin-ref-note {
  background: var(--ink2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px;
  font-size: 13px; color: var(--mut); margin: 16px 0;
}

/* ── utilidades ── */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* focus visible */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
  border-radius: 4px;
}

/* unidad de g/luca: solo en celular (en escritorio la dice el encabezado) */
.gl-u { display: none; }
@media (max-width: 640px) { .gl-u { display: inline; } }
