/* =========================================================================
   RedAuto — Sistema de diseño
   Fondo grafito/negro, rojo de marca, blanco de contraste. Mobile-first,
   con ajustes progresivos para tablet/escritorio.
   ========================================================================= */

:root {
  --color-bg: #0c0c0e;
  --color-surface: #17171a;
  --color-surface-2: #1e1e22;
  --color-surface-raised: #202024;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);

  --color-red: #e53935;
  --color-red-dark: #b8302c;
  --color-red-soft: rgba(229, 57, 53, 0.16);

  --color-white: #ffffff;
  --color-text: #f3f3f4;
  --color-text-secondary: #a8a8b0;
  --color-text-muted: #737379;

  --color-success: #2fbf71;
  --color-success-soft: rgba(47, 191, 113, 0.14);
  --color-warning: #f5a623;
  --color-warning-soft: rgba(245, 166, 35, 0.14);
  --color-danger-soft: rgba(229, 57, 53, 0.14);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.34);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.32), 0 18px 38px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(229, 57, 53, 0.28);
  --shadow-sheet: 0 -12px 32px rgba(0, 0, 0, 0.5);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --bottom-nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-pad-top: env(safe-area-inset-top, 0px);
  --content-max: 480px;
}

@media (min-width: 1024px) {
  :root {
    --bottom-nav-height: 0px;
    --sidebar-width: 92px;
  }
}

* { box-sizing: border-box; }
/* html/body NUNCA hacen scroll — el documento siempre mide exactamente el
   viewport, sin importar si el contenido de la pantalla activa es más
   corto o más largo que la pantalla. Es el .app-shell de abajo el que
   hace scroll de su propio contenido.
   height: 100dvh (con 100% como respaldo si el navegador no soporta dvh)
   en vez de 100%: en iOS, sobre todo en modo standalone (app agregada al
   Home Screen), "100%"/"100vh" a veces mide un poco más alto que lo que
   en verdad se ve en pantalla — y ahí la barra inferior (position: fixed,
   bottom: 0) queda pegada al fondo de esa medida "fantasma" en vez del
   borde real, dejando un hueco visible debajo. dvh siempre refleja el
   alto real y visible del viewport. */
html, body { height: 100%; height: 100dvh; overflow: hidden; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon { display: block; flex-shrink: 0; }

/* ---------- Splash screen ----------
   Minimalista al estilo del boot de una app nativa (Apple): fondo negro
   liso, sólo el logo y un anillo de carga circular alrededor — nada de
   texto ni de rebote, para que se sienta sobrio y confiado en vez de
   "juguetón". El glow ambiental se asienta primero, el logo entra con un
   fundido/escala sin rebote, y el anillo se llena una sola vez en lo que
   dura el splash (ver SPLASH_MIN_MS en js/app.js) — cada pieza anima su
   propia propiedad para poder combinarlas sin que se pisen.*/
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); overflow: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.splash.is-hidden { opacity: 0; transform: scale(1.06); pointer-events: none; }

.splash__glow {
  position: absolute; top: 50%; left: 50%; width: 520px; height: 520px;
  transform: translate(-50%, -50%) scale(1);
  /* Presencia, no protagonismo: alfa bajo para que se sienta como
     ambiente detrás del logo, no como el elemento que capta la mirada. */
  background: radial-gradient(circle, rgba(229,57,53,0.22), rgba(229,57,53,0.05) 45%, transparent 70%);
  filter: blur(6px);
  opacity: 0;
  animation: splash-glow-in 900ms ease forwards, splash-glow-breathe 3.6s ease-in-out infinite;
}

.splash__ring-wrap {
  position: relative; width: 176px; height: 176px;
  display: flex; align-items: center; justify-content: center;
}
.splash__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.splash__ring-track, .splash__ring-fill {
  fill: none; stroke-width: 4; stroke-linecap: round;
}
.splash__ring-track { stroke: rgba(255,255,255,0.1); }
.splash__ring-fill {
  /* Rojo más vivo que el --color-red de marca (usado en el resto de la
     app) — a propósito sólo acá, para que el anillo se vea más intenso
     sin cambiar el rojo del resto de la interfaz. */
  stroke: #ff2b2b;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  filter: drop-shadow(0 0 7px rgba(255,43,43,0.75));
  animation: splash-ring-fill 1500ms cubic-bezier(0.4, 0, 0.2, 1) 350ms forwards;
}
.splash__logo {
  position: relative; width: 108px;
  opacity: 0; transform: scale(0.85);
  animation: splash-logo-in 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splash-glow-in { to { opacity: 1; } }
@keyframes splash-glow-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes splash-logo-in { to { opacity: 1; transform: scale(1); } }
@keyframes splash-ring-fill { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .splash__glow, .splash__ring-fill, .splash__logo { animation: none !important; }
  .splash__glow { opacity: 1; }
  .splash__ring-fill { stroke-dashoffset: 0; }
  .splash__logo { opacity: 1; transform: none; }
}

/* ---------- Layout shell ---------- */
/* .bottom-nav (position: fixed) vive FUERA de .app-shell a propósito (ver
   index.html) — -webkit-overflow-scrolling: touch en un contenedor con
   scroll puede "atrapar" a sus descendientes position:fixed en iOS,
   haciendo que dejen de fijarse al viewport real y se desubiquen. Por eso
   tampoco se usa esa propiedad acá: en iOS moderno el scroll con inercia
   ya es nativo en cualquier overflow:auto, no hace falta pedirlo aparte. */
.app-shell { height: 100%; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior-y: contain; }
.screen-content {
  flex: 1;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
  opacity: 1;
  transition: opacity 0.22s ease;
}
/* Sólo opacity, nunca transform: cualquier transform (incluso translateY(0))
   convierte a #screen-content en containing block y rompe el position:fixed
   de .sticky-actions (el botón fijo de comprar quedaba fuera del viewport). */
.screen-content.screen-enter { opacity: 0; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .screen-content { transition: none; }
}
.screen-pad {
  padding: 4px 16px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.screen-loading .screen-pad { padding-top: 16px; }

@media (min-width: 640px) {
  .screen-pad { --content-max: 640px; padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1024px) {
  .app-shell { flex-direction: row; }
  .screen-content { flex: 1; padding-bottom: 40px; margin-left: var(--sidebar-width); }
  .screen-pad { --content-max: 980px; }
  .top-header { margin-left: var(--sidebar-width); }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14.5px;
  min-height: 48px;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 8px 14px; font-size: 13px; }
.btn--primary { background: var(--color-red); color: var(--color-white); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--primary:disabled { background: var(--color-surface-2); color: var(--color-text-muted); cursor: not-allowed; }
.btn--outline { background: transparent; border-color: var(--color-border-strong); color: var(--color-text); }
.btn--outline:hover { border-color: var(--color-red); }
.btn--ghost { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: transform 0.14s var(--ease-out), background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn.is-active { color: var(--color-red); border-color: var(--color-red); background: var(--color-red-soft); }
@media (hover: hover) {
  .icon-btn:hover { border-color: var(--color-border-strong); }
}
.btn-icon-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s var(--ease-out), filter 0.15s ease;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-red);
  color: var(--color-white);
  border: none;
  flex-shrink: 0;
}
.btn-icon-primary:active { transform: scale(0.88); }
@media (hover: hover) {
  .btn-icon-primary:hover { filter: brightness(1.08); }
}
.text-btn { background: none; border: none; color: var(--color-red); font-weight: 600; font-size: 13.5px; padding: 4px 0; }

/* ---------- Encabezados ---------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--header-pad-top) + 14px) 16px 12px;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.top-header__title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.top-header--detail .top-header__title { text-align: center; }
.top-header__actions { display: flex; align-items: center; gap: 10px; }
.top-header__right { display: flex; align-items: center; gap: 8px; }

.brand-lockup { display: flex; align-items: center; gap: 8px; }
.brand-lockup--center { justify-content: center; margin: 8px 0 4px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: block; object-fit: cover; flex-shrink: 0;
}
.brand-lockup--center .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.brand-word .accent { color: var(--color-red); }

.dot-badge {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-red); border: 2px solid var(--color-bg);
}
.nav-badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-red); color: var(--color-white);
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--color-bg);
}

.location-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 10px 0 2px;
  color: var(--color-text); font-weight: 600; font-size: 14px;
}
.location-chip__chevron { transform: rotate(90deg); color: var(--color-text-muted); }
.trust-line { color: var(--color-text-secondary); font-size: 13px; margin: 4px 0 16px; }
.trust-line--tight { display: flex; align-items: center; gap: 6px; margin: 10px 0 14px; }

/* ---------- Buscador ---------- */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 14px;
}
.search-bar__icon { color: var(--color-text-muted); }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--color-text); font-size: 14.5px;
}
.search-bar input::placeholder { color: var(--color-text-muted); }

/* ---------- Selector de vehículo ---------- */
.vehicle-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.vehicle-picker select,
.filters-form select,
.filters-form input,
.stacked-form select {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 11px 10px;
  font-size: 13.5px;
  appearance: none;
}
.vehicle-picker select { text-align: center; }
.btn--primary + .btn--primary { margin-top: 8px; }
#btn-vehicle-search { margin-bottom: 22px; }

/* ---------- Garage / Mis vehículos ---------- */
.vehicle-chip-row { margin-bottom: 16px; }
.vehicle-chip-row > * { flex: 0 0 auto; }
.vehicle-chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-secondary);
  border-radius: var(--radius-pill); padding: 10px 16px; font-size: 13px; font-weight: 600;
}
.vehicle-chip.is-active { background: var(--color-red-soft); border-color: var(--color-red); color: var(--color-text); }
.vehicle-chip--add { color: var(--color-red); border-style: dashed; }
.empty-vehicle-prompt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md);
  padding: 13px 14px; margin-bottom: 14px; color: var(--color-text);
}
.empty-vehicle-prompt__icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-red-soft); color: var(--color-red);
  display: flex; align-items: center; justify-content: center;
}
.empty-vehicle-prompt__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.empty-vehicle-prompt__text strong { font-size: 13.5px; }
.empty-vehicle-prompt__text small { font-size: 11.5px; color: var(--color-text-secondary); }

.vehicle-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.vehicle-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 13px;
}
.vehicle-card.is-active { border-color: var(--color-red); background: linear-gradient(180deg, var(--color-red-soft), transparent 60%), var(--color-surface); }
.vehicle-card__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--color-surface-2); color: var(--color-red); display: flex; align-items: center; justify-content: center;
}
.vehicle-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vehicle-card__title { font-size: 14px; font-weight: 600; }
.vehicle-card__meta { font-size: 11.5px; color: var(--color-text-muted); }
.vehicle-card__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Compatibilidad inteligente ---------- */
.compat-inline {
  display: inline-flex; align-items: center; gap: 5px; margin: 0;
  font-size: 11.5px; font-weight: 700; color: var(--color-success);
}
.compat-banner {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 11px 13px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
}
.compat-banner--ok { background: var(--color-success-soft); color: var(--color-success); }
.compat-banner--warn { background: var(--color-warning-soft); color: var(--color-warning); }

/* ---------- Menú de perfil ---------- */
.menu-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.menu-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 13px;
  color: var(--color-text);
}
.menu-row__icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--color-surface-2); color: var(--color-red); display: flex; align-items: center; justify-content: center;
}
.menu-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-row__label { font-size: 13.5px; font-weight: 600; }
.menu-row__meta { font-size: 11.5px; color: var(--color-text-muted); }

/* ---------- WhatsApp / entrega ---------- */
.delivery-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.delivery-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--color-surface-2); color: var(--color-text-secondary);
  border-radius: var(--radius-pill); padding: 6px 11px; font-size: 11.5px; font-weight: 600;
}
.store-info-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--color-text-secondary); padding: 8px 0; border-bottom: 1px solid var(--color-border);
}
.store-info-strip:last-of-type { border-bottom: none; }

/* ---------- Chat "Preguntar a la tienda" ---------- */
.chat-widget { display: flex; flex-direction: column; gap: 12px; }
.chat-widget__subtitle { font-size: 12px; color: var(--color-text-muted); margin-top: -6px; }
.chat-widget__messages {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto; padding: 4px 2px;
}
.chat-bubble {
  max-width: 84%; padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45;
}
.chat-bubble--store {
  align-self: flex-start; background: var(--color-surface-2); color: var(--color-text);
  border-bottom-left-radius: 4px;
}
.chat-bubble--user {
  align-self: flex-end; background: var(--color-red); color: var(--color-white);
  border-bottom-right-radius: 4px;
}
.chat-bubble--typing { display: flex; gap: 4px; align-items: center; padding: 13px; }
.chat-bubble--typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-muted);
  animation: chat-typing 1s infinite ease-in-out;
}
.chat-bubble--typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.chat-widget__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip {
  background: none; border: 1px solid var(--color-red); color: var(--color-red);
  border-radius: var(--radius-pill); padding: 7px 12px; font-size: 12px; font-weight: 600;
}
.chat-chip:active { transform: scale(0.97); }
.chat-chip:disabled { opacity: 0.4; border-color: var(--color-border); color: var(--color-text-muted); }

.chat-widget__composer { display: flex; gap: 8px; align-items: center; }
.chat-widget__composer input {
  flex: 1; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 11px 15px; color: var(--color-text); font-size: 13.5px;
}
.chat-widget__composer input:focus { border-color: var(--color-red); }

.chat-widget__cta { display: flex; gap: 10px; }
.chat-widget__cta .btn { flex: 1; }

.chat-widget__fallback {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  font-size: 11.5px; color: var(--color-text-muted); padding-top: 4px; border-top: 1px solid var(--color-border);
}
.chat-widget__fallback-link { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-secondary); font-weight: 600; }

/* ---------- CTA secundaria de contacto (de-enfatizada a propósito) ---------- */
.contact-secondary-row {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 10px; font-size: 12px; color: var(--color-text-muted);
}
.contact-secondary-row a { display: inline-flex; align-items: center; gap: 5px; color: var(--color-text-secondary); font-weight: 600; }

.trust-note {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 12px; color: var(--color-text-secondary);
}
.trust-note .icon { color: var(--color-success); flex-shrink: 0; }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); border-radius: var(--radius-pill);
  padding: 7px 12px; font-size: 12.5px; font-weight: 500;
}
.chip button { background: none; border: none; color: inherit; display: flex; }
.chip--action { color: var(--color-text); font-weight: 600; }
.chip--action:hover { border-color: var(--color-red); color: var(--color-red); }
.results-count { color: var(--color-text-secondary); font-size: 13px; margin-bottom: 12px; }

/* ---------- Categorías ---------- */
.section { margin-bottom: 26px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section__title { font-size: 16px; font-weight: 600; }
.section__link { color: var(--color-red); font-size: 13px; font-weight: 600; }

.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.category-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 14px 6px;
  color: var(--color-text-secondary); text-align: center;
  transition: transform 0.16s var(--ease-out), border-color 0.16s ease, color 0.16s ease;
}
.category-tile:active { transform: scale(0.95); }
@media (hover: hover) {
  .category-tile:hover { border-color: var(--color-red); color: var(--color-text); transform: translateY(-2px); }
}
.category-tile__icon { color: var(--color-red); }
.category-tile__label { font-size: 10.5px; font-weight: 600; line-height: 1.2; }

@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(8, 1fr); } }

/* ---------- Carruseles horizontales ---------- */
.h-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.h-scroll::-webkit-scrollbar { height: 0; }
.h-scroll > * { scroll-snap-align: start; flex: 0 0 172px; }
.h-scroll > .store-card { flex-basis: 240px; }

/* ---------- Tarjeta de producto (grid/carrusel) ---------- */
.product-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), border-color 0.18s ease;
  cursor: pointer;
}
.product-card:active { transform: scale(0.98); }
@media (hover: hover) {
  .product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: rgba(229, 57, 53, 0.35); }
}
.product-card.product-row:hover { transform: none; }
.product-card__media { position: relative; aspect-ratio: 1.3 / 1; }
/* Ficha de producto estilo marketplace: blanco puro, producto centrado. */
.product-tile {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff;
  isolation: isolate;
}
.product-tile::before {
  content: ''; position: absolute; left: 50%; bottom: 9%;
  width: 54%; height: 12%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(20,20,22,0.16), transparent 72%);
  z-index: 0;
}
.product-art__svg { position: relative; z-index: 1; width: 66%; height: 66%; }
.product-tile--photo::before { content: none; }
.product-tile--photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.product-row__media .product-art__svg,
.cart-row__media .product-art__svg { width: 76%; height: 76%; }
.product-detail__media .product-art__svg { width: 52%; height: 52%; }

.badge--discount {
  position: absolute; top: 8px; left: 8px;
  background: var(--color-red); color: var(--color-white);
  font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: var(--radius-sm);
}
.product-card__fav {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px;
  background: rgba(255,255,255,0.92); color: #3a3d42; border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.22); transition: transform 0.14s var(--ease-out);
}
.product-card__fav:active { transform: scale(0.88); }
.product-card__fav.is-active { color: var(--color-red); }
.product-card__body { padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.product-card__name {
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 34px;
}
.product-card__compat { font-size: 11.5px; color: var(--color-text-muted); }
.product-card__price-row { display: flex; align-items: baseline; gap: 7px; }
.product-card__price { font-size: 16px; font-weight: 700; }
.product-card__price-old { font-size: 12px; color: var(--color-text-muted); text-decoration: line-through; }
.product-card__store { font-size: 11.5px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 4px; }
.product-card__add { position: absolute; bottom: 12px; right: 12px; z-index: 2; }
.product-card__add:disabled { background: var(--color-surface-2); color: var(--color-text-muted); cursor: not-allowed; }
/* La tarjeta compacta es angosta y el botón flotante de carrito se come su
   esquina inferior derecha: el badge de inventario (con emoji) y la
   calificación no pueden competir por ese espacio sin solaparse. */
.product-card__body { padding-right: 58px; }
.product-card__meta {
  display: flex; align-items: center; gap: 4px; margin-top: 2px; overflow: hidden;
}
.product-card__meta .badge {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1;
  font-size: 9.5px; padding: 3px 6px; gap: 3px;
}
.product-card__meta .rating { flex-shrink: 0; margin-left: auto; font-size: 11.5px; gap: 3px; }
.product-card__meta .rating__count { display: none; }

.store-check { color: var(--color-red); }

/* ---------- Badges / rating ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; padding: 4px 8px;
  border-radius: var(--radius-sm); white-space: nowrap;
}
.badge--ok { background: var(--color-success-soft); color: var(--color-success); }
.badge--off { background: var(--color-danger-soft); color: #ff7a76; }
.badge--wait { background: var(--color-warning-soft); color: var(--color-warning); }
.badge--neutral { background: var(--color-surface-2); color: var(--color-text-secondary); }
.badge--verified { background: var(--color-red-soft); color: var(--color-red); }

.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.rating__icon { color: var(--color-warning); }
.rating__count { color: var(--color-text-muted); font-weight: 500; }
.rating--lg { font-size: 16px; }

/* ---------- Skeletons ---------- */
.skeleton {
  background: linear-gradient(100deg, var(--color-surface-2) 30%, var(--color-surface-raised) 50%, var(--color-surface-2) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.skeleton--text { height: 11px; border-radius: 5px; margin-top: 6px; }
.skeleton--hero { height: 220px; border-radius: var(--radius-lg); margin-top: 8px; }
.skeleton--row { height: 60px; border-radius: var(--radius-md); margin-bottom: 10px; }
.product-card--skeleton .product-card__media { aspect-ratio: 1.3/1; }
.product-card--skeleton .product-card__body { padding: 12px; }
.product-row--skeleton .product-row__media { width: 84px; height: 84px; border-radius: var(--radius-md); }

/* ---------- Tarjeta de tienda ---------- */
.store-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), border-color 0.18s ease;
}
.store-card:active { transform: scale(0.98); }
@media (hover: hover) {
  .store-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: rgba(229, 57, 53, 0.35); }
}
.store-card__cover {
  width: 48px; height: 48px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: linear-gradient(145deg, var(--color-red), #7a1613);
  color: var(--color-white); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.store-card__cover--photo, .store-strip__cover--photo {
  background: var(--color-white); padding: 0; overflow: hidden;
}
.store-card__cover--photo img, .store-strip__cover--photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.store-card__body { flex: 1; min-width: 0; }
.store-card__title-row { display: flex; align-items: center; gap: 6px; }
.store-card__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card__location { font-size: 11.5px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.store-card__meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--color-text-muted); }
.store-card__years::before { content: '·'; margin-right: 8px; }
.store-card__chevron { color: var(--color-text-muted); flex-shrink: 0; }
.store-list { display: flex; flex-direction: column; gap: 10px; }
.store-card--skeleton .store-card__cover { }

@media (min-width: 768px) {
  .store-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .store-list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Fila de producto (resultados / catálogo tienda) ---------- */
.product-list { display: flex; flex-direction: column; gap: 10px; }
.product-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; cursor: pointer;
}
.product-row__media { width: 84px; height: 84px; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; }
.product-row__media .product-tile { border-radius: var(--radius-md); }
.product-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.product-row__name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.product-row__compat { font-size: 11.5px; color: var(--color-text-muted); }
.product-row__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.product-row__store { font-size: 11.5px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 4px; }
.dot-sep { color: var(--color-text-muted); }
.product-row__price-row { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; }
.product-row__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }

@media (min-width: 900px) {
  .product-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ---------- Estado vacío ---------- */
.empty-state {
  text-align: center; padding: 42px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  grid-column: 1 / -1;
}
.empty-state__icon {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; color: var(--color-text-muted);
  margin-bottom: 4px;
}
.empty-state__title { font-weight: 600; font-size: 14.5px; }
.empty-state__message { color: var(--color-text-secondary); font-size: 13px; max-width: 320px; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Navegación inferior / sidebar ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(15, 15, 17, 0.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  padding: 8px 6px calc(6px + var(--safe-bottom));
  /* Fuerza su propia capa de composición — sin esto, en iOS a veces el fixed
     + backdrop-filter parpadea/se despega un instante durante el scroll. */
  transform: translateZ(0);
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--color-text-muted); padding: 4px 10px; border-radius: var(--radius-sm);
  min-width: 56px;
}
.bottom-nav__icon { position: relative; display: flex; }
.bottom-nav__label { font-size: 10px; font-weight: 600; }
.bottom-nav__item.is-active { color: var(--color-red); }

@media (min-width: 1024px) {
  .bottom-nav {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--sidebar-width);
    flex-direction: column; justify-content: flex-start; gap: 10px;
    padding: 28px 8px; border-top: none; border-right: 1px solid var(--color-border);
  }
  .bottom-nav__item { width: 100%; padding: 10px 4px; }
}

/* ---------- Modal / bottom sheet ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; overflow-x: hidden;
  background: var(--color-surface); border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet); padding: 8px 18px calc(20px + var(--safe-bottom));
  animation: sheet-up 0.22s ease;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.modal-sheet__handle { width: 40px; height: 4px; background: var(--color-border-strong); border-radius: var(--radius-pill); margin: 6px auto 12px; }
.modal-sheet__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-sheet__title { font-size: 16px; font-weight: 600; }

@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: var(--radius-lg); max-height: 80vh; }
}

.option-list { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.option-list__item { text-align: left; background: none; border: none; color: var(--color-text); padding: 12px 4px; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.option-list__item:last-child { border-bottom: none; }

/* ---------- Centro de notificaciones ---------- */
.notif-feed { display: flex; flex-direction: column; gap: 10px; }
.notif-feed__item {
  position: relative; display: flex; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 13px;
}
.notif-feed__item.is-unread { border-color: rgba(229,57,53,0.4); background: linear-gradient(90deg, var(--color-red-soft), transparent 40%), var(--color-surface); }
.notif-feed__icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-surface-2); color: var(--color-red); display: flex; align-items: center; justify-content: center;
}
.notif-feed__body { flex: 1; min-width: 0; }
.notif-feed__title { font-size: 13.5px; font-weight: 600; }
.notif-feed__message { font-size: 12px; color: var(--color-text-secondary); margin-top: 3px; line-height: 1.5; }
.notif-feed__time { font-size: 11px; color: var(--color-text-muted); margin-top: 6px; }
.notif-feed__dot { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-red); }

/* ---------- Filtros ---------- */
.filters-form__group { border: none; padding: 0; margin: 0 0 16px; }
.filters-form__group legend { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; padding: 0; }
.filters-form__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.filters-form__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters-form__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text-secondary);
  border-radius: var(--radius-pill); padding: 8px 14px; font-size: 13px; font-weight: 500;
}
.pill.is-selected { background: var(--color-red); border-color: var(--color-red); color: var(--color-white); }
.filters-form__actions { display: flex; gap: 10px; padding-top: 4px; }
.filters-form__actions .btn { flex: 1; }

/* ---------- Detalle de producto ---------- */
.product-detail__media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1.3/1; margin-bottom: 16px; }
.product-detail__media .product-tile { }
.product-detail__name { font-size: 19px; font-weight: 700; line-height: 1.3; }
.product-detail__brand { color: var(--color-text-secondary); font-size: 12.5px; margin-top: 4px; }
.product-detail__meta-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.product-detail__price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.product-detail__price { font-size: 26px; font-weight: 800; }
.product-detail__badges { display: flex; gap: 8px; margin-top: 10px; }

.detail-block { margin-top: 24px; }
.detail-block__title { font-size: 14.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.detail-block__text { color: var(--color-text-secondary); font-size: 13.5px; line-height: 1.55; }
.compat-list { padding-left: 2px; }
.compat-list li { list-style: none; font-size: 13.5px; color: var(--color-text-secondary); padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.compat-list li:last-child { border-bottom: none; }

.store-strip {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px;
}
.store-strip__cover {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--color-red), #7a1613); color: var(--color-white);
  font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.store-strip__info { flex: 1; min-width: 0; }
.store-strip__name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-strip__meta { font-size: 11.5px; color: var(--color-text-secondary); margin-top: 3px; }

.qty-stepper { display: inline-flex; align-items: center; gap: 14px; background: var(--color-surface-2); border-radius: var(--radius-pill); padding: 6px 10px; }
.qty-stepper__btn { width: 30px; height: 30px; border-radius: 50%; background: var(--color-surface-raised); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; }
.qty-stepper__value { min-width: 18px; text-align: center; font-weight: 600; }
.qty-stepper--sm .qty-stepper__btn { width: 24px; height: 24px; }
.qty-stepper--sm { gap: 10px; padding: 4px 8px; }

/* ---------- Reseñas ---------- */
.mini-stars { display: inline-flex; gap: 1px; }
.mini-stars__on { color: var(--color-warning); }
.mini-stars__off { color: var(--color-surface-2); }
.reviews-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.reviews-summary__score { font-size: 34px; font-weight: 800; line-height: 1; }
.reviews-summary__count { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-row { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 13px; }
.review-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-row__author { font-size: 13px; font-weight: 600; }
.review-row__comment { font-size: 12.5px; color: var(--color-text-secondary); margin-top: 6px; line-height: 1.55; }
.review-row__time { font-size: 11px; color: var(--color-text-muted); margin-top: 6px; }

.sticky-actions {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  z-index: 25;
  display: flex; gap: 10px; padding: 12px 16px; margin-top: 20px;
  background: rgba(12,12,14,0.92); backdrop-filter: blur(10px); border-top: 1px solid var(--color-border);
}
.sticky-actions .btn { flex: 1; }
.sticky-actions--single { flex-direction: column; align-items: stretch; gap: 6px; }
.sticky-actions--single .btn { flex: none; width: 100%; }
.sticky-actions--single .trust-note { justify-content: center; margin-top: 0; }
/* Reserva espacio para que el contenido no quede oculto detrás de la barra fija. */
.screen-content--with-sticky-actions { padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 112px); }

@media (min-width: 1024px) {
  .sticky-actions { left: var(--sidebar-width); }
}

/* ---------- Detalle de tienda ---------- */
.store-cover { height: 120px; background: linear-gradient(135deg, #3a0f0e, var(--color-bg)); display: flex; align-items: center; justify-content: center; }
.store-cover__initials { font-size: 30px; font-weight: 800; color: rgba(255,255,255,0.16); letter-spacing: 2px; }
.store-cover__logo {
  width: 76px; height: 76px; border-radius: var(--radius-md); object-fit: cover;
  background: var(--color-white); box-shadow: var(--shadow-card);
}
.store-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: -34px; }
.store-title { font-size: 19px; font-weight: 700; background: var(--color-bg); }
.store-subtitle { font-size: 12.5px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 4px; margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 8px; text-align: center; }
.stat-card__value { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.stat-card__label { font-size: 10.5px; color: var(--color-text-muted); }

.store-cta-row { display: flex; gap: 10px; margin-top: 22px; }
.store-cta-row .btn { flex: 1; }

/* ---------- Carrito ---------- */
.cart-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.cart-row { display: flex; gap: 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; align-items: center; }
.cart-row__media { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.cart-row__media .product-tile { border-radius: var(--radius-sm); }
.cart-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cart-row__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row__price { font-size: 11.5px; color: var(--color-text-muted); }
.cart-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cart-row__line-total { font-weight: 700; font-size: 13.5px; }

.summary-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; color: var(--color-text-secondary); }
.summary-row--muted { font-size: 12px; }
.summary-row--total { border-top: 1px solid var(--color-border); margin-top: 4px; padding-top: 10px; font-weight: 700; font-size: 15px; color: var(--color-text); }

/* ---------- Checkout ---------- */
.checkout-summary-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.checkout-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-text-secondary); }
.payment-mvp { background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: 14px; }

.stacked-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); }
.field input, .field textarea {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 12px 12px; color: var(--color-text); font-size: 14px; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--color-red); }
.field__password { position: relative; display: flex; align-items: center; }
.field__password input { flex: 1; padding-right: 46px; }
.field__password .icon-btn { position: absolute; right: 4px; width: 34px; height: 34px; background: none; border: none; }
.field-error { color: #ff7a76; font-size: 12.5px; }
.field-hint { color: var(--color-text-muted); font-size: 12px; margin: -6px 0 0; }

/* ---------- Filas de compatibilidad de vehículo (panel de vendedor) ---------- */
.compat-rows { display: flex; flex-direction: column; gap: 10px; }
.compat-row {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--color-surface-2); border-radius: var(--radius-sm); padding: 10px;
}
.compat-row__fields { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.compat-row__fields .field { gap: 4px; }
.compat-row__fields .field__label { font-size: 11px; }

/* ---------- Fotos de producto (panel de vendedor) ---------- */
.photo-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.photo-thumb {
  width: 84px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
}
.photo-thumb__frame { width: 84px; height: 84px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb--pending .photo-thumb__frame { opacity: 0.8; }
/* Barra de acciones siempre visible, en flujo normal (no encima de la
   foto ni detrás de :hover) — en touch, un botón que sólo aparece con
   :hover simulado necesita dos toques para responder (el primero solo
   "revela", recién el segundo hace clic real). Con esto responde al
   primer toque siempre, y el target es más grande y fácil de acertar. */
.photo-thumb__actions {
  display: flex; align-items: center; gap: 2px;
  background: var(--color-surface-2); border-top: 1px solid var(--color-border); padding: 2px;
}
.photo-thumb__label {
  flex: 1; font-size: 10px; font-weight: 600; color: var(--color-text-muted);
  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-thumb__actions button {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 5px; border: none; background: transparent;
  color: var(--color-text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.photo-thumb__actions button:not(:disabled):active { background: var(--color-border); }
.photo-thumb__actions button:disabled { opacity: 0.3; cursor: default; }

/* ---------- Logo de tienda (registro + editar tienda) ---------- */
.logo-picker { display: flex; align-items: center; gap: 12px; }
.logo-picker__preview {
  width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; color: var(--color-text-muted);
}
.logo-picker__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-picker__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* ---------- Importación masiva por Excel (panel de vendedor) ---------- */
.import-flow > * + * { margin-top: 12px; }
.import-errors summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); }
.import-errors .compat-list { margin-top: 8px; }
.checkbox-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 12px; font-size: 13.5px; color: var(--color-text);
}
.checkbox-field input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--color-red);
}

.confirmation-card { text-align: center; padding: 30px 16px; }
.confirmation-card__icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--color-success-soft); color: var(--color-success);
  display: flex; align-items: center; justify-content: center;
}
.confirmation-card__title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirmation-card__text { color: var(--color-text-secondary); font-size: 13.5px; line-height: 1.6; max-width: 380px; margin: 0 auto; }
.confirmation-card__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

/* ---------- Autenticación ---------- */
.auth-screen { padding-top: 10px; }
.auth-screen__subtitle { color: var(--color-text-secondary); font-size: 13.5px; text-align: center; margin-bottom: 22px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--color-text-secondary); margin-top: 18px; }
.auth-switch a { color: var(--color-red); font-weight: 600; }
.demo-hint { margin-top: 24px; background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: 14px; font-size: 12px; color: var(--color-text-secondary); }
.demo-hint__title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.demo-hint code { background: var(--color-surface-2); padding: 1px 6px; border-radius: 4px; }
.auth-prompt-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* ---------- Perfil ---------- */
.profile-card { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.profile-card__avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(145deg, var(--color-red), var(--color-red-dark)); color: var(--color-white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
}
.profile-card__name { font-weight: 700; font-size: 15.5px; }
.profile-card__email { color: var(--color-text-secondary); font-size: 12.5px; margin-top: 2px; }

.seller-cta {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-red-soft); border: 1px solid var(--color-red); color: var(--color-text);
  border-radius: var(--radius-md); padding: 13px 14px; font-weight: 600; font-size: 13.5px; margin-bottom: 20px;
}
.seller-cta span { display: flex; align-items: center; gap: 8px; }

.order-list, #orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px;
}
.order-row__id { font-weight: 600; font-size: 13px; }
.order-row__date { font-size: 11.5px; color: var(--color-text-muted); margin-top: 3px; }
.order-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.order-row__total { font-weight: 700; font-size: 13px; }
.order-row--seller { flex-direction: column; align-items: stretch; gap: 10px; }
.order-row__main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order-row__actions { display: flex; gap: 8px; }
.order-row__actions .btn { flex: 1; }

/* ---------- Panel de vendedor ---------- */
.seller-panel__store { color: var(--color-text-secondary); font-size: 13px; margin-bottom: 14px; }
.tab-bar { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--color-border); }
.tab-bar__item {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  background: none; border: none; color: var(--color-text-muted);
  padding: 10px 12px; font-size: 12.5px; font-weight: 600; border-bottom: 2px solid transparent;
}
.tab-bar__item.is-active { color: var(--color-red); border-bottom-color: var(--color-red); }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; }
.kpi-card__value { display: block; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.kpi-card__label { font-size: 11.5px; color: var(--color-text-muted); }
.seller-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; }

.inventory-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.inventory-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px;
}
.inventory-row__name { font-size: 13.5px; font-weight: 600; }
.inventory-row__meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--color-text-secondary); }

/* ---------- Panel de administración ---------- */
.admin-panel .tab-bar { margin-top: 14px; }
.admin-store-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px; margin-top: 12px;
}
.admin-store-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.admin-store-card__name { font-size: 14.5px; font-weight: 700; }
.admin-store-card__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.verification-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-red-soft); border: 1px solid var(--color-red); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
}
.verification-card__icon { color: var(--color-red); }
.verification-card__status { font-weight: 700; font-size: 14px; }
.verification-card__date { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 14px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 60; pointer-events: none; padding: 0 16px;
}
.toast {
  background: var(--color-surface-raised); border: 1px solid var(--color-border-strong);
  color: var(--color-text); padding: 11px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-card);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 92vw;
}
.toast--visible { opacity: 1; transform: translateY(0); }
.toast--success { border-color: var(--color-success); }
.toast--error { border-color: var(--color-red); }

/* ---------- Microinteracciones (filas y chips tocables) ---------- */
.menu-row, .vehicle-card, .notif-feed__item, .chip--action, .tab-bar__item, .order-row, .inventory-row {
  transition: transform 0.14s var(--ease-out), border-color 0.15s ease, background 0.15s ease;
}
.menu-row:active, .notif-feed__item:active, .chip--action:active { transform: scale(0.98); }
@media (hover: hover) {
  .menu-row:hover, .vehicle-card:hover, .notif-feed__item:hover { border-color: var(--color-border-strong); }
}
.text-btn, .section__link { transition: opacity 0.15s ease; }
.text-btn:active, .section__link:active { opacity: 0.6; }

/* ---------- Scrollbars discretos (webkit) ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--color-surface-2); border-radius: 8px; }
