/* ==========================================================================
   DealScout AI - Design System & Modern Stylesheet
   ========================================================================== */

:root {
  /* Core Color Tokens */
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.9);
  --bg-elevated: #151c2d;
  --bg-input: rgba(15, 21, 34, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  --border-focus: #6366f1;

  /* Text & Accent Tokens */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1; /* Electric Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;    /* Vivid Cyan */
  --accent-emerald: #10b981; /* Deal Emerald */
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;   /* Warning / Fair */
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-rose: #f43f5e;    /* High / Alert */
  --accent-rose-bg: rgba(244, 63, 94, 0.12);
  --accent-purple: #a855f7;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows & Glass */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --glass-blur: blur(16px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Setup
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Mesh Blobs */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: floatBlobs 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  top: -100px;
  left: 15%;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  top: 30%;
  right: -100px;
  animation-duration: 25s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  bottom: -50px;
  left: 30%;
  animation-duration: 22s;
}

@keyframes floatBlobs {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(40px) scale(1.08); }
  100% { transform: translateY(-30px) scale(0.95); }
}

/* Utilities */
.hidden {
  display: none !important;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-ai {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.btn-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.count-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Hero & Search Section
   ========================================================================== */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.hero-section {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 28px;
}

/* Natural Language Search Box */
.search-box-wrapper {
  position: relative;
  margin: 0 auto 24px;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 8px 10px 8px 18px;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-base);
}

.search-input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 16px 48px -8px rgba(99, 102, 241, 0.35), 0 0 0 2px rgba(99, 102, 241, 0.25);
  background: rgba(18, 26, 44, 0.95);
}

.input-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 10px 4px;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-clear:hover {
  color: var(--text-primary);
}

.btn-find {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  transition: all var(--transition-fast);
}

.btn-find:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-find:active {
  transform: translateY(0);
}

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn-find:hover .btn-arrow {
  transform: translateX(3px);
}

/* Inspiration Chips */
.inspiration-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chips-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 4px;
}

.chip-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
  transform: translateY(-1px);
}

/* ==========================================================================
   AI Intent Breakdown Card
   ========================================================================== */
.intent-section {
  margin-bottom: 32px;
  animation: slideDown 300ms var(--transition-smooth);
}

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

.intent-card {
  background: linear-gradient(180deg, rgba(26, 33, 53, 0.85) 0%, rgba(15, 21, 35, 0.85) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: var(--glass-blur);
}

.intent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.intent-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intent-sparkle {
  font-size: 1.25rem;
}

.intent-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0e7ff;
}

.intent-subheading {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.intent-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.intent-item-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.intent-item-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.intent-tag-pill {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-right: 4px;
  margin-top: 2px;
}

/* ==========================================================================
   Toolbar & Filters
   ========================================================================== */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: var(--glass-blur);
}

.results-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.highlight-count {
  color: #38bdf8;
}

.results-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.select-wrapper {
  position: relative;
}

.custom-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 6px 28px 6px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.custom-select:focus {
  border-color: var(--accent-primary);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-emerald);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-export-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-export-pill:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-export-pill:active {
  transform: translateY(0);
}

/* ==========================================================================
   Products Grid & Cards
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-top-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}

.badge-match-score {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
}

.badge-deal-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.badge-deal-status.super-deal {
  background: #10b981;
  color: #064e3b;
}

.badge-deal-status.good-deal {
  background: #34d399;
  color: #064e3b;
}

.badge-deal-status.fair-value {
  background: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  backdrop-filter: blur(8px);
}

.badge-deal-status.above-typical {
  background: #fbbf24;
  color: #78350f;
}

/* Card Image Area */
.card-media {
  position: relative;
  width: 100%;
  height: 220px;
  background: radial-gradient(circle, #1a2234 0%, #0e1422 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform var(--transition-smooth);
}

.product-card:hover .card-img {
  transform: scale(1.05);
}

.card-save-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 21, 35, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: all var(--transition-fast);
}

.card-save-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #f43f5e;
  transform: scale(1.1);
}

.card-save-btn.active {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

/* Card Body */
.card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-store {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7rem;
}

/* Rating Bar */
.card-ratings {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.stars-row {
  color: #fbbf24;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.rating-number {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f8fafc;
}

.review-volume {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Historical Price Meter Gauge */
.historical-price-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.price-main-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.current-price {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
}

.price-label-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Typical Range Gauge Track */
.range-gauge-wrapper {
  margin-top: 6px;
}

.range-gauge-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  overflow: visible;
  margin: 8px 0 4px;
}

.range-gauge-fill {
  position: absolute;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 60%, #f43f5e 100%);
}

.range-pin-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.deal-highlight-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
  margin-top: 4px;
}

/* Card Actions */
.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.btn-inspect {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-inspect:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.btn-compare-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-compare-card:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-compare-card.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  color: #67e8f9;
}

/* ==========================================================================
   States (Empty, Loading, Error)
   ========================================================================= */
.state-container {
  text-align: center;
  max-width: 540px;
  margin: 60px auto;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.empty-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Loader Animation */
.loader-spinner {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.spinner-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-primary);
  animation: spin 1s infinite linear;
}

.spinner-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  transform: translate(-50%, -50%);
  animation: pulseCore 1.5s infinite ease-in-out;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseCore {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.loading-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ==========================================================================
   Deep Product Detail Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  background: #0f1523;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: modalEnter 250ms var(--transition-smooth);
}

.modal-dialog-sm {
  max-width: 480px;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.btn-close-modal {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-content {
  padding: 36px;
}

/* Modal Layout: Gallery Left, Details Right */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 36px;
}

@media (max-width: 840px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-main-img-box {
  width: 100%;
  height: 320px;
  background: radial-gradient(circle, #1a2234 0%, #0e1422 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.thumb-item {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: #141b2b;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}

.thumb-item.active, .thumb-item:hover {
  border-color: var(--accent-primary);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Right Column */
.modal-info-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-product-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-scorecard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.scorecard-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.scorecard-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.scorecard-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scorecard-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Modal Historical Pricing Card */
.modal-deal-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
}

.deal-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.deal-badge-lg {
  font-size: 0.85rem;
  font-weight: 700;
  color: #34d399;
}

.deal-banner-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* AI Buyer Verdict Section */
.ai-verdict-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 18px;
}

.verdict-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #c7d2fe;
  margin-bottom: 8px;
}

.verdict-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.verdict-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.verdict-col h5 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.verdict-col.pros h5 { color: #34d399; }
.verdict-col.cons h5 { color: #f87171; }

.verdict-list {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verdict-list li::before {
  content: '• ';
  color: var(--text-muted);
}

/* Multi-Retailer Offers Table */
.offers-section {
  margin-top: 10px;
}

.offers-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.offers-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 6px 12px;
}

.offers-table td {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  font-size: 0.85rem;
}

.offers-table tr td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.offers-table tr td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.store-name-cell {
  font-weight: 600;
  color: #fff;
}

.store-price-cell {
  font-family: var(--font-display);
  font-weight: 700;
  color: #34d399;
}

.store-shipping-cell {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.btn-buy-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-buy-external:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

/* Specifications Checklist */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.spec-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.spec-key {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spec-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Side-by-Side Comparison & Bookmarks Drawers
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 250;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  background: #0f1523;
  width: 100%;
  max-width: 900px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  animation: drawerSlide 300ms var(--transition-smooth);
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.drawer-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition-fast);
}

.btn-close-drawer:hover {
  color: #fff;
}

.btn-ghost-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Comparison Table Grid */
.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 160px repeat(var(--compare-cols, 3), minmax(200px, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comp-cell {
  background: #0f1523;
  padding: 14px 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.comp-header-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.comp-product-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background: #141b2c;
  position: relative;
}

.comp-header-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.comp-product-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.btn-remove-comp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-comp:hover {
  color: #f43f5e;
}

/* Saved Items List in Drawer */
.saved-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all var(--transition-fast);
}

.saved-item-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.saved-item-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #151c2d;
  padding: 4px;
}

.saved-item-info {
  flex: 1;
}

.saved-item-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.saved-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.saved-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings Form */
.modal-content-settings {
  padding: 28px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-primary);
}

.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--accent-primary);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1a2236;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 200ms var(--transition-smooth);
}

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

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.4); }

/* Responsive Adjustments */
@media (max-width: 680px) {
  .header-container {
    flex-wrap: wrap;
  }
  .brand-subtitle {
    display: none;
  }
  .search-input-box {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }
  .btn-find {
    justify-content: center;
    width: 100%;
  }
  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
