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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #283548;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: #374151;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.nav-center {
  flex: 1;
  max-width: 540px;
}

.search-bar {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 1rem 0.65rem 2.75rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agent-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.5; transform: scale(0.9); }
}

.cart-button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cart-button:hover {
  background: var(--bg-card-hover);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-cyan);
  color: #0b0f19;
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Container Layout */
.main-container {
  max-width: 1700px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-block h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.category-list li {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.category-list li:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.category-list li.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-block input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.agent-tip-card {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 1rem;
  border-radius: 0.5rem;
}

.agent-tip-card h4 {
  font-size: 0.85rem;
  color: var(--accent-purple);
  margin-bottom: 0.4rem;
}

.agent-tip-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.agent-tip-card code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  color: #fff;
}

/* Catalog Section */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.catalog-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.catalog-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-selector select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  outline: none;
  font-size: 0.85rem;
}

/* Agent Toast Banner */
.agent-toast-banner {
  background: linear-gradient(90deg, #1e1b4b, #111827);
  border: 1px solid var(--accent-cyan);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideDown 0.3s ease-out;
}

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

.agent-icon {
  font-size: 1.25rem;
}

.agent-message {
  font-size: 0.85rem;
  color: #e0e7ff;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #4b5563;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.product-card.highlighted-by-agent {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35) !important;
  animation: highlightGlow 2s infinite alternate;
}

@keyframes highlightGlow {
  from { box-shadow: 0 0 10px rgba(6, 182, 212, 0.2); }
  to { box-shadow: 0 0 22px rgba(6, 182, 212, 0.5); }
}

.product-image {
  height: 170px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  user-select: none;
}

.product-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(11, 15, 25, 0.85);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.add-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.add-btn:hover {
  background: var(--accent-cyan);
  color: #0b0f19;
  border-color: var(--accent-cyan);
}

/* WebMCP Inspector Panel */
.webmcp-inspector {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: calc(100vh - 120px);
  position: sticky;
  top: 5rem;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.inspector-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
}

.spec-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: #1e293b;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.section-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.registered-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
}

.tool-chip {
  background: var(--bg-card);
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-chip .status {
  color: var(--accent-emerald);
  font-size: 0.7rem;
}

.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.clear-log {
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 0.7rem;
}

.sim-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sim-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.sim-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.sim-btn.reset {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.sim-btn.reset:hover {
  background: rgba(248, 113, 113, 0.15);
}

.flex-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.telemetry-log {
  background: #060911;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #94a3b8;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry.system { color: #64748b; }
.log-entry.call { color: var(--accent-cyan); }
.log-entry.result { color: var(--accent-emerald); }
.log-entry.warn { color: #fbbf24; }

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: absolute;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease-in-out;
}

.cart-drawer-overlay.open .cart-drawer {
  right: 0;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

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

.cart-item-title {
  font-weight: 600;
}

.cart-item-price {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.cart-item-remove {
  color: #ef4444;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
}

.empty-cart-msg {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 3rem;
}

.cart-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.coupon-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coupon-box input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
}

.coupon-box button {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.summary-line.discount {
  color: var(--accent-emerald);
}

.summary-line.total {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  border-top: 1px solid #374151;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #0b0f19;
  font-weight: 700;
  border: none;
  padding: 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-top: 1rem;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.checkout-btn:hover {
  opacity: 0.9;
}

@media (max-width: 1100px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  .sidebar, .webmcp-inspector {
    position: static;
    height: auto;
  }
}

/* Floating Agent Dock Bar */
.agent-dock-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 1100px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(6, 182, 212, 0.2);
  border-radius: 1rem;
  padding: 0.85rem 1.25rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: slideUp 0.4s ease-out;
}

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

.dock-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.dock-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--accent-cyan);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.dock-pulse {
  width: 7px;
  height: 7px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1.5s infinite;
}

.dock-input-wrap {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  min-width: 280px;
}

.dock-input-wrap input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  outline: none;
}

.dock-input-wrap input:focus {
  border-color: var(--accent-cyan);
}

.dock-run-btn {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #0b0f19;
  border: none;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.dock-run-btn:hover {
  opacity: 0.9;
}

.dock-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.preset-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-pill {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-pill:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

/* Synergy Badges on Product Cards */
.synergy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* High-Resolution Product Photography */
.product-image-container {
  height: 190px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0d131f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.product-real-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s ease;
  display: block;
}

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

.cart-thumb-img {
  width: 44px;
  height: 44px;
  border-radius: 0.35rem;
  object-fit: cover;
  border: 1px solid #374151;
}
