:root {
  --brand-color: #3b82f6;
  --price-color: #22c55e;
  --cpu-color: #8b5cf6;
  --advanced-color: #f59e0b;
}

/* Body */
body {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 12px 90px 12px;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Main Container */
.app {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.app-content {
  width: 100%;
}

/* Fix overlays */
#loading,
#error {
  display: none !important;
  pointer-events: none !important;
}

/* Prevent hidden elements from blocking */
[style*="display: none"],
[style*="display:none"] {
  pointer-events: none !important;
}

/* Title */
h1 {
  text-align: center;
  margin-bottom: 30px;
}

/* Spacing */
.filter-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.filter-section.brand.active {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.filter-section.price.active {
  border-color: var(--price-color);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.15);
}

.filter-section.cpu.active {
  border-color: var(--cpu-color);
  background: #f3f0ff;
  box-shadow: 0 0 0 2px rgba(139,92,246,0.15);
}

.filter-section.advanced.active {
  border-color: var(--advanced-color);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.15);
}

.filter-section.price {
  background: #ecfdf5;
}

.filter-section.cpu {
  background: #f5f3ff;
}

.filter-section.advanced {
  background: #fffbeb;
}

.section-count {
  display: inline-block;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 600;
}

.section-count.brand {
  background: #dbeafe;
  color: #1d4ed8;
}

.section-count.price {
  background: #dcfce7;
  color: #15803d;
}

.section-count.cpu {
  background: #ede9fe;
  color: #6d28d9;
}

.section-count.advanced {
  background: #fef3c7;
  color: #b45309;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #111;
}

.micro-copy {
  font-size: 0.85em;
  color: #6b7280;
  margin-bottom: 8px;
}

.hint {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.visible {
  display: block !important;
}

.cpu-model,
.cpu-generation,
#advancedFilters,
#tagsOptions {
  display: none;
}

.cpu-model.visible,
.cpu-generation.visible,
#advancedFilters.visible,
#tagsOptions.visible {
  display: block !important;
}

/* Advanced Filters */
#advancedFilters.open {
  display: block;
}

/* Tags */
#tagsOptions.open {
  display: block;
}

.cpu-model.visible,
.cpu-generation.visible {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cpu-model,
.cpu-generation {
  background: #faf7ff;
  border-left: 3px solid var(--cpu-color);
  padding: 10px;
  border-radius: 8px;
  margin-left: 6px;
  transition: all 0.2s ease;
}

/* Results */
.results {
  margin-top: 16px;
}

/* Results Container */
#results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 80px;
}

/* Result Card */
.result-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.result-card:nth-child(even) {
  background: #f1f1f5;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

/* Title */
.title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title div:first-child {
  font-size: 12px;
  color: #6b7280;
}

.title div:last-child {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* Specs */
.specs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #374151;
}

.specs div {
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Meta */
.meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.meta div {
  font-size: 12.5px;
  background: #eef2ff;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Price */
.price {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}

/* Tags */
.tags {
  font-size: 12px;
  color: #9ca3af;
}

.tag-chip {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 4px;
}

/* Stock */
.stock {
  font-size: 13px;
  font-weight: 500;
  color: #059669;
}

/* Buttons */
button {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  transition:
    transform 0.08s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.filter-section.brand button:hover {
  border-color: var(--brand-color);
  background: rgba(59,130,246,0.1);
  color: var(--brand-color);
}

.filter-section.price button:hover {
  border-color: var(--price-color);
  background: rgba(34,197,94,0.1);
  color: var(--price-color);
}

.filter-section.cpu button:hover {
  border-color: var(--cpu-color);
  background: rgba(139,92,246,0.1);
  color: var(--cpu-color);
}

.filter-section.advanced button:hover {
  border-color: var(--advanced-color);
  background: rgba(245,158,11,0.1);
  color: var(--advanced-color);
}

button:active {
  transform: scale(0.96);
}

button.selected {
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.filter-section.brand button.selected {
  background: rgba(59,130,246,0.9);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

.filter-section.price button.selected {
  background: rgba(34,197,94,0.9);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}

.filter-section.cpu button.selected {
  background: rgba(139,92,246,0.9);
  box-shadow: 0 0 0 2px rgba(139,92,246,0.25);
}

.filter-section.advanced button.selected {
  background: rgba(245,158,11,0.9);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
}

/* Grid Layout */
.usage-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.usage-btn {
  font-weight: 500;
}

.price-btn {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.gpu-btn,
.screen-btn,
.tag-btn {
  font-size: 13px;
  padding: 6px 10px;
}

.toggle-advanced-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.95em;
  font-weight: 500;
  color: #4f46e5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  cursor: pointer;
}

.toggle-advanced-btn:hover {
  background: #eef2ff;
}

.toggle-advanced-btn .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.toggle-advanced-btn.open .arrow {
  transform: rotate(180deg);
}

/* Price Buttons */
.price-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-btn {
  padding: 14px 20px;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
}

/* WhatsApp Bar */
#whatsappBar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: transparent;
  padding: 10px 16px;
  box-sizing: border-box;
  z-index: 999;
}

#whatsappBtn {
  display: block;
  width: 100%;
  text-align: center;
  background: #25D366;
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

#whatsappBtn:active {
  transform: scale(0.97);
}

/* Spec Line */
.spec-line {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

.spec-line span:not(:last-child)::after {
  content: " • ";
  margin: 0 4px;
}
