/* Modern ACAP Search Demo Styles - Frontify-inspired Design System */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap');

:root {
  /* Background Colors */
  --bg-dark: #2d3232;
  --bg-sidebar: #2d3232;
  --bg-card: #3a3f3f;
  --bg-main: #ffffff;
  --bg-white: #ffffff;
  --bg-surface: #f8f8f8;
  --bg-surface-active: #f1f1f1;

  /* Signature Purple Accent (from gengage-ai) */
  --accent: #F668F2;
  --accent-hover: #e85ae4;
  --accent-active: #d94cd5;
  --accent-glow: rgba(246, 104, 242, 0.25);
  --accent-muted: rgba(246, 104, 242, 0.1);
  --accent-foreground: #ffffff;

  /* Secondary Accent (Deep Purple) */
  --accent-secondary: #172AAF;
  --accent-secondary-hover: #1e35c4;

  /* Status Colors */
  --success: #55a855;
  --success-muted: rgba(85, 168, 85, 0.1);
  --warning: #f59e0b;
  --warning-muted: rgba(245, 158, 11, 0.1);
  --error: #dc322f;
  --error-muted: rgba(220, 50, 47, 0.1);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a8adad;
  --text-muted: #6c7070;
  --text-dark: #2d3232;
  --text-dark-secondary: #575b5b;

  /* Border Colors */
  --border-dark: #424747;
  --border-light: #eaebeb;
  --border-subtle: #f1f1f1;
  --border-mid: #dcdede;
  --border-strong: #c4c7c7;

  /* Ring/Focus */
  --ring: var(--accent);
  --ring-glow: var(--accent-glow);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Layout */
  --sidebar-width: 280px;
  --transition: 0.2s ease;
  --radius: 0.3125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.5rem;
  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    'Geist',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar — light theme to match main content */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  color: var(--text-dark);
  border-right: 1px solid var(--border-light);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.logo-icon {
  width: auto;
  height: 32px;
  color: var(--text-dark);
}

.tagline {
  font-size: 13px;
  color: var(--text-dark-secondary);
  margin-left: 0;
}

.sidebar-section {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Merchant Select */
.merchant-select-wrapper {
  position: relative;
}

.select-input {
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px;
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.select-input:hover {
  border-color: var(--accent);
}

.select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-dark-secondary);
  pointer-events: none;
}

.merchant-status {
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
}

.merchant-status.loading {
  color: var(--text-muted);
}

.merchant-status.error {
  color: var(--error);
}

.merchant-status.success {
  color: var(--success);
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.mode-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dark-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-tab:hover {
  color: var(--text-dark);
  background: var(--bg-surface-active);
}

.mode-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Language Pills */
.lang-pills {
  display: flex;
  gap: 6px;
}

.lang-pill {
  padding: 8px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  color: var(--text-dark-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-pill:hover {
  border-color: var(--accent);
  color: var(--text-dark);
}

.lang-pill.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Text Inputs */
.text-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-input:hover {
  border-color: var(--accent);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-input.textarea {
  min-height: 80px;
  resize: vertical;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.powered-by {
  font-size: 11px;
  color: var(--text-dark-secondary);
  margin-top: 12px;
}

.powered-by-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.powered-by-link:hover {
  color: var(--accent-hover);
}

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
  background: var(--error);
  box-shadow: 0 0 8px var(--error);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Search Header */
.search-header {
  background: var(--bg-white);
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 2px solid var(--border-light);
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  max-width: 800px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
}

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

.search-input:focus {
  outline: none;
}

.search-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: var(--bg-surface);
  color: var(--text-dark);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--accent-foreground);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.search-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

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

.search-btn svg {
  width: 18px;
  height: 18px;
}

/* Results Area */
.results-area {
  flex: 1;
  padding: 32px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-white);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.empty-icon svg {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-dark-secondary);
  font-size: 15px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.loader {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}

.loader-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: var(--accent-hover);
  animation-duration: 0.8s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: var(--accent-secondary);
  animation-duration: 0.6s;
}

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

.loading-state p {
  color: var(--text-dark-secondary);
  font-size: 15px;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.error-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--error), #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 20px;
}

.error-state p {
  color: var(--text-dark-secondary);
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 400px;
}

.error-url-hint {
  display: block;
  margin: 8px auto 16px;
  padding: 6px 12px;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-url-hint:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.retry-btn {
  padding: 12px 24px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.retry-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Results Container */
.results-container {
  animation: fadeIn 0.3s ease;
}

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

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-main);
  padding: 12px 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.results-header.stuck {
  border-bottom-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  margin-left: -16px;
  margin-right: -16px;
}

.results-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.result-count {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.search-query {
  font-size: 14px;
  color: var(--text-dark-secondary);
}

.search-mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-mode-badge.mode-keyword {
  background: var(--success-muted);
  color: var(--success);
}
.search-mode-badge.mode-ai {
  background: var(--accent-muted);
  color: var(--accent);
}
.search-mode-badge.mode-categories {
  background: var(--warning-muted);
  color: var(--warning);
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-select {
  padding: 6px 28px 6px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-dark);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c7070' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sort-select:hover {
  border-color: var(--accent);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 20px;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.pagination-bar + .product-grid + .pagination-bar {
  margin-top: 24px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn svg {
  flex-shrink: 0;
}

.page-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark-secondary);
  min-width: 80px;
  text-align: center;
}

.latency-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.latency-pill {
  padding: 6px 12px;
  background: var(--bg-white);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dark-secondary);
  box-shadow: var(--shadow-sm);
}

.latency-pill.total {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: var(--accent-foreground);
  font-weight: 600;
}

/* Copy URL Button */
.copy-url-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--text-dark-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.copy-url-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* API URL Debug Bar */
.api-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 12px;
  overflow: hidden;
}
.api-url-method {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.api-url-method.get {
  background: var(--success-muted);
  color: var(--success);
}
.api-url-method.post {
  background: var(--warning-muted);
  color: var(--warning);
}
.api-url-text {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-dark-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.api-url-text:hover {
  color: var(--accent);
}

/* AI Reasoning */
.ai-reasoning {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--accent-muted);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--text-dark-secondary);
  line-height: 1.5;
}

.ai-reasoning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ai-reasoning-label {
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.ai-reasoning-toggle {
  background: none;
  border: none;
  font-size: var(--font-size-xs);
  color: var(--accent);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background var(--transition);
}

.ai-reasoning-toggle:hover {
  background: rgba(246, 104, 242, 0.15);
}

.ai-reasoning-text {
  display: block;
  white-space: pre-wrap;
}

/* Category Section */
.category-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.category-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark-secondary);
}

.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-chip {
  padding: 6px 14px;
  background: var(--accent-muted);
  border: 1px solid rgba(246, 104, 242, 0.2);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.category-chip:hover {
  background: rgba(246, 104, 242, 0.15);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.category-chip.active {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

.category-chip:active {
  transform: translateY(0);
}

/* Facet Section */
.facet-section {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

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

.facet-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark-secondary);
}

.clear-facets-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.clear-facets-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

/* Active Facet Tags */
.active-facets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.active-facets:empty {
  margin-bottom: 0;
}

.active-facet-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent);
  color: var(--accent-foreground);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.active-facet-remove {
  background: none;
  border: none;
  color: var(--accent-foreground);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.active-facet-remove:hover {
  opacity: 1;
}

/* Facet Groups */
.facet-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.facet-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
  transition: color var(--transition);
}

.facet-group-header:hover {
  color: var(--accent);
}

.facet-group-header::before {
  content: '\25BE';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.facet-group.collapsed .facet-group-header::before {
  transform: rotate(-90deg);
}

.facet-group-count {
  padding: 1px 7px;
  background: var(--bg-surface);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.facet-group-values {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 0 4px 16px;
}

.facet-group.collapsed .facet-group-values {
  display: none;
}

.facet-chip {
  padding: 4px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.facet-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.facet-chip.active {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

.facet-show-more {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.facet-show-more:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-surface);
}

/* PDP Facet Hits */
.pdp-facet-hits {
  margin-bottom: 24px;
}

.pdp-facet-hits h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.facet-hits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.facet-hit-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 12px;
}

.facet-hit-key {
  font-weight: 600;
  color: var(--text-dark-secondary);
}

.facet-hit-key::after {
  content: ':';
}

.facet-hit-value {
  color: var(--text-dark);
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results p {
  font-size: 14px;
  max-width: 320px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Product Card */
.product-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.product-image-wrapper {
  position: relative;
  background: #f8f9fc;
  padding: 16px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--error);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.product-badge.promo {
  background: var(--accent);
}

.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.out-of-stock-text {
  padding: 8px 16px;
  background: var(--text-dark);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}

/* Product Card JSON Icon */
.product-info {
  padding: 16px;
}

.product-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  margin-bottom: 12px;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.price-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-discount {
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dark-secondary);
}

.rating-stars {
  color: var(--accent);
  letter-spacing: 1px;
}

.product-sku {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: var(--bg-white);
  border-radius: 20px;
  max-width: 1000px;
  max-height: 90vh;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-main);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--border-light);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  color: var(--text-dark-secondary);
}

/* Auth Modal */
.auth-modal-container {
  background: var(--bg-white);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

.auth-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  border-radius: 16px;
  color: var(--accent);
}

.auth-modal-container h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.auth-modal-container p {
  font-size: var(--font-size-sm);
  color: var(--text-dark-secondary);
  margin-bottom: 24px;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

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

.auth-submit-btn:active {
  background: var(--accent-active);
}

.auth-error {
  color: var(--error) !important;
  font-size: var(--font-size-sm) !important;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

.dark-mode .auth-modal-container {
  background: var(--bg-card);
}

.dark-mode .auth-modal-container h2 {
  color: var(--text-primary);
}

.dark-mode .auth-input {
  background: var(--bg-dark);
  border-color: var(--border-dark);
  color: var(--text-primary);
}

/* PDP Content */
.pdp-content {
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 32px 32px 32px;
}

.pdp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.pdp-header {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.pdp-images {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.pdp-main-image-container {
  width: 100%;
  max-width: 400px;
  height: 400px;
  background: var(--bg-main);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.pdp-main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pdp-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pdp-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--bg-main);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
  flex-shrink: 0;
}

.pdp-thumbnail:hover,
.pdp-thumbnail.active {
  border-color: var(--accent);
}

.pdp-details h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 12px;
}

.pdp-brand {
  font-size: 14px;
  color: var(--text-dark-secondary);
  margin-bottom: 20px;
}

.pdp-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.pdp-price .price-current {
  font-size: 32px;
}

.pdp-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 15px;
}

.pdp-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}

.pdp-stock.in-stock {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.pdp-stock.out-of-stock {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.pdp-categories {
  margin-bottom: 24px;
}

.pdp-categories h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pdp-category-path {
  font-size: 14px;
  color: var(--accent);
}

.pdp-promotions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.promo-tag {
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
}

.pdp-section {
  margin-bottom: 32px;
}

.pdp-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.pdp-description {
  color: var(--text-dark-secondary);
  line-height: 1.7;
  font-size: 15px;
}

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

.feature-item {
  display: flex;
  padding: 12px 16px;
  background: var(--bg-main);
  border-radius: 10px;
}

.feature-name {
  font-weight: 500;
  color: var(--text-dark-secondary);
  min-width: 140px;
  font-size: 14px;
}

.feature-value {
  color: var(--text-dark);
  font-size: 14px;
}

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

.variant-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-main);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.variant-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.variant-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--bg-white);
  border-radius: 8px;
  flex-shrink: 0;
}

.variant-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.variant-detail {
  font-size: 13px;
  display: flex;
  gap: 4px;
}

.variant-label {
  color: var(--text-muted);
  font-weight: 500;
}

.variant-value {
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-sku {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.pdp-reviews {
  max-height: 400px;
  overflow-y: auto;
}

.review-item {
  padding: 20px;
  background: var(--bg-main);
  border-radius: 12px;
  margin-bottom: 12px;
}

.review-item:last-child {
  margin-bottom: 0;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.review-author {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
}

.review-date {
  font-size: 13px;
  color: var(--text-muted);
}

.review-rating {
  color: var(--accent);
  margin-bottom: 10px;
  font-size: 14px;
}

.review-text {
  color: var(--text-dark-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.pdp-qna .qna-item {
  padding: 20px;
  background: var(--bg-main);
  border-radius: 12px;
  margin-bottom: 12px;
}

.qna-question {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-size: 14px;
}

.qna-answer {
  color: var(--text-dark-secondary);
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  font-size: 14px;
  line-height: 1.6;
}

.pdp-meta {
  background: var(--bg-main);
  padding: 20px;
  border-radius: 12px;
  margin-top: 24px;
}

.pdp-meta p {
  font-size: 13px;
  color: var(--text-dark-secondary);
  margin-bottom: 8px;
}

.pdp-meta p:last-child {
  margin-bottom: 0;
}

.pdp-meta strong {
  color: var(--text-dark);
}

.pdp-meta a {
  color: var(--accent);
  text-decoration: none;
}

.pdp-meta a:hover {
  text-decoration: underline;
}

/* PDP View Mode Toggle Buttons */
.pdp-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 8px;
}

.pdp-view-toggle-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: var(--text-dark-secondary);
}

.pdp-view-toggle-btn:hover {
  background: var(--bg-white);
  color: var(--accent);
}

.pdp-view-toggle-btn.active {
  background: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 2px 4px var(--accent-glow);
}

.pdp-view-icon {
  width: 16px;
  height: 16px;
}

/* PDP JSON View */
.pdp-json-view {
  padding: 20px 0;
}

.pdp-json-header {
  padding: 0 0 20px 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.pdp-json-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.pdp-json-subtitle {
  font-size: 14px;
  color: var(--text-dark-secondary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.pdp-json-note {
  font-size: 13px;
  color: var(--text-dark-secondary);
  margin-top: 8px;
  padding: 12px;
  background: var(--accent-muted);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
}

.pdp-json-code {
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 20px;
  overflow: auto;
  max-height: calc(90vh - 180px);
}

.pdp-json-code pre {
  margin: 0;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.json-content {
  color: var(--text-primary);
}

/* PDP Markdown View */
.pdp-markdown-view {
  padding: 20px 0;
}

.pdp-markdown-content {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin: 0;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  max-height: calc(90vh - 140px);
  tab-size: 2;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .main-content {
    margin-left: 240px;
  }

  .pdp-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .search-header {
    padding: 16px;
  }

  .search-box {
    flex-direction: column;
    padding: 12px;
  }

  .search-input {
    width: 100%;
  }

  .search-btn {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
  }

  .results-area {
    padding: 16px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .pdp-view-toggle-btn {
    width: 32px;
    height: 32px;
  }

  .pdp-content {
    padding: 16px;
  }

  .pdp-main-image-container {
    height: 300px;
  }

  .pdp-json-code,
  .pdp-markdown-content {
    font-size: 12px;
    padding: 16px;
  }

  /* Responsive: results header */
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* Responsive: pagination */
  .pagination-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Responsive: facets */
  .facet-section {
    padding: 12px 14px;
  }

  .facet-group-values {
    max-height: 160px;
  }

  .facet-chip {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Responsive: sort */
  .sort-select {
    font-size: 12px;
    padding: 5px 24px 5px 8px;
  }

  .latency-pill {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* View Mode Tabs */
.view-mode-tabs {
  display: flex;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.view-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dark-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.view-mode-tab:hover {
  color: var(--text-dark);
  background: var(--bg-surface-active);
}

.view-mode-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.view-mode-tab svg {
  flex-shrink: 0;
}

/* API Testing View */
.api-view {
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.api-header {
  margin-bottom: 32px;
}

.api-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.api-header p {
  color: var(--text-dark-secondary);
  font-size: 15px;
}

.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* API Endpoint Card */
.api-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.api-card:hover {
  box-shadow: var(--shadow-md);
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.api-card-header:hover {
  background: var(--bg-main);
}

.api-method {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.api-method.get {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.api-method.post {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

.api-method.put {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.api-method.delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.api-path {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.api-path .param {
  color: var(--accent);
  font-weight: 600;
}

.api-description {
  flex: 1;
  font-size: 13px;
  color: var(--text-dark-secondary);
  margin-left: auto;
  text-align: right;
}

.api-expand-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.api-card.expanded .api-expand-icon {
  transform: rotate(180deg);
}

.api-card-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-light);
}

.api-card.expanded .api-card-body {
  display: block;
}

/* API Form */
.api-form {
  padding-top: 20px;
}

.api-form-section {
  margin-bottom: 20px;
}

.api-form-section:last-child {
  margin-bottom: 0;
}

.api-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.api-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.api-form-row:last-child {
  margin-bottom: 0;
}

.api-form-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.api-form-input::placeholder {
  color: var(--text-muted);
}

.api-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.api-form-input.code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 13px;
}

.api-form-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  color: var(--text-dark);
  resize: vertical;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.api-form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.api-param-name {
  min-width: 140px;
  font-weight: 500;
}

.api-param-required {
  color: var(--error);
  font-size: 11px;
  margin-left: 4px;
}

.api-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border: none;
  border-radius: var(--radius-lg);
  color: var(--accent-foreground);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.api-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

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

.api-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.api-send-btn svg {
  width: 16px;
  height: 16px;
}

/* API Response */
.api-response {
  margin-top: 20px;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.api-response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.api-response-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.api-status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.api-status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.api-response-time {
  font-size: 12px;
  color: var(--text-muted);
}

.api-response-size {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-surface);
  border-radius: 999px;
}

.api-response-copy {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.api-response-copy:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.api-response-body {
  background: var(--bg-dark);
  border-radius: 10px;
  padding: 16px;
  max-height: 400px;
  overflow: auto;
}

.api-response-body pre {
  margin: 0;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* cURL Command Section */
.api-curl-section {
  margin-top: 12px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.api-curl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.api-curl-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.api-curl-code {
  margin: 0;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--text-dark);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* API Category Section */
.api-category {
  margin-bottom: 32px;
}

.api-category:last-child {
  margin-bottom: 0;
}

.api-category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-category-icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius-md);
  color: var(--accent-foreground);
}

.api-category-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =====================================================
   SCROLL TO TOP BUTTON
   ===================================================== */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-foreground);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  opacity: 0.9;
}

.scroll-top-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  opacity: 1;
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  background: var(--bg-dark);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   MOBILE HAMBURGER + SIDEBAR BACKDROP
   ===================================================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible {
  display: block;
}


/* =====================================================
   VIEW TOGGLE (Grid/List)
   ===================================================== */
.view-toggle {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background: var(--bg-white);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.view-toggle-btn:first-child {
  border-right: 1px solid var(--border-light);
}

.view-toggle-btn:hover {
  color: var(--text-dark);
  background: var(--bg-surface);
}

.view-toggle-btn.active {
  background: var(--accent-muted);
  color: var(--accent);
}

/* Product Grid — List View */
.product-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

.product-grid.list-view .product-card {
  display: flex;
  flex-direction: row;
  border-radius: 10px;
}

.product-grid.list-view .product-image-wrapper {
  width: 120px;
  min-width: 120px;
  aspect-ratio: auto;
  padding: 8px;
  border-radius: 10px 0 0 10px;
}

.product-grid.list-view .product-image {
  max-height: 100px;
}

.product-grid.list-view .product-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px;
}

.product-grid.list-view .product-name {
  flex: 1 1 200px;
  -webkit-line-clamp: 1;
}

.product-grid.list-view .product-brand {
  flex: 0 0 auto;
}

.product-grid.list-view .product-price {
  flex: 0 0 auto;
}

.product-grid.list-view .product-rating {
  flex: 0 0 auto;
}

.product-grid.list-view .product-sku {
  flex: 0 0 auto;
}

.product-grid.list-view .product-card:hover {
  transform: translateY(-2px);
}

.product-grid.list-view .image-count-badge {
  bottom: 4px;
  left: 4px;
  padding: 2px 5px;
  font-size: 10px;
}

/* =====================================================
   KEYBOARD SHORTCUTS OVERLAY
   ===================================================== */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.shortcuts-panel {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  min-width: 420px;
  max-width: 520px;
}

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

.shortcuts-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-dark);
}

.shortcuts-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition);
}

.shortcuts-close:hover {
  color: var(--text-dark);
}

.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-dark-secondary);
}

.shortcut-item kbd {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: 0 1px 0 var(--border-mid);
  min-width: 24px;
  text-align: center;
}

.shortcut-item span {
  margin-left: auto;
  color: var(--text-muted);
}

/* =====================================================
   SEARCH STATS SUMMARY
   ===================================================== */
.search-stats {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 0 4px 0;
  letter-spacing: 0.01em;
}

/* =====================================================
   PRODUCT EXTERNAL LINK
   ===================================================== */
/* Similarity results panel (replaces product grid temporarily) */
.sim-results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface, #16213e);
  border-radius: 12px;
  margin-bottom: 16px;
}

.sim-results-header .sim-back-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-light, #333);
  background: transparent;
  color: var(--text-primary, #eaeaea);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 150ms ease;
}

.sim-results-header .sim-back-btn:hover {
  background: var(--accent, #e94560);
  color: #fff;
  border-color: transparent;
}

.sim-results-header .sim-source-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-results-header .sim-source-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.sim-results-header .sim-source-name {
  font-weight: 600;
  color: var(--text-primary, #eaeaea);
  font-size: 14px;
}

.sim-results-header .sim-source-sku {
  font-size: 12px;
  color: var(--text-secondary, #888);
}

.sim-results-header .sim-latency {
  font-size: 12px;
  color: var(--text-secondary, #888);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

/* Similarity score badge on cards in sim results */
.sim-score-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 8px;
  background: rgba(233, 69, 96, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  z-index: 2;
}

.product-ext-link {
  position: absolute;
  top: 12px;
  right: 44px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition);
  color: var(--text-dark-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 2;
  text-decoration: none;
}

.product-card:hover .product-ext-link {
  opacity: 1;
  transform: scale(1);
}

.product-ext-link:hover {
  background: var(--accent-secondary);
  color: var(--accent-foreground);
  box-shadow: 0 4px 12px rgba(23, 42, 175, 0.3);
}

/* =====================================================
   FACET SORT TOGGLE
   ===================================================== */
.facet-sort-toggle {
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.facet-sort-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   FACET GROUP SEARCH INPUT
   ===================================================== */
.facet-search-input {
  width: 100%;
  padding: 5px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.facet-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  background: var(--bg-white);
}

.facet-search-input::placeholder {
  color: var(--text-muted);
}

.facet-chip.hidden-by-search {
  display: none;
}

/* =====================================================
   PRODUCT IMAGE COUNT BADGE
   ===================================================== */
.image-count-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.image-count-badge svg {
  flex-shrink: 0;
}

/* =====================================================
   RECENT SEARCHES
   ===================================================== */
.recent-searches {
  width: 100%;
  max-width: 480px;
  margin-top: 20px;
}

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

.recent-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark-secondary);
}

.recent-clear-btn {
  background: none;
  border: none;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.recent-clear-btn:hover {
  color: var(--error);
  background: var(--error-muted);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-align: left;
  width: 100%;
}

.recent-item:hover {
  background: var(--bg-surface-active);
  border-color: var(--border-mid);
}

.recent-query {
  font-size: var(--font-size-sm);
  color: var(--text-dark);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.recent-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================================================
   SKELETON LOADING CARDS
   ===================================================== */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px 24px;
}

.skeleton-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.skeleton-image {
  width: 100%;
  height: 180px;
  background: var(--bg-surface);
}

.skeleton-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-surface);
}

@keyframes skeleton-shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.skeleton-shimmer {
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* =====================================================
   ACCESSIBILITY: Screen reader only
   ===================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive for API View */
@media (max-width: 768px) {
  .api-view {
    padding: 16px;
  }

  .api-card-header {
    flex-wrap: wrap;
  }

  .api-description {
    width: 100%;
    text-align: left;
    margin-left: 0;
    margin-top: 8px;
  }

  .api-form-row {
    flex-direction: column;
  }

  .api-param-name {
    min-width: auto;
  }
}

/* =====================================================
   SEARCH SUGGESTIONS DROPDOWN (Autocomplete)
   ===================================================== */
.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--bg-surface);
}

.suggestion-item mark {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
  border-radius: 2px;
  padding: 0 1px;
}

.suggestion-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================================================
   PAGE JUMP INPUT
   ===================================================== */
.page-jump-input {
  width: 60px;
  padding: 2px 6px;
  font-size: var(--font-size-sm);
  font-family: inherit;
  text-align: center;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-dark);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-info {
  cursor: pointer;
}

.page-info:hover {
  color: var(--accent);
}

/* =====================================================
   ACTIVE FILTER BADGE
   ===================================================== */
.active-filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.active-filter-badge:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* =====================================================
   PDP IMAGE CAROUSEL ARROWS & COUNTER
   ===================================================== */
.pdp-main-image-container {
  position: relative;
}

.pdp-image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-dark);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
  z-index: 2;
  line-height: 1;
}

.pdp-main-image-container:hover .pdp-image-arrow {
  opacity: 1;
}

.pdp-image-arrow:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--accent);
}

.pdp-image-arrow-left {
  left: 8px;
}

.pdp-image-arrow-right {
  right: 8px;
}

.pdp-image-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
}

/* =====================================================
   SUGGESTION KEYBOARD HIGHLIGHT
   ===================================================== */
.suggestion-item.highlighted {
  background: var(--bg-surface-active);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* =====================================================
   PRODUCT COMPARISON
   ===================================================== */
.compare-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-dark-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.compare-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compare-toggle-btn.active {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

/* Compare checkbox on product cards */
.product-compare-check {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  z-index: 5;
  cursor: pointer;
  accent-color: var(--accent);
}

.product-card.compare-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Floating compare bar */
.compare-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg-dark);
  color: var(--text-primary);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.compare-bar-count {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.compare-bar-btn {
  padding: 6px 16px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent-foreground);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}

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

.compare-bar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.compare-bar-cancel {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.compare-bar-cancel:hover {
  color: var(--text-primary);
}

/* Comparison modal */
.compare-modal-container {
  max-width: 95vw;
  width: fit-content;
  min-width: min(600px, 95vw);
  overflow-y: auto;
}

@media (max-width: 768px) {
  .compare-modal-container {
    min-width: auto;
    width: 95vw;
  }

  .compare-label {
    min-width: 80px;
    max-width: 80px;
    font-size: 10px;
  }

  .compare-cell {
    min-width: 120px;
    font-size: 12px;
  }

  .compare-product-img {
    width: 60px;
    height: 60px;
  }
}

.compare-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.compare-content {
  padding: 24px;
  overflow-x: auto;
}

.compare-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.compare-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.compare-row:last-child {
  border-bottom: none;
}

.compare-label {
  min-width: 120px;
  max-width: 120px;
  padding: 10px 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-dark-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.compare-cell {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  font-size: var(--font-size-sm);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border-subtle);
}

.compare-product-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: var(--radius);
}

.compare-best {
  color: var(--success);
  font-weight: 600;
}

.compare-worst {
  color: var(--error);
  font-weight: 500;
}

/* =====================================================
   IMAGE ZOOM OVERLAY
   ===================================================== */
.image-zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-zoom-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
  .sidebar,
  .sidebar-backdrop,
  .scroll-top-btn,
  .toast-container,
  .search-header,
  .compare-bar,
  .shortcuts-overlay,
  .modal-overlay,
  .image-zoom-overlay,
  .pagination-bar,
  .results-controls,
  .facet-section,
  .ai-reasoning-toggle,
  .api-url-bar {
    display: none !important;
  }

  #app {
    display: block !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .product-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd;
  }

  .product-card:hover {
    transform: none !important;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
  }

  .results-header {
    position: static !important;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }

  .product-image {
    max-height: 120px;
  }

  /* Show URL for external links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    color: #666;
  }
}

/* =====================================================
   PRODUCT SKU COPY HOVER INDICATOR
   ===================================================== */
.product-sku:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dashed;
}

/* =====================================================
   PRODUCT VARIANT BADGE
   ===================================================== */
.product-variant-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--accent-secondary);
  background: rgba(23, 42, 175, 0.08);
  border: 1px solid rgba(23, 42, 175, 0.2);
  border-radius: 999px;
}

/* =====================================================
   FACET NO-MATCH HINT
   ===================================================== */
.facet-no-match {
  padding: 8px 12px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* =====================================================
   SEARCH CONTEXT CHIPS BAR
   ===================================================== */
.search-context-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px;
  margin-bottom: 8px;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-dark-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  white-space: nowrap;
}

/* =====================================================
   IMAGE LOAD FADE-IN
   ===================================================== */
.product-image {
  transition: opacity 0.3s ease;
}

.product-image.img-loading {
  opacity: 0.3;
}

/* =====================================================
   SEARCH TERM HIGHLIGHTING
   ===================================================== */
.search-highlight {
  background: rgba(246, 104, 242, 0.18);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* =====================================================
   COMPARISON COPY MARKDOWN BUTTON
   ===================================================== */
.compare-copy-md-btn {
  display: block;
  margin: 16px auto 0;
  padding: 8px 20px;
  background: var(--bg-surface);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--transition);
}

.compare-copy-md-btn:hover {
  background: var(--bg-surface-active);
  border-color: var(--border-mid);
}

/* =====================================================
   DARK MODE TOGGLE BUTTON
   ===================================================== */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-white);
  color: var(--text-dark-secondary);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.dark-mode-toggle:hover {
  background: var(--bg-surface-active);
  color: var(--text-dark);
}

/* =====================================================
   DARK MODE
   ===================================================== */
.dark-mode .main-content {
  background: #1a1d1d;
  color: #e0e3e3;
}

.dark-mode .sidebar {
  background: #222626;
  color: #e0e3e3;
  border-right-color: #333;
}

.dark-mode .sidebar .field-label {
  color: #999;
}

.dark-mode .sidebar .tagline {
  color: #888;
}

.dark-mode .sidebar .mode-tabs {
  background: #2a2e2e;
  border-color: #444;
}

.dark-mode .sidebar .mode-tab {
  color: #999;
}

.dark-mode .sidebar .mode-tab:hover {
  color: #e0e3e3;
  background: #333;
}

.dark-mode .sidebar .lang-pill {
  background: #2a2e2e;
  border-color: #444;
  color: #999;
}

.dark-mode .sidebar .lang-pill:hover {
  color: #e0e3e3;
}

.dark-mode .sidebar .dark-mode-toggle {
  background: #2a2e2e;
  color: #999;
  border-color: #444;
}

.dark-mode .sidebar .dark-mode-toggle:hover {
  background: #333;
  color: #e0e3e3;
}

.dark-mode .sidebar .sidebar-footer {
  border-top-color: #333;
}

.dark-mode .sidebar .powered-by,
.dark-mode .sidebar .api-status {
  color: #888;
}

.dark-mode .sidebar .view-mode-tabs {
  background: #2a2e2e;
  border-color: #444;
}

.dark-mode .sidebar .view-mode-tab {
  color: #999;
}

.dark-mode .sidebar .view-mode-tab:hover {
  color: #e0e3e3;
  background: #333;
}

.dark-mode .sidebar .page-size-preset {
  background: #2a2e2e;
  border-color: #444;
  color: #999;
}

.dark-mode .sidebar .page-size-preset:hover {
  color: #e0e3e3;
}

.dark-mode .sidebar .merchant-fav-btn {
  background: #2a2e2e;
  border-color: #444;
  color: #999;
}

.dark-mode .search-header {
  background: #222626;
  border-bottom-color: #333;
}

.dark-mode .search-input {
  background: #2a2e2e;
  color: #e0e3e3;
  border-color: #444;
}

.dark-mode .search-input::placeholder {
  color: #777;
}

.dark-mode .search-btn {
  background: var(--accent-secondary);
}

.dark-mode .results-header {
  background: #222626;
  border-color: #333;
}

.dark-mode .results-header.stuck {
  background: #222626;
  border-bottom-color: #444;
}

.dark-mode .product-card {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .product-card:hover {
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .product-name {
  color: #e0e3e3;
}

.dark-mode .product-brand {
  color: #999;
}

.dark-mode .product-sku {
  color: #888;
}

.dark-mode .price-current {
  color: #e0e3e3;
}

.dark-mode .price-original {
  color: #777;
}

.dark-mode .product-rating {
  color: #bbb;
}

.dark-mode .product-info {
  border-top-color: #3a3f3f;
}

.dark-mode .pagination-btn {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .pagination-btn:hover:not(:disabled) {
  background: #363a3a;
}

.dark-mode .page-info {
  color: #aaa;
}

.dark-mode .sort-select {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .category-section {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .category-chip {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .facet-section {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .facet-chip {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .facet-chip.active {
  background: rgba(23, 42, 175, 0.3);
  border-color: var(--accent-secondary);
  color: #bcd;
}

.dark-mode .facet-group-header {
  color: #ccc;
}

.dark-mode .active-facet-tag {
  background: rgba(23, 42, 175, 0.25);
  border-color: rgba(23, 42, 175, 0.4);
  color: #bcd;
}

.dark-mode .ai-reasoning {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .empty-state,
.dark-mode .error-state {
  color: #999;
}

.dark-mode .loading-state p {
  color: #999;
}

.dark-mode .text-input,
.dark-mode .select-input {
  background: #2a2e2e;
  color: #e0e3e3;
  border-color: #444;
}

.dark-mode .results-area {
  background: #1a1d1d;
}

.dark-mode .modal-container {
  background: #222626;
  color: #e0e3e3;
}

.dark-mode .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.dark-mode .pdp-features .feature-item {
  border-color: #3a3f3f;
}

.dark-mode .feature-name {
  color: #999;
}

.dark-mode .feature-value {
  color: #e0e3e3;
}

.dark-mode .review-item {
  border-color: #3a3f3f;
}

.dark-mode .pdp-json-code,
.dark-mode .pdp-markdown-content {
  background: #1a1d1d;
  color: #ccc;
}

.dark-mode .api-card {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .api-card-header {
  color: #ccc;
}

.dark-mode .api-card-body {
  background: #222626;
  border-top-color: #3a3f3f;
}

.dark-mode .api-form-input {
  background: #2a2e2e;
  color: #e0e3e3;
  border-color: #444;
}

.dark-mode .api-response-body pre {
  background: #1a1d1d;
  color: #ccc;
}

.dark-mode .api-curl-code {
  background: #1a1d1d;
  color: #ccc;
}

.dark-mode .search-suggestions {
  background: #2a2e2e;
  border-color: #444;
}

.dark-mode .suggestion-item {
  color: #ccc;
}

.dark-mode .suggestion-item:hover,
.dark-mode .suggestion-item.highlighted {
  background: #363a3a;
}

.dark-mode .search-stats {
  color: #888;
}

.dark-mode .context-chip {
  background: #2a2e2e;
  border-color: #444;
  color: #aaa;
}

.dark-mode .api-url-bar {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .api-url-text {
  color: #aaa;
}

.dark-mode .copy-url-btn,
.dark-mode .compare-toggle-btn {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .view-toggle-btn {
  color: #888;
}

.dark-mode .view-toggle-btn.active {
  color: #e0e3e3;
  background: #363a3a;
}

.dark-mode .compare-bar {
  background: #262a2a;
  border-color: #444;
}

.dark-mode .compare-modal-container {
  background: #222626;
  color: #e0e3e3;
}

.dark-mode .compare-row {
  border-color: #3a3f3f;
}

.dark-mode .compare-label {
  background: #262a2a;
  color: #999;
}

.dark-mode .compare-cell {
  color: #ccc;
}

.dark-mode .image-zoom-overlay {
  background: rgba(0, 0, 0, 0.9);
}

.dark-mode .shortcuts-panel {
  background: #262a2a;
  color: #e0e3e3;
}

.dark-mode .shortcuts-panel kbd {
  background: #3a3f3f;
  border-color: #555;
  color: #e0e3e3;
}

.dark-mode .skeleton-shimmer {
  background: linear-gradient(90deg, #2a2e2e 25%, #363a3a 50%, #2a2e2e 75%);
  background-size: 200% 100%;
}

.dark-mode .search-highlight {
  background: rgba(246, 104, 242, 0.25);
}

.dark-mode .compare-copy-md-btn {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .compare-copy-md-btn:hover {
  background: #363a3a;
}

.dark-mode .error-url-hint {
  background: #2a2e2e;
  border-color: #444;
  color: #aaa;
}

.dark-mode .no-results {
  color: #888;
}

.dark-mode .latency-pill {
  background: #2a2e2e;
  color: #aaa;
  border-color: #444;
}

.dark-mode .search-mode-badge {
  background: #2a2e2e;
  color: #ccc;
}

.dark-mode .result-count {
  color: #ccc;
}

.dark-mode .search-query {
  color: #aaa;
}

.dark-mode .active-filter-badge {
  background: rgba(23, 42, 175, 0.25);
  border-color: rgba(23, 42, 175, 0.4);
  color: #bcd;
}

.dark-mode .recent-searches {
  background: #262a2a;
  border-color: #3a3f3f;
}

.dark-mode .recent-item {
  background: #2a2e2e;
  border-color: #444;
  color: #ccc;
}

.dark-mode .recent-item:hover {
  background: #363a3a;
}

/* =====================================================
   PRODUCT RANK BADGE
   ===================================================== */
.product-rank-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(45, 50, 50, 0.75);
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

.dark-mode .product-rank-badge {
  background: rgba(200, 200, 200, 0.2);
}

/* =====================================================
   PDP PREV/NEXT NAVIGATION BAR
   ===================================================== */
.pdp-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}

.pdp-nav-btn {
  padding: 6px 14px;
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.pdp-nav-btn:hover:not(:disabled) {
  background: var(--bg-surface-active);
  border-color: var(--border-mid);
}

.pdp-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdp-nav-pos {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
}

.pdp-nav-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-dark-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.pdp-nav-close:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.dark-mode .pdp-nav-bar {
  border-bottom-color: #3a3f3f;
}

.dark-mode .pdp-nav-btn {
  background: #2a2e2e;
  color: #ccc;
  border-color: #444;
}

.dark-mode .pdp-nav-btn:hover:not(:disabled) {
  background: #363a3a;
}

.dark-mode .pdp-nav-pos {
  color: #888;
}

.dark-mode .pdp-nav-close {
  color: #999;
}

.dark-mode .pdp-nav-close:hover {
  background: #363a3a;
  color: #ccc;
}

/* =====================================================
   FACET GROUP COLLAPSE ANIMATION
   ===================================================== */
.facet-group-values {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}

.facet-group.collapsed .facet-group-values {
  max-height: 0;
  opacity: 0;
}

.facet-group.collapsed .facet-search-input {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border-width: 0;
  transition: all 0.2s ease;
}

.facet-search-input {
  transition: all 0.2s ease;
}

/* =====================================================
   TOAST CLICK-TO-DISMISS
   ===================================================== */
.toast {
  cursor: pointer;
}

/* =====================================================
   BRAND QUICK-FILTER CHIPS
   ===================================================== */
.brand-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 8px;
}

.brand-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.brand-chip {
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-dark-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.brand-chip:hover {
  background: var(--bg-surface-active);
  border-color: var(--border-mid);
}

.brand-chip.active {
  background: var(--accent-secondary);
  color: white;
  border-color: var(--accent-secondary);
}

.dark-mode .brand-chip {
  background: #2a2e2e;
  color: #aaa;
  border-color: #444;
}

.dark-mode .brand-chip:hover {
  background: #363a3a;
}

.dark-mode .brand-chip.active {
  background: var(--accent-secondary);
  color: white;
  border-color: var(--accent-secondary);
}

.dark-mode .brand-filter-label {
  color: #777;
}

/* =====================================================
   API CATEGORY COLLAPSIBLE
   ===================================================== */
.api-category-cards {
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.api-category-collapsed .api-category-cards {
  max-height: 0 !important;
  overflow: hidden;
  opacity: 0;
}

.api-category-title {
  user-select: none;
}

.api-category-title::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.api-category-collapsed .api-category-title::after {
  transform: rotate(-90deg);
}

/* =====================================================
   PRODUCT CARD STAGGERED ENTER ANIMATION
   ===================================================== */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: cardEnter 0.3s ease forwards;
  opacity: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .card-enter {
    animation: none;
    opacity: 1;
  }
}

/* =====================================================
   INSTANT FILTER (client-side result filter)
   ===================================================== */
.instant-filter-bar {
  padding: 0 0 8px;
}

.instant-filter-input {
  width: 100%;
  max-width: 400px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--text-dark);
  outline: none;
  transition: border-color var(--transition);
}

.instant-filter-input:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 2px rgba(23, 42, 175, 0.1);
}

.instant-filter-input::placeholder {
  color: var(--text-muted);
}

.dark-mode .instant-filter-input {
  background: #2a2e2e;
  color: #e0e3e3;
  border-color: #444;
}

.dark-mode .instant-filter-input:focus {
  border-color: var(--accent-secondary);
}

.dark-mode .instant-filter-input::placeholder {
  color: #777;
}

/* =====================================================
   JSON SYNTAX HIGHLIGHTING
   ===================================================== */
.json-key {
  color: #172AAF;
}

.json-string {
  color: #2aa198;
}

.json-number {
  color: #d33682;
}

.json-boolean {
  color: #b58900;
}

.json-null {
  color: #6c7070;
}

.dark-mode .json-key {
  color: #82aaff;
}

.dark-mode .json-string {
  color: #c3e88d;
}

.dark-mode .json-number {
  color: #f78c6c;
}

.dark-mode .json-boolean {
  color: #ffcb6b;
}

.dark-mode .json-null {
  color: #888;
}

/* =====================================================
   COMPARISON EXPORT ROW
   ===================================================== */
.compare-export-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

/* =====================================================
   COMPACT GRID MODE
   ===================================================== */
.compact-mode .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.compact-mode .product-card {
  font-size: 11px;
}

.compact-mode .product-image-wrapper {
  height: 130px;
}

.compact-mode .product-info {
  padding: 8px;
}

.compact-mode .product-name {
  font-size: 12px;
  -webkit-line-clamp: 2;
}

.compact-mode .product-brand {
  font-size: 10px;
}

.compact-mode .product-price {
  font-size: 12px;
}

.compact-mode .product-rating {
  font-size: 10px;
}

.compact-mode .product-sku {
  display: none;
}

.compact-mode .product-variant-badge {
  display: none;
}

.compact-mode .data-quality-bar {
  display: none;
}

.compact-mode .product-rank-badge {
  font-size: 9px;
  padding: 1px 4px;
}

/* =====================================================
   DATA COMPLETENESS BAR
   ===================================================== */
.data-quality-bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.data-quality-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.data-quality-fill.medium {
  background: var(--warning);
}

.data-quality-fill.low {
  background: var(--error);
}

.dark-mode .data-quality-bar {
  background: #3a3f3f;
}

/* =====================================================
   LATENCY PILL BAR CHART (AI mode)
   ===================================================== */
.latency-pill {
  position: relative;
}

.dark-mode .latency-pill[style*="linear-gradient"] {
  background: linear-gradient(90deg, rgba(23,42,175,0.25) var(--pct, 50%), transparent var(--pct, 50%)) !important;
}

/* =====================================================
   PDP COLLAPSIBLE ACCORDION SECTIONS
   ===================================================== */
.pdp-collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--transition);
}

.pdp-collapsible-header:hover {
  color: var(--accent);
}

.pdp-chevron {
  font-size: 12px;
  transition: transform 0.25s ease;
  margin-left: 8px;
  color: var(--text-muted);
}

.pdp-collapsible.collapsed .pdp-chevron {
  transform: rotate(-90deg);
}

.pdp-collapsible-body {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

.pdp-collapsible.collapsed .pdp-collapsible-body {
  max-height: 0;
  opacity: 0;
}

/* =====================================================
   IMAGE GALLERY LIGHTBOX (enhanced zoom overlay)
   ===================================================== */
.image-zoom-img {
  cursor: default;
}

.gallery-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 14px;
  border-radius: 20px;
  pointer-events: none;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 40px;
  width: 50px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
  z-index: 10;
}

.gallery-nav-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.gallery-nav-prev {
  left: 16px;
}

.gallery-nav-next {
  right: 16px;
}

.gallery-thumb-strip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: 80vw;
  overflow-x: auto;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
}

.gallery-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, outline-color 0.2s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
  flex-shrink: 0;
}

.gallery-thumb:hover {
  opacity: 0.8;
}

.gallery-thumb.active {
  opacity: 1;
  outline-color: var(--accent);
}

/* =====================================================
   SHORTCUTS OVERLAY — GROUPED LAYOUT
   ===================================================== */
.shortcuts-grouped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.shortcut-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 4px 0;
}

.dark-mode .shortcut-group-title {
  color: var(--accent);
}

/* =====================================================
   ACCESSIBLE CONTRAST IMPROVEMENTS
   ===================================================== */
/* Improve muted text contrast (WCAG AA — 4.5:1 minimum on white) */
.search-stats,
.card-sku,
.feature-name,
.review-date,
.variant-sku,
.pdp-meta p {
  color: #575b5b;
}

/* Improve sidebar muted text contrast (WCAG AA on dark bg) */
.sidebar-section-title {
  color: #b0b5b5;
}

/* Ensure kbd elements have sufficient contrast */
.shortcut-item kbd {
  color: #2d3232;
}

/* Improve placeholder contrast */
::placeholder {
  color: #8a8f8f;
}

.dark-mode ::placeholder {
  color: #7a7f7f;
}

/* Improve disabled button contrast */
button:disabled {
  opacity: 0.5;
}

/* Gallery dark mode inherits overlay styling */
.dark-mode .gallery-counter {
  color: rgba(255, 255, 255, 0.9);
}

/* PDP collapsible dark mode */
.dark-mode .pdp-collapsible-header:hover {
  color: var(--accent);
}

.dark-mode .pdp-chevron {
  color: #8a8f8f;
}

/* Expand/Collapse all toggle */
.pdp-toggle-all {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.pdp-toggle-all-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.pdp-toggle-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dark-mode .pdp-toggle-all-btn {
  border-color: #555;
  color: #aaa;
}

.dark-mode .pdp-toggle-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   PDP Q&A SECTION
   ===================================================== */
.pdp-qna {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qna-item {
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-secondary);
}

.qna-question {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

.qna-answer {
  color: var(--text-dark-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.qna-date {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.dark-mode .qna-item {
  background: #333838;
  border-left-color: var(--accent);
}

.dark-mode .qna-question {
  color: #e0e0e0;
}

.dark-mode .qna-answer {
  color: #b0b5b5;
}

/* =====================================================
   PDP SELLERS SECTION
   ===================================================== */
.pdp-sellers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seller-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.seller-name {
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
}

.seller-price {
  font-weight: 600;
  color: var(--accent-secondary);
}

.seller-rating {
  font-size: 13px;
  color: var(--text-muted);
}

.dark-mode .seller-item {
  background: #333838;
}

.dark-mode .seller-name {
  color: #e0e0e0;
}

.dark-mode .seller-price {
  color: var(--accent);
}

/* =====================================================
   PDP DOCUMENTS & DELIVERY/PAYMENT
   ===================================================== */
.pdp-documents,
.pdp-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdp-documents li,
.pdp-info-list li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dark-secondary);
}

.pdp-documents a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.pdp-documents a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.pdp-sub-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 12px 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdp-sub-label:first-child {
  margin-top: 0;
}

.dark-mode .pdp-documents li,
.dark-mode .pdp-info-list li {
  color: #b0b5b5;
}

.dark-mode .pdp-documents a {
  color: var(--accent);
}

.dark-mode .pdp-sub-label {
  color: #ccc;
}

/* =====================================================
   PDP SKELETON LOADING
   ===================================================== */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton-pulse {
  animation: skeletonPulse 1.5s ease-in-out infinite;
  background: var(--border-light);
  border-radius: var(--radius-md);
}

.pdp-skeleton {
  padding: 24px;
}

.pdp-skeleton-header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.pdp-skeleton-img {
  width: 300px;
  height: 300px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
}

.pdp-skeleton-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.pdp-skeleton-line {
  height: 18px;
  border-radius: 4px;
}

.pdp-skeleton-block {
  height: 80px;
  margin-bottom: 16px;
}

.dark-mode .skeleton-pulse {
  background: #3a3f3f;
}

/* =====================================================
   PRODUCT CARD CONTEXT MENU
   ===================================================== */
.card-context-menu {
  position: fixed;
  z-index: 9999;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 4px 0;
  animation: fadeIn 0.1s ease-out;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
  transition: background var(--transition);
}

.context-menu-item:hover {
  background: var(--bg-surface);
}

.context-menu-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dark-mode .card-context-menu {
  background: #2a2f2f;
  border-color: #444;
}

.dark-mode .context-menu-item {
  color: #e0e0e0;
}

.dark-mode .context-menu-item:hover {
  background: #333838;
}

/* =====================================================
   COMPARE BULK ACTION BUTTONS
   ===================================================== */
.compare-bulk-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.compare-bulk-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* =====================================================
   PDP COPY ACTION BUTTONS
   ===================================================== */
.pdp-copy-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.pdp-copy-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.pdp-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.dark-mode .pdp-copy-actions {
  border-top-color: #444;
}

.dark-mode .pdp-copy-btn {
  background: #333838;
  border-color: #555;
  color: #b0b5b5;
}

.dark-mode .pdp-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(246, 104, 242, 0.1);
}

/* =====================================================
   SCROLL PROGRESS BAR
   ===================================================== */
.scroll-progress {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 60;
}

.scroll-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.05s linear;
  border-radius: 0 2px 2px 0;
}

/* =====================================================
   PRODUCT CARD KEYBOARD FOCUS
   ===================================================== */
.product-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-glow);
}

.product-card:focus:not(:focus-visible) {
  outline: none;
  box-shadow: var(--shadow-md);
}

.product-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-glow);
}

/* =====================================================
   MOBILE GALLERY LIGHTBOX FIXES
   ===================================================== */
@media (max-width: 768px) {
  .gallery-nav-btn {
    width: 40px;
    height: 48px;
    font-size: 32px;
  }

  .gallery-nav-prev {
    left: 8px;
  }

  .gallery-nav-next {
    right: 8px;
  }

  .gallery-thumb-strip {
    max-width: 90vw;
    padding: 6px 8px;
  }

  .gallery-thumb {
    width: 44px;
    height: 44px;
  }

  .gallery-counter {
    top: 12px;
    font-size: 13px;
  }

  .image-zoom-img {
    max-width: 95vw;
    max-height: 70vh;
  }

  .pdp-skeleton-header {
    flex-direction: column;
  }

  .pdp-skeleton-img {
    width: 100%;
    height: 200px;
  }

  .shortcuts-grouped {
    grid-template-columns: 1fr;
  }

  .shortcuts-panel {
    min-width: auto;
    max-width: 90vw;
  }

  .card-context-menu {
    min-width: 160px;
  }

  .pdp-copy-actions {
    flex-wrap: wrap;
  }

  .ai-pipeline-steps {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }

  .pipeline-step {
    width: 100% !important;
  }

  .popular-chips {
    justify-content: center;
  }
}

/* =====================================================
   POPULAR SEARCHES (empty state)
   ===================================================== */
.popular-searches {
  margin-top: 20px;
  text-align: center;
}

.popular-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.popular-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.popular-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.popular-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.dark-mode .popular-chip {
  background: #333838;
  border-color: #555;
  color: #b0b5b5;
}

.dark-mode .popular-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(246, 104, 242, 0.1);
}

.dark-mode .popular-label {
  color: #8a8f8f;
}

/* =====================================================
   AI PIPELINE STEP VISUALIZATION
   ===================================================== */
.ai-pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
}

.pipeline-step:not(:last-child)::after {
  content: '\u2192';
  position: absolute;
  right: -12px;
  color: var(--border-mid);
  font-size: 14px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-mid);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-label {
  white-space: nowrap;
  font-weight: 500;
}

.pipeline-step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: stepPulse 1s ease-in-out infinite;
}

.pipeline-step.active {
  color: var(--accent);
}

.pipeline-step.done .step-dot {
  background: var(--success);
}

.pipeline-step.done {
  color: var(--success);
}

@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

.dark-mode .ai-pipeline-steps {
  background: #2a2f2f;
  border-color: #444;
}

.dark-mode .pipeline-step:not(:last-child)::after {
  color: #555;
}

.dark-mode .step-dot {
  background: #555;
}

/* =====================================================
   PAGE SIZE PRESETS
   ===================================================== */
.page-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-input {
  width: 64px;
  flex-shrink: 0;
}

.page-size-presets {
  display: flex;
  gap: 4px;
}

.page-size-preset {
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  color: var(--text-dark-secondary);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.page-size-preset:hover {
  color: var(--text-dark);
  border-color: var(--accent);
}

.page-size-preset.active {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

/* =====================================================
   TABLE VIEW
   ===================================================== */
.product-grid.table-view {
  display: block;
  overflow-x: auto;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.product-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.product-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark-secondary);
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-mid);
  white-space: nowrap;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.sortable-th:hover {
  color: var(--accent);
}

.product-table-row {
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}

.product-table-row:hover {
  background: var(--bg-surface);
}

.product-table-row.compare-selected {
  background: var(--accent-muted);
}

.product-table td {
  padding: 8px 12px;
  vertical-align: middle;
}

.table-rank {
  font-weight: 600;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

.table-product-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg-surface);
}

.table-name {
  font-weight: 500;
  color: var(--text-dark);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-brand {
  color: var(--text-dark-secondary);
  white-space: nowrap;
}

.table-price {
  font-weight: 600;
  color: var(--accent-secondary);
  white-space: nowrap;
}

.table-price.discounted {
  color: var(--error);
}

.table-rating {
  white-space: nowrap;
}

.table-in-stock {
  color: var(--success);
  font-weight: 500;
}

.table-out-of-stock {
  color: var(--error);
  font-weight: 500;
}

.table-sku {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.table-sku:hover {
  color: var(--accent);
}

/* Dark mode table */
.dark-mode .product-table th {
  background: #2a2f2f;
  color: #aaa;
  border-bottom-color: #444;
}

.dark-mode .product-table-row {
  border-bottom-color: #333;
}

.dark-mode .product-table-row:hover {
  background: #333838;
}

.dark-mode .table-name {
  color: #e0e0e0;
}

.dark-mode .table-brand {
  color: #b0b5b5;
}

.dark-mode .table-price {
  color: var(--accent);
}

.dark-mode .table-product-img {
  background: #333838;
}

/* Responsive table */
@media (max-width: 768px) {
  .product-table {
    font-size: 12px;
  }

  .product-table th,
  .product-table td {
    padding: 6px 8px;
  }

  .table-product-img {
    width: 32px;
    height: 32px;
  }

  .table-name {
    max-width: 150px;
  }
}

/* ========================================
   Merchant Favorites
   ======================================== */

.merchant-select-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.merchant-select-row .merchant-select-wrapper {
  flex: 1;
  min-width: 0;
}

.merchant-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-white);
  border: 1px solid var(--border-mid);
  font-size: 16px;
  cursor: pointer;
  color: var(--text-dark-secondary);
  width: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  transition: color 0.2s, transform 0.2s, border-color 0.2s, background 0.2s;
}

.merchant-fav-btn:hover {
  color: #f5a623;
  transform: scale(1.2);
}

.merchant-fav-btn.active {
  color: #f5a623;
}

/* ========================================
   Card Image Mini-Gallery Dots
   ======================================== */

.card-img-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-image-wrapper:hover .card-img-dots {
  opacity: 1;
}

.card-img-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}

.card-img-dot:hover {
  transform: scale(1.3);
}

.card-img-dot.active {
  background: white;
  border-color: white;
}

.dark-mode .card-img-dot {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
}

.dark-mode .card-img-dot.active {
  background: white;
  border-color: white;
}

/* ========================================
   Table Column Toggle Bar
   ======================================== */

.table-col-toggle-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}

.table-col-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.table-col-toggle {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.table-col-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-col-toggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.dark-mode .table-col-toggle-bar {
  background: #2a2f2f;
  border-color: #444;
}

.dark-mode .table-col-toggle {
  border-color: #555;
  color: #999;
}

.dark-mode .table-col-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dark-mode .table-col-toggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ========================================
   Comparison Diff Highlighting
   ======================================== */

.compare-diff-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}

.compare-diff-toggle input {
  accent-color: var(--accent);
}

.compare-table.show-diff .compare-row-diff .compare-cell {
  background: rgba(246, 104, 242, 0.06);
  border-left: 2px solid var(--accent-secondary);
}

.dark-mode .compare-table.show-diff .compare-row-diff .compare-cell {
  background: rgba(246, 104, 242, 0.1);
}

/* ========================================
   Batch Copy Toolbar
   ======================================== */

.batch-copy-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.batch-copy-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.batch-copy-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.batch-copy-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.dark-mode .batch-copy-bar {
  background: #2a2f2f;
  border-color: #444;
}

.dark-mode .batch-copy-btn {
  border-color: #555;
  color: #aaa;
}

.dark-mode .batch-copy-btn:hover {
  background: var(--accent);
  color: white;
}

/* ========================================
   Save Preset Button
   ======================================== */

.save-preset-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.save-preset-btn:hover {
  background: #f5a623;
  color: white;
  border-color: #f5a623;
}

/* ========================================
   Search Presets (Empty State)
   ======================================== */

.search-presets {
  margin-top: 16px;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.presets-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.presets-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.presets-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-btn {
  flex: 1;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}

.preset-btn:hover {
  border-color: var(--accent);
  background: rgba(23, 42, 175, 0.04);
}

.preset-btn strong {
  display: block;
  font-weight: 600;
}

.preset-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.preset-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.preset-del-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.dark-mode .preset-btn {
  background: #2a2f2f;
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .preset-btn:hover {
  border-color: var(--accent);
  background: rgba(23, 42, 175, 0.1);
}

.dark-mode .preset-meta {
  color: #888;
}

/* ========================================
   Card Hover Preview Tooltip
   ======================================== */

.card-preview-tooltip {
  position: absolute;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  pointer-events: none;
  animation: tooltipFadeIn 0.15s ease;
}

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

.dark-mode .card-preview-tooltip {
  background: #2a2f2f;
  border-color: #555;
  color: #ccc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Latency Sparkline
   ======================================== */

.latency-sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  padding: 2px 4px;
  margin-left: 6px;
  vertical-align: middle;
  cursor: help;
}

.sparkline-bar {
  width: 4px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.sparkline-bar:last-child {
  opacity: 1;
}

.sparkline-bar.ai {
  background: var(--accent-secondary);
}

.sparkline-bar:hover {
  opacity: 1;
}

/* ========================================
   Auto-Refresh Badge
   ======================================== */

.auto-refresh-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--success);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  animation: autoRefreshPulse 2s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes autoRefreshPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ========================================
   Focus Mode
   ======================================== */

html.focus-mode .sidebar {
  display: none !important;
}

html.focus-mode .main-content {
  margin-left: 0 !important;
  max-width: 100% !important;
}

html.focus-mode .content-header {
  padding-left: 24px;
}

/* ========================================
   Price Range Slider
   ======================================== */

.price-range-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.price-range-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.price-range-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: center;
  white-space: nowrap;
}

.price-range-slider {
  flex: 1;
  min-width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.price-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.price-range-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.price-range-reset {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.price-range-reset:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========================================
   Image Zoom on Hover (Table/List views)
   ======================================== */

.img-zoom-cell {
  position: relative;
}

.img-zoom-popup {
  display: none;
  position: absolute;
  z-index: 1000;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 4px;
  pointer-events: none;
  animation: zoomPopupFadeIn 150ms ease-out;
}

.img-zoom-popup img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 6px;
}

.img-zoom-cell:hover .img-zoom-popup {
  display: block;
}

@keyframes zoomPopupFadeIn {
  from { opacity: 0; transform: translateY(-50%) scale(0.9); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* ========================================
   Sticky Search Header
   ======================================== */

.search-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ========================================
   Dark Mode — Iteration 41
   ======================================== */

[data-theme="dark"] .price-range-slider {
  background: var(--border);
}

[data-theme="dark"] .price-range-slider::-webkit-slider-thumb {
  border-color: var(--bg-secondary);
}

[data-theme="dark"] .price-range-reset {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .img-zoom-popup {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Tab Count Badge
   ======================================== */

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: var(--primary);
  color: white;
  border-radius: 9px;
  margin-left: 6px;
  line-height: 1;
}

/* ========================================
   Collapsible Sidebar Sections
   ======================================== */

.collapsible-label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.collapsible-label::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(45deg);
  transition: transform 200ms ease;
  margin-left: 8px;
  flex-shrink: 0;
}

.collapsible-label.collapsed::after {
  transform: rotate(-45deg);
}

.collapsible-content {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 300ms ease, opacity 200ms ease;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* ========================================
   Card Focus Ring (J/K navigation)
   ======================================== */

.product-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.product-card:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   Dark Mode — Iteration 42
   ======================================== */

/* ========================================
   Card Three-Dot Menu Button
   ======================================== */

.card-menu-btn {
  position: absolute;
  top: 12px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
  z-index: 5;
}

.product-card:hover .card-menu-btn,
.product-card:focus-within .card-menu-btn {
  opacity: 1;
}

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

/* ========================================
   Responsive Sidebar (Mobile/Tablet)
   ======================================== */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 149;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 150;
    transition: left 300ms ease;
    box-shadow: none;
  }

  .sidebar.sidebar-open {
    left: 0;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .content-header {
    padding-left: 56px;
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }

  .results-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ========================================
   Dark Mode — Iteration 43
   ======================================== */

[data-theme="dark"] .card-menu-btn {
  background: rgba(30, 30, 30, 0.9);
}

[data-theme="dark"] .card-menu-btn:hover {
  background: rgba(40, 40, 40, 1);
}

[data-theme="dark"] .sidebar-toggle {
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Product Stats Summary Bar
   ======================================== */

.product-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  margin-bottom: 8px;
}

.stats-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: nowrap;
}

/* ========================================
   Copy cURL Button (API URL bar)
   ======================================== */

.api-url-curl-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
}

.api-url-curl-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ========================================
   Grid Density Modes
   ======================================== */

.product-grid[data-density="compact"] {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.product-grid[data-density="compact"] .product-card {
  font-size: 12px;
}

.product-grid[data-density="compact"] .product-image {
  height: 140px;
}

.product-grid[data-density="dense"] {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}

.product-grid[data-density="dense"] .product-card {
  font-size: 11px;
}

.product-grid[data-density="dense"] .product-image {
  height: 100px;
}

.product-grid[data-density="dense"] .product-info {
  padding: 6px;
}

.product-grid[data-density="dense"] .product-name {
  -webkit-line-clamp: 1;
}

/* ========================================
   Live Search Button
   ======================================== */

.live-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
  flex-shrink: 0;
}

.live-search-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.live-search-btn.active {
  color: var(--warning, #f59e0b);
  border-color: var(--warning, #f59e0b);
  background: rgba(245, 158, 11, 0.08);
}

/* ========================================
   Dark Mode — Iteration 45
   ======================================== */

[data-theme="dark"] .live-search-btn.active {
  background: rgba(245, 158, 11, 0.15);
}

.bypass-cache-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
  flex-shrink: 0;
  font-size: 10px;
}

.bypass-cache-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.bypass-cache-btn.active {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .bypass-cache-btn.active {
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================
   Latency Color Coding
   ======================================== */

.latency-pill.latency-fast {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: white !important;
}

.latency-pill.latency-medium {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: white !important;
}

.latency-pill.latency-slow {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
}

/* ========================================
   Toast Notification History Panel
   ======================================== */

.toast-history-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 320px;
  max-height: 400px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 300;
  display: flex;
  flex-direction: column;
  animation: tooltipFadeIn 150ms ease-out;
}

.toast-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.toast-history-close {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 4px;
}

.toast-history-close:hover {
  color: var(--text-primary);
}

.toast-history-list {
  overflow-y: auto;
  max-height: 340px;
  padding: 6px;
}

.toast-history-item {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light, var(--border));
}

.toast-history-item:last-child {
  border-bottom: none;
}

/* ========================================
   Dark Mode — Iteration 46
   ======================================== */

[data-theme="dark"] .toast-history-panel {
  background: var(--bg-secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ========================================
   AI Compare Panel
   ======================================== */

.ai-compare-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.ai-compare-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.ai-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-compare-panel {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 24px 24px 1.5rem;
}

.ai-compare-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text-secondary);
}

.ai-compare-best {
  background: var(--success-bg, #f0fdf4);
  border: 1px solid var(--success, #22c55e);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.ai-compare-best h3 {
  margin: 0 0 0.5rem;
  color: var(--success, #22c55e);
  font-size: 1rem;
  word-wrap: break-word;
}

.ai-compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  table-layout: fixed;
}

.ai-compare-table th,
.ai-compare-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: var(--font-size-sm);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.ai-compare-table th:first-child,
.ai-compare-table td:first-child {
  width: 20%;
}

.ai-compare-table th:nth-child(2),
.ai-compare-table td:nth-child(2) {
  width: 25%;
}

.ai-compare-table th:nth-child(3),
.ai-compare-table td:nth-child(3) {
  width: 55%;
}

.ai-compare-table th {
  font-weight: 600;
  color: var(--text-secondary);
}

.ai-compare-alt-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.ai-compare-alternatives {
  padding-bottom: 0.5rem;
}

.ai-compare-alt-card strong {
  color: var(--accent);
}

.ai-compare-error {
  color: var(--error, #ef4444);
  padding: 1rem;
}
