:root {
  color-scheme: dark;
  --bg: #0E0E10;
  --surface: #1B1B1F;
  --surface-raised: #232327;
  --border: #2A2A2E;
  --text: #F5F3EE;
  --text-muted: #9A968D;
  --accent: #C6FF33;
  --accent-dim: #7FA61C;
  --ok-bg: #16321E;
  --ok-text: #6FE896;
  --warn-bg: #3A2C10;
  --warn-text: #F2B94D;
  --off-bg: #232327;
  --off-text: #6B6862;

  --font-display: 'Arial Black', 'Archivo Black', Impact, sans-serif;
  --font-body: 'Segoe UI', 'Work Sans', sans-serif;
  --font-mono: 'Consolas', 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 2px solid var(--accent);
  padding: 20px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: 1px;
}
.brand-logo {
  height: 68px;
  width: auto;
  display: block;
}
.brand-name {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.tagline {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.header-links {
  display: flex;
  gap: 20px;
}
.header-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.header-links a:hover,
.header-links a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hero */
.hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 64px);
  line-height: 0.98;
  margin: 0 0 16px;
  letter-spacing: -1px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hero-sub {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

/* Pestañas de segmento (Nacional / Importación / Todos) */
.tabs-segmento {
  display: flex;
  gap: 8px;
  margin-top: 32px;
  border-bottom: 1px solid var(--border);
}
.tab-segmento {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 4px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab-segmento:hover { color: var(--text); }
.tab-segmento.activa { color: var(--accent); border-color: var(--accent); }
.tab-segmento:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 32px;
}
.input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  accent-color: var(--accent);
}
.input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* El <select> nativo trae su propia flecha y resaltado azul del sistema
   (Windows/Chrome) que no respeta nuestros colores - se quita el estilo
   nativo y se dibuja una flecha propia en el color de acento. */
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0 L5 6 L10 0 Z' fill='%23C6FF33'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
#buscador { flex: 1; min-width: 200px; }
#filtroTalla, #ordenPrecio { min-width: 150px; }

/* Estados */
.estado {
  padding: 60px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}
.estado-error { color: var(--accent); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-media .sin-foto {
  color: var(--off-text);
  font-size: 13px;
}
.badge-agotado {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #0E0E10;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge-oferta {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #E8500F;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
}
.thumbs button {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button.activa { border-color: var(--accent); }

.card-body { padding: 14px; }
.card-nombre {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
}
.card-color {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 10px;
}
.card-precio {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 12px;
}
.precio-tachado {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  margin-right: 6px;
}
.card-defecto {
  font-size: 12px;
  color: var(--warn-text);
  margin: -6px 0 12px;
}

/* Tallas como "stub" de ticket / etiqueta de caja */
.tallas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.talla-stub {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px dashed transparent;
  position: relative;
}
.talla-stub.disponible {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.talla-stub.apartado {
  background: var(--warn-bg);
  color: var(--warn-text);
}
.talla-stub.agotado {
  background: var(--off-bg);
  color: var(--off-text);
  text-decoration: line-through;
  text-decoration-color: var(--off-text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Lightbox */
[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6,6,7,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}
.lightbox-cerrar {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
}
.lightbox-cerrar:focus-visible { outline: 2px solid var(--accent); }

@media (max-width: 480px) {
  .toolbar { flex-direction: column; }
  #filtroTalla, #filtroSegmento, #ordenPrecio { min-width: 0; }
}
