:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #334155;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}

.badge-a2a {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

nav a:hover, nav a.active {
  color: #fff;
  background-color: var(--border);
}

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

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  width: 260px;
  transition: border-color 0.2s;
}

.search-form:focus-within {
  border-color: var(--accent);
}

.search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.search-input::placeholder {
  color: #64748b;
}

/* Category Filter Bar */
.filter-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-chip:hover {
  border-color: #475569;
  color: #fff;
}

.category-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #e2e8f0;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.825rem;
  outline: none;
}

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

.star-rating {
  color: #f59e0b;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.star-rating span.reviews-count {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.product-link {
  color: inherit;
  text-decoration: none;
}

.product-link:hover .product-title {
  color: var(--accent);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
}

/* Banner / Hero */
.hero {
  text-align: center;
  padding: 2.25rem 1rem;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 70%);
  border-radius: 1rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.hook-callout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  color: #38bdf8;
}

/* Grid & Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #334155;
}

.stock-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
}

.stock-in {
  background-color: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.stock-out {
  background-color: rgba(239, 68, 68, 0.9);
  color: #fff;
}

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

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

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

.features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.feature-pill {
  font-size: 0.7rem;
  background-color: #334155;
  color: #cbd5e1;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.btn {
  background-color: var(--accent);
  color: #0f172a;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

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

.btn-secondary {
  background-color: #334155;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #475569;
}

/* Inspector Layout */
.inspector-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  min-height: 80vh;
}

.sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

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

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--success);
}

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

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.session-list {
  list-style: none;
  overflow-y: auto;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-item {
  background-color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-item:hover, .session-item.active {
  border-color: var(--accent);
  background-color: #1a233a;
}

.session-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.session-query {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-y: auto;
}

.section-box {
  background-color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.section-box h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

pre {
  background-color: #050b14;
  border: 1px solid #1e293b;
  padding: 0.75rem;
  border-radius: 0.375rem;
  color: #38bdf8;
  font-size: 0.8rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background-color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
}

.tab-badge {
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.tab-btn.active .tab-badge {
  background: var(--accent);
  color: #fff;
}

/* Traffic Activity Table */
.traffic-table-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.traffic-table th {
  background-color: #0f172a;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.traffic-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}

.traffic-table tr:hover td {
  background-color: rgba(30, 41, 59, 0.5);
}

.badge-method {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-weight: 700;
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
}

.badge-method.GET { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-method.POST { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-method.PUT { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-method.DELETE { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.badge-status {
  font-weight: 700;
  font-family: ui-monospace, monospace;
}
.badge-status.s-2xx { color: #22c55e; }
.badge-status.s-3xx { color: #38bdf8; }
.badge-status.s-4xx { color: #f97316; }
.badge-status.s-5xx { color: #ef4444; }

.badge-event {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-event.AGENT_DISCOVERY { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-event.CATALOG_SEARCH { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.badge-event.CONCIERGE_NEGOTIATION { background: rgba(34, 197, 94, 0.2); color: #4ade80; font-weight: 700; }
.badge-event.RESERVATION { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge-event.PAGE_VISIT { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-event.ASSET { background: rgba(71, 85, 105, 0.2); color: #64748b; }

/* -------------------------------------------------------------
   Screen-Reader & Autonomous Machine Agent Invisible Directives
   (Invisible to human shoppers, readable by LLM / DOM scrapers)
------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* -------------------------------------------------------------
   Interactive Shopping Cart & Sliding Drawer Styles
------------------------------------------------------------- */
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

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

.cart-badge {
  background: var(--accent);
  color: #0f172a;
  font-size: 0.725rem;
  font-weight: 800;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cart Drawer Backdrop */
.cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Sliding Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #1e293b;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
}

.cart-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.2s;
}

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

.cart-price-hold-banner {
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.75rem 1.5rem;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 4rem 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #0f172a;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.3;
}

.cart-item-sku {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.cart-item-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.cart-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qty-value {
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.cart-item-remove:hover {
  text-decoration: underline;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
}

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

.cart-summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

.btn-checkout {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-clear-cart {
  width: 100%;
  margin-top: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
}

.btn-clear-cart:hover {
  color: #ef4444;
}

/* Toast Notifications */
.cart-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--accent);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.cart-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Checkout Modal Overlay */
.checkout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.checkout-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.checkout-modal-box {
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  width: 480px;
  max-width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.checkout-receipt {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.2rem;
}

.checkout-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkout-receipt-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

