/* Buscador Loco - Estilos Modernos y Glassmorphism */
:root {
  --bl-bg-dark: #0f172a;
  --bl-card-bg: rgba(30, 41, 59, 0.88);
  --bl-border-color: rgba(255, 255, 255, 0.15);
  --bl-accent-blue: #3b82f6;
  --bl-accent-cyan: #06b6d4;
  --bl-accent-electric: #10b981;
  --bl-accent-yellow: #f59e0b;
  --bl-accent-purple: #8b5cf6;
  --bl-accent-pink: #ec4899;
  --bl-text-primary: #f8fafc;
  --bl-text-secondary: #94a3b8;
}

/* Base Container Fullscreen */
.buscador-loco-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: radial-gradient(circle at 50% 35%, #1e1b4b 0%, #0f172a 65%, #080c14 100%);
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--bl-text-primary);
  user-select: none;
}

/* Canvas Container */
#bl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

#bl-canvas:active {
  cursor: grabbing;
}

/* Control Panel Superior - Floating Glassmorphism */
.bl-control-panel {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 1100px;
  z-index: 10;
  background: var(--bl-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bl-border-color);
  border-radius: 20px;
  padding: 14px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

/* Header Row: Breadcrumb & Actions */
.bl-panel-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Breadcrumb Component */
.bl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bl-bc-item {
  color: var(--bl-text-secondary);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bl-bc-item:hover {
  color: var(--bl-accent-cyan);
  transform: scale(1.05);
}

.bl-bc-item.active {
  color: #ffffff;
  font-weight: 700;
  cursor: default;
}

.bl-bc-item.active:hover {
  transform: none;
}

.bl-bc-separator {
  color: var(--bl-text-secondary);
  opacity: 0.5;
}

.bl-bc-chip {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  padding: 2px 10px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bl-bc-chip:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

.bl-bc-explore-btn {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  border: none;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.bl-bc-explore-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.6);
}

.bl-bc-clear {
  font-size: 0.78rem;
  color: #ef4444;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.bl-bc-clear:hover {
  opacity: 1;
}

/* Special Actions */
.bl-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bl-btn-ver-filtrados {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  transition: all 0.25s ease;
  pointer-events: auto !important;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.bl-btn-ver-filtrados #bl-count-filtrados {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bl-btn-ver-filtrados:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.6);
  color: #ffffff !important;
}

.bl-btn-ver-filtrados.bl-pulse {
  animation: blBtnPulse 0.45s ease-out;
}

@keyframes blBtnPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.8), 0 0 15px rgba(16, 185, 129, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  }
}

/* Buscador de Texto */
.bl-search-container {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}

.bl-search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 8px 16px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.25s ease;
}

.bl-search-input::placeholder {
  color: var(--bl-text-secondary);
  opacity: 0.7;
}

.bl-search-input:focus {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--bl-accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

/* Filters Row */
.bl-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Body Type Chips */
.bl-chips-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bl-chip-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bl-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.bl-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--bl-text-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bl-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.bl-chip.active {
  background: linear-gradient(135deg, var(--bl-accent-blue), var(--bl-accent-cyan));
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Trunk Filter Group */
.bl-trunk-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bl-trunk-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--bl-text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bl-trunk-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
}

.bl-trunk-chip.active {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Chips Presets Preconfigurados */
.bl-presets-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bl-preset-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--bl-text-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bl-preset-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.bl-preset-chip.active {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

/* Slider de Precio */
.bl-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 260px;
}

.bl-slider-label {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--bl-text-primary);
}

.bl-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--bl-accent-cyan), var(--bl-accent-purple));
  outline: none;
}

.bl-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
  transition: transform 0.15s;
}

.bl-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Level 3 Versions Drawer/Modal Elevado */
.bl-versions-overlay {
  position: absolute;
  top: 110px;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 2px solid var(--bl-accent-cyan);
  border-radius: 28px 28px 0 0;
  padding: 24px 30px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.85);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  pointer-events: auto !important;
}

.bl-versions-overlay.open {
  transform: translateY(0);
}

.bl-versions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.bl-versions-title-group h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.bl-versions-subtitle {
  font-size: 0.88rem;
  color: var(--bl-accent-cyan);
  font-weight: 500;
}

.bl-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  pointer-events: auto !important;
}

.bl-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
  transform: scale(1.1);
}

/* Versions Cards Grid */
.bl-versions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-bottom: 30px;
}

.bl-version-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s ease;
  position: relative;
  z-index: 10000;
  pointer-events: auto !important;
}

.bl-version-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.25);
}

.bl-version-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 4px;
}

.bl-version-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bl-badge-ev {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bl-version-specs {
  display: flex;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bl-spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bl-spec-val {
  font-weight: 800;
  color: #ffffff;
  font-size: 1rem;
}

.bl-spec-lbl {
  font-size: 0.75rem;
  color: var(--bl-text-secondary);
}

.bl-version-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bl-version-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--bl-accent-cyan);
}

.bl-version-price span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--bl-text-secondary);
  display: block;
}

.bl-version-cta {
  display: flex;
  gap: 8px;
  z-index: 10002;
}

.bl-btn-cta {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 10005;
}

.bl-btn-primary {
  background: linear-gradient(135deg, var(--bl-accent-blue), var(--bl-accent-cyan));
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.bl-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6);
  transform: translateY(-2px) scale(1.04);
  color: #ffffff !important;
}

.bl-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.bl-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: #ffffff !important;
}

/* Tooltip Canvas Hover */
.bl-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  color: white;
  z-index: 20;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.bl-tooltip.show {
  opacity: 1;
}

/* Shake Animation Keyframe */
@keyframes bl-shake-anim {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-10px, 8px) rotate(-1deg); }
  20% { transform: translate(12px, -8px) rotate(1deg); }
  30% { transform: translate(-8px, 6px) rotate(-0.5deg); }
  40% { transform: translate(8px, -6px) rotate(0.5deg); }
  50% { transform: translate(-5px, 4px) rotate(-0.2deg); }
  60% { transform: translate(5px, -3px) rotate(0.2deg); }
  70% { transform: translate(-2px, 2px) rotate(0); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.bl-shaking {
  animation: bl-shake-anim 0.6s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bl-control-panel {
    padding: 12px 14px;
    width: 95%;
    top: 10px;
  }

  .bl-versions-overlay {
    top: 140px;
    padding: 18px 16px;
  }

  .bl-filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .bl-slider-container {
    width: 100%;
    justify-content: space-between;
  }

  .bl-slider {
    width: 60%;
  }
}
