/* Tienda de repuestos (/repuestos y /repuestos/<pieza>), 2026-09-24.
   Solo variables de tokens.css: sirve igual en tema claro y oscuro.
   Movimiento mínimo y nunca en los botones de comprar/WhatsApp (DISENO_MAESTRO). */

.rp-store, .rp-store * { letter-spacing: 0 !important; }
.rp-main { padding-top: 108px; padding-bottom: 80px; min-height: 70vh; }
.rp-ico { width: 20px; height: 20px; flex: none; }
.rp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rp-store .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }

/* Los títulos de la tienda no usan los tamaños gigantes del editorial (h1/h2/h3 globales):
   por eso llevan .rp-store delante, que gana a «html.cfx-editorial h2». */

/* index.css da a todo <section> 6rem arriba y abajo (portada). En la tienda cada bloque pone el suyo. */
.rp-store main section { padding-block: 0; }
.rp-store .rp-hero { padding-bottom: 34px; }
.rp-store .rp-vacio, .rp-store .rp-pronto { padding-block: 40px; }
.rp-store .rp-banda { padding: 28px 30px; }

/* Migas */
.rp-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.rp-crumbs a { color: var(--body-c); text-decoration: none; }
.rp-crumbs a:hover { color: var(--red-ink); }

/* Cabecera de la tienda */
.rp-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: end;
  padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.rp-kicker { color: var(--red-ink); font-size: 13px; font-weight: 700; text-transform: uppercase; margin: 0 0 12px; }
.rp-store .rp-hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.04; margin: 0 0 16px; color: var(--text); }
.rp-lead { font-size: 18px; line-height: 1.6; color: var(--body-c); margin: 0; max-width: 560px; }
.rp-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rp-trust li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); }
.rp-trust .rp-ico { width: 26px; height: 26px; color: var(--red-ink); margin-top: 2px; }
.rp-trust strong { display: block; color: var(--text); font-size: 15px; }
.rp-trust li > div > span { font-size: 14px; color: var(--body-c); }

/* Filtros */
.rp-filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 24px 0 14px; }
.rp-buscar { position: relative; flex: 1 1 320px; }
.rp-buscar .rp-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.rp-buscar input, .rp-select select { width: 100%; min-height: 50px; font: inherit; font-size: 16px; color: var(--input-text);
  background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 12px; }
.rp-buscar input { padding: 12px 16px 12px 46px; }
.rp-select select { padding: 12px 14px; min-width: 200px; }
.rp-buscar input:focus, .rp-select select:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 4px var(--input-focus-ring); }
.rp-check { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; color: var(--body-c); min-height: 50px; cursor: pointer; }
.rp-check input { width: 19px; height: 19px; accent-color: var(--red); }

.rp-cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.rp-cats::-webkit-scrollbar { display: none; }
.rp-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); background: var(--card); font-size: 14px; text-decoration: none; white-space: nowrap; }
.rp-chip b { font-weight: 600; color: var(--muted); font-size: 12px; }
.rp-chip:hover { border-color: var(--red-edge); background: var(--red-soft); }
.rp-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.rp-chip.on b { color: inherit; opacity: .7; }
.rp-conteo { font-size: 13px; color: var(--muted); margin: 6px 0 18px; }

/* Tarjetas */
.rp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rp-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line);
  border-radius: 14px; background: var(--card); overflow: hidden; transition: border-color .2s ease, box-shadow .25s ease; }
.rp-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.rp-card[hidden] { display: none; }
.rp-card-link { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 12px; color: inherit; text-decoration: none; }
.rp-card-foto { position: relative; aspect-ratio: 1 / 1; margin: -14px -16px 8px; background: var(--bg-2);
  display: grid; place-items: center; overflow: hidden; }
.rp-card-foto img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 14px;
  transition: transform .35s ease; }
.rp-card:hover .rp-card-foto img { transform: scale(1.04); }
.rp-sin-foto { position: absolute; width: 64px; height: 64px; color: var(--line-2); }
/* Con foto, el dibujo de reserva no se ve (las fotos del proveedor tienen fondo transparente). */
.rp-card-foto img:not([hidden]) ~ .rp-sin-foto, .rp-tile-foto img:not([hidden]) ~ .rp-sin-foto { display: none; }
.rp-card-cat { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--red-ink); }
.rp-store .rp-card-t { margin: 0; font-size: 16px; line-height: 1.35; color: var(--text); font-weight: 650;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rp-card-q { margin: 0; font-size: 13px; color: var(--body-c); }
.rp-card-pie { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.rp-precio { margin: 0; font-size: 22px; font-weight: 750; color: var(--text); }
.rp-precio s { font-size: .62em; font-weight: 500; color: var(--muted); margin-right: 4px; }
.rp-precio.consultar { font-size: 14px; font-weight: 600; color: var(--muted); }
.rp-precio.grande.consultar { font-size: 28px; }
.rp-stock { margin: 0; font-size: 13px; font-weight: 600; }
.rp-stock.si { color: var(--wa-hi); }
.rp-stock.no { color: var(--muted); }
.rp-agregar { margin: 0 16px 16px; min-height: 46px; font-size: 15px; }
.rp-card.agotado .rp-card-foto img { opacity: .55; filter: grayscale(.4); }

.rp-vacio, .rp-pronto { grid-column: 1 / -1; padding: 40px 0; max-width: 620px; }
.rp-store .rp-vacio h2, .rp-store .rp-pronto h2 { font-size: 26px; margin: 0 0 12px; color: var(--text); }
.rp-vacio p, .rp-pronto p { color: var(--body-c); line-height: 1.7; margin: 0 0 22px; }

.rp-banda { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 28px 30px;
  border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.rp-store .rp-banda h2 { margin: 0 0 6px; font-size: 22px; color: var(--text); }
.rp-banda p { margin: 0; color: var(--body-c); }
.rp-banda .btn { flex: none; min-height: 50px; }

/* Cabecera compacta de categoría y marca */
.rp-hero.compacto { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding-bottom: 26px; }
.rp-store .rp-hero.compacto h1 { font-size: clamp(30px, 4vw, 44px); }
.rp-hero.compacto .rp-lead { font-size: 17px; }
.rp-servicio { display: inline-flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--body-c); text-decoration: none; font-size: 14px; max-width: 320px; }
.rp-servicio strong { color: var(--text); }
.rp-servicio .rp-ico { width: 24px; height: 24px; color: var(--red-ink); }
.rp-servicio:hover { border-color: var(--red-edge); background: var(--red-soft); }

/* Compra por categoría (solo en la tienda) */
.rp-categorias { padding-top: 30px !important; }
.rp-store .rp-categorias h2 { font-size: 22px; margin: 0 0 16px; color: var(--text); }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rp-tile { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden;
  transition: border-color .2s ease, box-shadow .25s ease; }
.rp-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.rp-tile-link { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; padding: 14px 16px 6px; color: inherit; text-decoration: none; }
.rp-tile-foto { grid-row: 1 / 3; position: relative; width: 64px; height: 64px; border-radius: 10px; background: var(--bg-2);
  display: grid; place-items: center; overflow: hidden; }
.rp-tile-foto img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.rp-tile-foto .rp-sin-foto { width: 34px; height: 34px; }
.rp-tile-t { font-size: 17px; font-weight: 700; color: var(--text); align-self: end; }
.rp-tile-n { font-size: 13px; color: var(--muted); align-self: start; }
.rp-tile-marcas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 8px 16px 14px; }
.rp-tile-marcas a { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--body-c);
  text-decoration: none; border: 1px solid var(--line); }
.rp-tile-marcas a:hover { color: var(--red-ink); border-color: var(--red-edge); }

/* Grupos (una categoría en la tienda, una marca en la categoría) */
.rp-grupo { margin-top: 30px; }
.rp-grupo[hidden] { display: none; }
.rp-grupo + .rp-grupo { margin-top: 40px; }
.rp-grupo-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rp-store .rp-grupo-cab :is(h2, h3) { margin: 0; font-size: 24px; color: var(--text); }

/* Dentro de una página de Reparaciones: botones de marca (categoría) y de modelo (subcategoría) */
.rp-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 6px; scroll-margin-top: 90px; }
.rp-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font: inherit;
  font-size: 15px; font-weight: 600; border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  text-decoration: none; cursor: pointer; }
.rp-tab b { font-size: 12px; font-weight: 600; color: var(--muted); }
.rp-tab:hover { border-color: var(--red-edge); background: var(--red-soft); }
.rp-tab.on { background: var(--red); border-color: var(--red); color: var(--text-on-accent); }
.rp-tab.on b { color: inherit; opacity: .85; }
.rp-tab.chica { padding: 7px 13px; font-size: 13.5px; font-weight: 500; }
.rp-tab.chica.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.rp-modelos { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.rp-modelos[hidden] { display: none; }
.rp-modelos-t { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.rp-grupo-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; margin-left: 6px;
  border-radius: 13px; background: var(--red-soft); color: var(--red-ink); font-size: 14px; vertical-align: middle; }
.rp-en-servicio .rp-grupo-cab { border-bottom: 2px solid var(--line-2); }
.rp-en-servicio .rp-card-cat { font-size: 13px; }
.rp-en-servicio .rp-servicio-lead { max-width: 640px; margin-top: .8rem; color: var(--body-c); line-height: 1.6; }
.rp-en-servicio .rp-grupo:first-of-type { margin-top: 22px; }
.rp-grupo-cab a { color: var(--red-ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.rp-grupo-cab a:hover { text-decoration: underline; }

/* Botón flotante del carrito: abajo a la izquierda, lejos del WhatsApp flotante del sitio */
.rp-carrito { position: fixed; left: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; text-decoration: none;
  box-shadow: var(--shadow-lg); }
.rp-carrito[hidden] { display: none; }
.rp-carrito b { min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: var(--text-on-accent);
  display: inline-grid; place-items: center; font-size: 12px; padding: 0 6px; }
.rp-toast { position: fixed; left: 50%; bottom: 84px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity .2s ease, transform .2s ease; }
.rp-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Página de una pieza */
.rp-pieza { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.rp-galeria { position: sticky; top: 96px; min-width: 0; }
.rp-info { min-width: 0; }
.rp-escenario { position: relative; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.rp-carril { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1 / 1; outline: none; }
.rp-carril::-webkit-scrollbar { display: none; }
.rp-carril:focus-visible { box-shadow: inset 0 0 0 3px var(--input-focus-ring); }
.rp-slide { flex: 0 0 100%; scroll-snap-align: center; border: 0; padding: 0; margin: 0; background: none; cursor: zoom-in; display: grid; place-items: center; }
.rp-slide img { width: 100%; height: 100%; object-fit: contain; padding: 26px; }
.rp-lupa { position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--body-c);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; pointer-events: none; }
.rp-lupa .rp-ico { width: 16px; height: 16px; }
.rp-flecha { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.rp-flecha.izq { left: 12px; } .rp-flecha.der { right: 12px; }
.rp-flecha:hover { border-color: var(--red-edge); color: var(--red-ink); }
.rp-sin-fotos { aspect-ratio: 1 / 1; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.rp-sin-fotos .rp-sin-foto { position: static; width: 96px; height: 96px; }
.rp-miniaturas { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.rp-miniaturas button { flex: none; width: 72px; height: 72px; padding: 6px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg-2); cursor: pointer; }
.rp-miniaturas button.on { border-color: var(--red); }
.rp-miniaturas img { width: 100%; height: 100%; object-fit: contain; }

.rp-store .rp-info h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; margin: 8px 0 12px; color: var(--text); }
.rp-q { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px; border-radius: 999px; font-size: 14px;
  font-weight: 600; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); }
.rp-q .rp-ico { width: 16px; height: 16px; color: var(--wa-hi); }
.rp-compra { margin: 22px 0 26px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); }
.rp-precio.grande { font-size: 38px; line-height: 1; }
.rp-nota { margin: 8px 0 14px; font-size: 13px; color: var(--muted); }
.rp-compra .rp-stock { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rp-punto { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.rp-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.rp-botones .btn { min-height: 52px; font-size: 16px; }
.rp-botones .btn:only-child { grid-column: 1 / -1; }
.rp-botones .btn:hover, .rp-botones .btn:active { transform: none; }   /* los de comprar no se mueven */
.rp-ver-carrito { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--red-ink); font-weight: 600; }
.rp-ver-carrito[hidden] { display: none; }
.rp-bloque { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.rp-bloque .rp-ico { width: 26px; height: 26px; color: var(--red-ink); margin-top: 2px; }
.rp-bloque strong { display: block; color: var(--text); margin-bottom: 4px; }
.rp-bloque p { margin: 0; color: var(--body-c); font-size: 15px; line-height: 1.6; }
.rp-enlaces { margin-top: 6px !important; }
.rp-enlaces a { color: var(--red-ink); font-weight: 600; }
.rp-ficha { margin: 10px 0 0; border-top: 1px solid var(--line); }
.rp-ficha > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rp-ficha dt { color: var(--muted); font-size: 14px; }
.rp-ficha dd { margin: 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.rp-relacionados { margin-top: 64px; }
.rp-store .rp-relacionados h2 { font-size: 26px; margin: 0 0 20px; color: var(--text); }

/* Visor ampliado */
.rp-visor { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 14, .96); color: #fff; }
.rp-visor::backdrop { background: rgba(12, 12, 14, .96); }
.rp-visor-marco { position: absolute; inset: 60px 0 56px; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; touch-action: none; }
.rp-visor-marco.zoom { cursor: grab; }
.rp-visor-marco img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; -webkit-user-drag: none;
  background: #fff; border-radius: 8px; }
.rp-visor-ayuda { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 14px; color: rgba(255, 255, 255, .75); margin: 0; }
.rp-visor-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.rp-visor-btn:hover { background: rgba(255, 255, 255, .18); }
.rp-visor-btn.cerrar { top: 10px; right: 12px; }
.rp-visor-btn.izq { left: 12px; top: 50%; transform: translateY(-50%); }
.rp-visor-btn.der { right: 12px; top: 50%; transform: translateY(-50%); }

@media (max-width: 1100px) { .rp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .rp-hero, .rp-hero.compacto { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .rp-servicio { max-width: none; }
  .rp-pieza { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .rp-galeria { position: static; }
  .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 600px) {
  .rp-main { padding-top: 92px; }
  .rp-lead { font-size: 16px; }
  .rp-trust li { padding: 12px 14px; }
  .rp-select, .rp-select select { width: 100%; }
  .rp-card-link { padding: 12px 12px 10px; }
  .rp-card-foto { margin: -12px -12px 6px; }
  .rp-store .rp-card-t { font-size: 14px; }
  .rp-precio { font-size: 18px; }
  .rp-card-pie { flex-direction: column; gap: 2px; align-items: flex-start; }
  .rp-agregar { margin: 0 12px 12px; font-size: 14px; min-height: 44px; padding-inline: 8px; }
  .rp-agregar .rp-ico { display: none; }
  .rp-store .rp-banda { flex-direction: column; align-items: flex-start; padding: 22px; }
  .rp-tiles { grid-template-columns: minmax(0, 1fr); }
  /* En el celular los modelos van en una sola fila que se desliza: no empujan las pantallas hacia abajo. */
  .rp-modelos { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; }
  .rp-modelos::-webkit-scrollbar { display: none; }
  .rp-modelos > * { flex: none; }
  .rp-store .rp-grupo-cab :is(h2, h3) { font-size: 20px; }
  .rp-botones { grid-template-columns: 1fr; }
  .rp-precio.grande { font-size: 32px; }
  .rp-ficha > div { grid-template-columns: 110px minmax(0, 1fr); }
  .rp-flecha { display: none; }
  .rp-visor-btn.izq, .rp-visor-btn.der { top: auto; bottom: 48px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-card, .rp-card-foto img, .rp-toast { transition: none; }
  .rp-card:hover .rp-card-foto img { transform: none; }
  .rp-carril { scroll-behavior: auto; }
}
