/* ================================================================
   VITRINA PÚBLICA — FixHub
   Tema oscuro coherente con el resto de la app
   ================================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --vit-bg:          #0d0d0d;
  --vit-surface:     #12121f;
  --vit-surface-2:   #1a1a2e;
  --vit-border:      #2a2a4a;
  --vit-border-soft: #1e1e35;
  --vit-accent:      #ce93d8;
  --vit-accent-bg:   rgba(106, 27, 154, 0.15);
  --vit-accent-border: rgba(106, 27, 154, 0.35);
  --vit-text:        #e0e0e0;
  --vit-text-muted:  rgba(224, 224, 224, 0.5);
  --vit-text-dim:    rgba(224, 224, 224, 0.3);
  --vit-green:       #66bb6a;
  --vit-green-bg:    rgba(102, 187, 106, 0.12);
  --vit-red:         #ef5350;
  --vit-red-bg:      rgba(239, 83, 80, 0.12);
  --vit-radius:      8px;
  --vit-radius-lg:   12px;
}

/* ── Reset base ────────────────────────────────────────────── */
#vitrina-root *, #vitrina-root *::before, #vitrina-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#vitrina-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--vit-bg);
  color: var(--vit-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ════════════════════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════════════════════ */
.vit-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 22, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vit-border);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.vit-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--vit-accent);
  white-space: nowrap;
  cursor: default;
}

.vit-logo span {
  color: var(--vit-text);
  font-weight: 300;
}

.vit-search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.vit-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--vit-text-muted);
  pointer-events: none;
}

.vit-search {
  width: 100%;
  background: var(--vit-surface);
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius);
  padding: 8px 12px 8px 36px;
  font-size: 14px;
  color: var(--vit-text);
  outline: none;
  transition: border-color 0.2s;
}

.vit-search::placeholder { color: var(--vit-text-dim); }
.vit-search:focus { border-color: var(--vit-accent-border); }

.vit-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.vit-btn-login {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  border-radius: var(--vit-radius);
  color: var(--vit-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.vit-btn-login:hover {
  background: rgba(106, 27, 154, 0.28);
  border-color: var(--vit-accent);
}

.vit-usuario-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--vit-text-muted);
}

.vit-usuario-info strong { color: var(--vit-text); }

.vit-btn-salir {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius);
  color: var(--vit-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.vit-btn-salir:hover { border-color: var(--vit-red); color: var(--vit-red); }

/* ════════════════════════════════════════════════════════════
   BARRA DE CHIPS RÁPIDOS
   ════════════════════════════════════════════════════════════ */
.vit-chips-bar {
  background: var(--vit-surface);
  border-bottom: 1px solid var(--vit-border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.vit-chips-bar::-webkit-scrollbar { display: none; }

.vit-chips-label {
  font-size: 11px;
  color: var(--vit-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.vit-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.vit-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--vit-border);
  background: transparent;
  color: var(--vit-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}

.vit-chip:hover {
  border-color: var(--vit-accent-border);
  color: var(--vit-accent);
}

.vit-chip.activo {
  background: var(--vit-accent-bg);
  border-color: var(--vit-accent-border);
  color: var(--vit-accent);
}

/* ════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL: sidebar + grilla
   ════════════════════════════════════════════════════════════ */
.vit-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.vit-sidebar {
  width: 200px;
  min-width: 200px;
  border-right: 1px solid var(--vit-border);
  padding: 16px 12px;
  background: var(--vit-surface);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--vit-border) transparent;
}

.vit-filter-section { margin-bottom: 20px; }

.vit-filter-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vit-text-dim);
  margin-bottom: 8px;
}

.vit-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  cursor: pointer;
}

.vit-filter-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--vit-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.vit-filter-item label {
  font-size: 12px;
  color: var(--vit-text-muted);
  cursor: pointer;
  flex: 1;
  line-height: 1.3;
}

.vit-filter-item:hover label { color: var(--vit-text); }

.vit-filter-count {
  font-size: 10px;
  color: var(--vit-text-dim);
}

.vit-filter-sep {
  height: 1px;
  background: var(--vit-border-soft);
  margin: 14px 0;
}

/* Rango de precio */
.vit-precio-range {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vit-precio-range input[type="range"] {
  width: 100%;
  accent-color: var(--vit-accent);
  cursor: pointer;
}

.vit-precio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--vit-text-dim);
}

.vit-precio-valor {
  font-size: 12px;
  color: var(--vit-accent);
  font-weight: 500;
  text-align: center;
}

/* ── Área de productos ───────────────────────────────────── */
.vit-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.vit-sort-bar {
  padding: 8px 16px;
  background: var(--vit-surface);
  border-bottom: 1px solid var(--vit-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.vit-count {
  font-size: 12px;
  color: var(--vit-text-dim);
}

.vit-sort-select {
  background: transparent;
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius);
  color: var(--vit-text-muted);
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.vit-sort-select option { background: var(--vit-surface-2); }

.vit-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--vit-border) transparent;
}

.vit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

/* ════════════════════════════════════════════════════════════
   CARDS DE PRODUCTO
   ════════════════════════════════════════════════════════════ */
.vit-card {
  background: var(--vit-surface);
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.vit-card:hover {
  border-color: var(--vit-accent-border);
  transform: translateY(-2px);
}

.vit-card-img {
  background: var(--vit-surface-2);
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--vit-border-soft);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.vit-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vit-card-img i {
  font-size: 38px;
  color: var(--vit-text-dim);
}

.vit-badge-svc {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  color: var(--vit-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vit-badge-new {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--vit-green-bg);
  border: 1px solid rgba(102,187,106,0.3);
  color: var(--vit-green);
}

.vit-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.vit-card-tipo {
  font-size: 10px;
  color: var(--vit-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vit-card-nombre {
  font-size: 12px;
  font-weight: 500;
  color: var(--vit-text);
  line-height: 1.35;
  min-height: 32px;
}

.vit-card-compat {
  font-size: 10px;
  color: var(--vit-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--vit-border-soft);
}

.vit-precio {
  font-size: 15px;
  font-weight: 600;
  color: var(--vit-text);
}

.vit-precio-gratis {
  font-size: 11px;
  color: var(--vit-text-dim);
}

.vit-stock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.vit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vit-dot-in  { background: var(--vit-green); }
.vit-dot-out { background: var(--vit-red); }
.vit-dot-svc { background: var(--vit-accent); }

.vit-stock-text-in  { color: var(--vit-green); }
.vit-stock-text-out { color: var(--vit-red); }
.vit-stock-text-svc { color: var(--vit-accent); }

.vit-btn-ver {
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius);
  color: var(--vit-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.vit-btn-ver:hover {
  background: var(--vit-accent-bg);
  border-color: var(--vit-accent-border);
  color: var(--vit-accent);
}

/* Botón agregar al carrito (solo usuarios logueados) */
.vit-btn-carrito {
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  border-radius: var(--vit-radius);
  color: var(--vit-accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vit-btn-carrito:hover {
  background: rgba(106, 27, 154, 0.28);
  border-color: var(--vit-accent);
}

/* ════════════════════════════════════════════════════════════
   MODAL LOGIN
   ════════════════════════════════════════════════════════════ */
.vit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vit-modal-overlay.oculto { display: none; }

.vit-modal {
  background: var(--vit-surface);
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vit-modal-titulo {
  font-size: 18px;
  font-weight: 600;
  color: var(--vit-accent);
  text-align: center;
}

.vit-modal-sub {
  font-size: 13px;
  color: var(--vit-text-muted);
  text-align: center;
  margin-top: -8px;
}

.vit-modal label {
  font-size: 12px;
  color: var(--vit-text-muted);
  display: block;
  margin-bottom: 4px;
}

.vit-modal input {
  width: 100%;
  background: var(--vit-surface-2);
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--vit-text);
  outline: none;
  transition: border-color 0.2s;
}

.vit-modal input:focus { border-color: var(--vit-accent-border); }
.vit-modal input::placeholder { color: var(--vit-text-dim); }

.vit-modal-error {
  font-size: 12px;
  color: var(--vit-red);
  text-align: center;
  min-height: 16px;
}

.vit-btn-ingresar {
  width: 100%;
  padding: 10px;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  border-radius: var(--vit-radius);
  color: var(--vit-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.vit-btn-ingresar:hover {
  background: rgba(106, 27, 154, 0.3);
  border-color: var(--vit-accent);
}

.vit-btn-ingresar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vit-modal-cerrar {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--vit-text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   MODAL DETALLE PRODUCTO
   ════════════════════════════════════════════════════════════ */
.vit-detalle-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vit-detalle-overlay.oculto { display: none; }

.vit-detalle-modal {
  background: var(--vit-surface);
  border: 1px solid var(--vit-border);
  border-radius: var(--vit-radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.vit-detalle-img {
  background: var(--vit-surface-2);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--vit-border);
  flex-shrink: 0;
}

.vit-detalle-img img { width: 100%; height: 100%; object-fit: cover; }
.vit-detalle-img i { font-size: 64px; color: var(--vit-text-dim); }

.vit-detalle-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }

.vit-detalle-tipo {
  font-size: 11px;
  color: var(--vit-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vit-detalle-nombre {
  font-size: 18px;
  font-weight: 600;
  color: var(--vit-text);
  line-height: 1.3;
}

.vit-detalle-marca {
  font-size: 13px;
  color: var(--vit-text-muted);
}

.vit-detalle-desc {
  font-size: 13px;
  color: var(--vit-text-muted);
  line-height: 1.6;
  padding: 10px 0;
  border-top: 1px solid var(--vit-border-soft);
  border-bottom: 1px solid var(--vit-border-soft);
}

.vit-detalle-compat {
  font-size: 12px;
  color: var(--vit-text-dim);
}

.vit-detalle-compat strong { color: var(--vit-text-muted); }

.vit-detalle-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

.vit-detalle-precio {
  font-size: 24px;
  font-weight: 700;
  color: var(--vit-accent);
}

.vit-detalle-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.vit-detalle-acciones { display: flex; flex-direction: column; gap: 8px; }

.vit-btn-detalle-carrito {
  padding: 11px;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  border-radius: var(--vit-radius);
  color: var(--vit-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vit-btn-detalle-carrito:hover {
  background: rgba(106, 27, 154, 0.3);
  border-color: var(--vit-accent);
}

.vit-btn-detalle-cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.4);
  border: none;
  border-radius: 50%;
  color: var(--vit-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.vit-btn-detalle-cerrar:hover { background: rgba(0,0,0,0.6); }

/* ════════════════════════════════════════════════════════════
   ESTADOS
   ════════════════════════════════════════════════════════════ */
.vit-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--vit-text-dim);
  text-align: center;
}

.vit-empty i { font-size: 48px; }
.vit-empty p { font-size: 14px; }

.vit-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--vit-text-dim);
  font-size: 14px;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════
   CARRITO FLOTANTE (solo usuarios logueados)
   ════════════════════════════════════════════════════════════ */
.vit-carrito-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--vit-accent-bg);
  border: 1px solid var(--vit-accent-border);
  border-radius: 50px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--vit-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(106, 27, 154, 0.3);
}

.vit-carrito-fab:hover {
  background: rgba(106, 27, 154, 0.3);
  border-color: var(--vit-accent);
  transform: translateY(-2px);
}

.vit-carrito-fab.oculto { display: none; }

.vit-carrito-badge {
  background: var(--vit-accent);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .vit-sidebar { display: none; }
  .vit-nav { padding: 0 12px; }
  .vit-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .vit-grid-wrap { padding: 10px 12px; }
  .vit-logo { font-size: 18px; }
  .vit-btn-login span { display: none; }
  .vit-carrito-fab { bottom: 16px; right: 16px; padding: 10px 16px; }
}