/* 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 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-primary);
  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-primary);
}

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

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

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-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-card);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  color: var(--text-primary);
  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-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-card);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

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

.mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.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-card);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  color: var(--text-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-primary);
}

.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-card);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  color: var(--text-primary);
  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-dark);
  text-align: center;
}

.powered-by {
  font-size: 11px;
  color: var(--text-muted);
  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-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-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;
}

.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;
}

.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);
}

.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;
}

/* 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);
}

/* 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-json-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  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;
}

.product-card:hover .product-json-icon {
  opacity: 1;
  transform: scale(1);
}

.product-json-icon:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.product-json-icon:active {
  transform: scale(0.95);
}

.product-json-icon svg {
  width: 18px;
  height: 18px;
}

.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);
}

/* PDP Content */
.pdp-content {
  max-height: 90vh;
  overflow-y: auto;
  padding: 60px 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 {
  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 {
  position: absolute;
  top: 16px;
  right: 68px;
  z-index: 11;
  display: flex;
  gap: 4px;
  background: var(--bg-main);
  padding: 4px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.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;
  }

  .product-json-icon {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
    /* Always visible on mobile (no hover state) */
    opacity: 1;
    transform: scale(1);
  }

  .product-json-icon svg {
    width: 16px;
    height: 16px;
  }

  .pdp-view-toggle {
    right: 12px;
    top: 68px;
    flex-direction: column;
  }

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

  .pdp-content {
    padding: 120px 16px 16px 16px;
  }

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

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

/* View Mode Tabs */
.view-mode-tabs {
  display: flex;
  background: var(--bg-card);
  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-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.view-mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.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;
  justify-content: space-between;
  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-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;
}

/* 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;
}

/* 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;
  }
}
