/* ============================================================
   BAZARIO — Capa de tema Gen Z (neobrutalismo dopamínico)
   Se carga DESPUÉS de styles.css y redefine el sistema visual:
   crema papel + tinta + lima ácido + rosa eléctrico, bordes duros,
   sombras sólidas offset, tipografía chunky, stickers y marquee.
   Dirección validada por research 19 jul 2026 (patrón Depop /
   anti-diseño / drops). NO minimalismo millennial.
   ============================================================ */

:root {
  /* Superficie: papel, no oscuridad */
  --bg: oklch(0.955 0.02 95);              /* crema papel */
  --surface: oklch(0.99 0.008 95);          /* blanco cálido */
  --surface-elevated: oklch(0.93 0.03 95);
  --border: oklch(0.22 0.02 60);            /* la tinta ES el borde */
  --ink: oklch(0.22 0.02 60);

  /* Dopamina */
  --primary: oklch(0.87 0.24 128);          /* lima ácido */
  --primary-dark: oklch(0.78 0.24 128);
  --primary-light: oklch(0.93 0.18 128);
  --secondary: oklch(0.66 0.26 356);        /* rosa eléctrico */
  --secondary-dark: oklch(0.58 0.26 356);
  --accent: oklch(0.55 0.21 262);           /* azul eléctrico */
  --accent-dark: oklch(0.48 0.21 262);
  --sticker-yellow: oklch(0.88 0.19 98);

  --success: oklch(0.72 0.2 145);
  --warning: oklch(0.8 0.16 80);
  --error: oklch(0.6 0.24 28);

  --text: var(--ink);
  --text-muted: oklch(0.42 0.02 60);
  --text-subtle: oklch(0.52 0.02 60);

  --gradient: linear-gradient(120deg, var(--primary) 0 55%, var(--secondary) 55% 100%);
  --gradient-accent: linear-gradient(120deg, var(--accent) 0 55%, var(--primary) 55% 100%);
  --gradient-warm: linear-gradient(120deg, var(--sticker-yellow) 0 55%, var(--secondary) 55% 100%);

  /* Brutalismo: esquinas contenidas, sombras SÓLIDAS */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --shadow-glow: 4px 4px 0 oklch(0.66 0.26 356 / 55%);

  --font-display: 'Archivo Black', 'Archivo', sans-serif;
  --font-body: 'Archivo', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  /* textura de papel: grid tenue */
  background-image: radial-gradient(oklch(0.22 0.02 60 / 5%) 1px, transparent 1px);
  background-size: 22px 22px;
}

h1, h2, h3, .hero-title, .section-title, .logo {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1.05;
  text-wrap: balance;
}

::selection { background: var(--secondary); color: white; }

/* ---------- Header / navegación ---------- */
.app-header, header, .header {
  background: var(--bg) !important;
  border-bottom: 2px solid var(--ink) !important;
  box-shadow: none !important;
}

.bottom-nav, .nav-bottom {
  background: var(--surface) !important;
  border-top: 2px solid var(--ink) !important;
}
.bottom-nav .nav-item.active, .nav-item.active {
  color: var(--ink) !important;
}
.nav-item.active .nav-icon, .bottom-nav .nav-item.active svg {
  background: var(--primary);
  border-radius: 8px;
  outline: 2px solid var(--ink);
}

.logo, .app-logo {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--ink) !important;
  position: relative;
}
.logo::after {
  content: '';
  position: absolute;
  left: -2%; right: -2%; bottom: 2px;
  height: 0.34em;
  background: var(--primary);
  z-index: -1;
  transform: rotate(-1.2deg);
}

/* ---------- Marquee ticker (elemento WOW) ---------- */
.bz-ticker {
  overflow: hidden;
  white-space: nowrap;
  background: var(--ink);
  color: var(--bg);
  border-bottom: 2px solid var(--ink);
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bz-ticker__inner {
  display: inline-block;
  padding-left: 100%;
  animation: bz-marquee 22s linear infinite;
}
.bz-ticker b { color: var(--primary); font-weight: 700; }
@keyframes bz-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5rem) 1rem clamp(2rem, 5vw, 3.5rem);
  text-align: left;
}
.hero-title {
  font-size: clamp(2.4rem, 2rem + 6vw, 5rem);
  color: var(--ink);
}
.hero-title .text-gradient {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--secondary);
  position: relative;
  display: inline-block;
}
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 0.8rem + 0.4vw, 1rem);
  color: var(--text-muted);
  max-width: 34ch;
  margin-top: 0.9rem;
}

/* stickers flotantes del hero */
.hero::before, .hero::after {
  font-family: var(--font-display);
  position: absolute;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  pointer-events: none;
}
.hero::before {
  content: 'PIEZA ÚNICA ★';
  top: 12%; right: 4%;
  background: var(--sticker-yellow);
  transform: rotate(6deg);
}
.hero::after {
  content: '1/1';
  bottom: 8%; right: 12%;
  background: var(--secondary);
  color: white;
  transform: rotate(-5deg);
}

/* ---------- Botones ---------- */
.btn, button.btn {
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--primary) !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: var(--shadow);
}
.btn-secondary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); background: var(--sticker-yellow) !important; }

/* ---------- Cards de producto: collage vivo ---------- */
.product-card, .card, .store-card, .category-card {
  background: var(--surface) !important;
  border: 2px solid var(--ink) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.product-card:nth-child(odd) { transform: rotate(-0.7deg); }
.product-card:nth-child(even) { transform: rotate(0.5deg); }
.product-card:hover, .store-card:hover {
  transform: rotate(0deg) translate(-2px, -3px);
  box-shadow: var(--shadow-lg) !important;
  z-index: 2;
}

.product-price, .price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
  background: var(--primary);
  display: inline-block;
  padding: 1px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  transform: rotate(-1deg);
}

/* Badges de condición / estado = stickers */
.badge, .product-condition, .condition-badge, .tag {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.66rem;
  border: 1.5px solid var(--ink) !important;
  background: var(--sticker-yellow) !important;
  color: var(--ink) !important;
  border-radius: 6px !important;
  padding: 2px 8px;
}
.badge-sold, .status-sold { background: var(--ink) !important; color: var(--bg) !important; }
.badge-reserved, .status-reserved { background: var(--secondary) !important; color: white !important; }

/* ---------- Chips / categorías ---------- */
.chip, .category-chip, .filter-chip {
  border: 2px solid var(--ink) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-radius: 999px !important;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip.active, .filter-chip.active, .chip:hover {
  background: var(--secondary) !important;
  color: white !important;
}

/* ---------- Inputs ---------- */
input, textarea, select, .input, .search-input {
  background: var(--surface) !important;
  border: 2px solid var(--ink) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--ink) !important;
  font-family: var(--font-body);
}
input:focus, textarea:focus, select:focus, .search-input:focus {
  outline: none !important;
  box-shadow: 3px 3px 0 var(--secondary) !important;
  border-color: var(--ink) !important;
}
::placeholder { color: var(--text-subtle) !important; }

/* ---------- Secciones / títulos ---------- */
.section-title {
  font-size: clamp(1.3rem, 1.1rem + 1.4vw, 2rem);
  display: inline-block;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 14px;
  border-radius: 8px;
  transform: rotate(-0.8deg);
  margin-bottom: 1rem;
}

/* ---------- Tienda pública (link-in-bio) ---------- */
.store-header, .store-hero {
  background: var(--surface) !important;
  border: 2px solid var(--ink) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
}
.store-avatar, .avatar {
  border: 2px solid var(--ink) !important;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Modales / toasts / dropdowns ---------- */
.modal, .modal-content, .toast, .dropdown, .sheet {
  background: var(--surface) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--ink) !important;
}
.toast-success { background: var(--primary) !important; color: var(--ink) !important; }
.toast-error { background: var(--error) !important; color: white !important; }

/* ---------- Skeletons ---------- */
.skeleton, [class*="skeleton"] {
  background: oklch(0.9 0.02 95) !important;
  border: none !important;
}

/* ---------- Footer ---------- */
footer, .app-footer {
  background: var(--ink) !important;
  color: var(--bg) !important;
  border-top: 2px solid var(--ink);
}
footer a { color: var(--primary) !important; }

/* ---------- Entradas escalonadas ---------- */
.product-card, .store-card { animation: bz-pop 0.45s cubic-bezier(0.26, 0.53, 0.74, 1.3) backwards; }
.product-card:nth-child(1) { animation-delay: 0.03s; }
.product-card:nth-child(2) { animation-delay: 0.08s; }
.product-card:nth-child(3) { animation-delay: 0.13s; }
.product-card:nth-child(4) { animation-delay: 0.18s; }
.product-card:nth-child(5) { animation-delay: 0.23s; }
.product-card:nth-child(6) { animation-delay: 0.28s; }
@keyframes bz-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bz-ticker__inner { animation: none; padding-left: 0; }
  .product-card, .store-card { animation: none; }
  html { scroll-behavior: auto; }
}

/* Los náufragos del tema oscuro viejo */
.text-muted { color: var(--text-muted) !important; }
.text-gradient { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--secondary) !important; }

/* ---------- Logo: tinta sólida con subrayado lima (mata el gradient clip) ---------- */
.app-logo, .app-loading-logo {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: var(--ink) !important;
  color: var(--ink) !important;
  font-family: var(--font-display) !important;
  position: relative;
  z-index: 0;
}
.app-logo::after {
  content: '';
  position: absolute;
  left: -3%; right: -3%; bottom: 1px;
  height: 0.36em;
  background: var(--primary);
  z-index: -1;
  transform: rotate(-1.2deg);
}

/* ---------- Botón central "subir prenda": lima brutalista ---------- */
.nav-item-upload, .nav-item-upload span, .nav-item-upload div {
  background: var(--primary) !important;
  background-image: none !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: 3px 3px 0 var(--ink) !important;
  border-radius: 12px !important;
}
.nav-item-upload svg { stroke: var(--ink) !important; }
.nav-item-upload:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink) !important; }

/* Chat FAB de tiendas PRO */
.ai-chat-fab {
  background: var(--secondary) !important;
  background-image: none !important;
  border: 2px solid var(--ink) !important;
  box-shadow: var(--shadow) !important;
  color: white !important;
}

/* Header icons (lupa/campana) */
.header-actions button, .icon-btn {
  background: var(--surface) !important;
  border: 2px solid var(--ink) !important;
  color: var(--ink) !important;
  box-shadow: 2px 2px 0 var(--ink);
  border-radius: 10px !important;
}
.header-actions svg { stroke: var(--ink) !important; }

/* Banner por defecto de tienda: tinta con retícula (adiós violeta) */
.store-banner, .store-cover {
  background: var(--ink) !important;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 14px, oklch(0.87 0.24 128 / 18%) 14px 16px) !important;
  border-bottom: 2px solid var(--ink);
}

/* ---------- Desktop: sidebar brutalista y header alineado ---------- */
@media (min-width: 1024px) {
  .bottom-nav {
    background: var(--surface) !important;
    border-top: none !important;
    border-right: 2px solid var(--ink) !important;
    width: 84px !important;
    z-index: 60;
  }
  .app-header, .header {
    padding-left: 108px !important;
    width: 100%;
    z-index: 50;
  }
  .main-content, .page {
    padding-left: 96px;
  }
  .bz-ticker { margin-left: -96px; padding-left: 96px; }
  .nav-item { color: var(--text-muted); }
  .nav-item span, .nav-item-label { font-size: 0.6rem; }
}
