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

:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #EFF6FF;
  --blue-mid: #DBEAFE;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --orange: #EA580C;
  --orange-light: #FFF7ED;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text { font-size: 17px; font-weight: 600; color: var(--gray-900); }
.logo-accent { color: var(--blue); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 7px 14px; border-radius: 7px; text-decoration: none;
  color: var(--gray-600); font-size: 14px; font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.header-badge { display: flex; gap: 8px; }
.badge {
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-staging { background: var(--orange-light); color: var(--orange); }
.badge-partner { background: var(--blue-light); color: var(--blue); }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #1D4ED8 100%);
  color: white; padding: 80px 0 60px;
}
.hero-title {
  font-size: 48px; font-weight: 700; line-height: 1.15;
  margin-bottom: 20px;
}
.hero-accent { color: #60A5FA; }
.hero-subtitle {
  font-size: 18px; color: #CBD5E1; max-width: 600px;
  margin-bottom: 40px; line-height: 1.7;
}
.hero-stats {
  display: flex; gap: 24px; margin-bottom: 40px;
}
.stat-card {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius); padding: 20px 28px; text-align: center;
  backdrop-filter: blur(10px);
}
.stat-value { font-size: 32px; font-weight: 700; color: #60A5FA; }
.stat-label { font-size: 13px; color: #94A3B8; margin-top: 4px; }
.hero-actions { display: flex; gap: 12px; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none; transition: all 0.15s;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }

/* ─── Sections ──────────────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--gray-50); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-title { font-size: 32px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.section-subtitle { font-size: 16px; color: var(--gray-500); }
.section-subtitle code {
  background: var(--gray-100); padding: 2px 8px; border-radius: 5px;
  font-size: 13px; color: var(--blue);
}

/* ─── Capabilities ──────────────────────────────────────────────────────────── */
.capabilities { padding: 72px 0; background: var(--gray-50); }
.capabilities-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.cap-card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 28px; transition: all 0.2s;
}
.cap-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cap-icon { font-size: 32px; margin-bottom: 14px; }
.cap-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--gray-900); }
.cap-card p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* ─── Services ──────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 28px;
}
.search-input {
  flex: 1; padding: 11px 16px; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--blue); }
.select-input {
  padding: 11px 16px; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 14px; background: white; outline: none; cursor: pointer;
  min-width: 200px;
}
.select-input:focus { border-color: var(--blue); }
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.service-card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px; transition: all 0.15s;
}
.service-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.service-name { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 6px; }
.service-category {
  display: inline-block; background: var(--blue-light); color: var(--blue);
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  margin-bottom: 8px;
}
.service-abilities { font-size: 12px; color: var(--gray-500); }
.service-id { font-size: 11px; color: var(--gray-400); margin-top: 6px; }
.services-meta { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 14px; }

/* ─── Shop Finder ───────────────────────────────────────────────────────────── */
.finder-form { margin-bottom: 28px; }
.card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-input {
  padding: 9px 13px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  font-size: 14px; outline: none; transition: border-color 0.15s; background: white;
  font-family: inherit;
}
.form-input:focus { border-color: var(--blue); }
.form-input-readonly { background: var(--gray-50); color: var(--gray-600); }
textarea.form-input { resize: vertical; }
.shops-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px;
}
.shop-card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 20px; transition: all 0.15s; cursor: pointer;
}
.shop-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); }
.shop-name { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 6px; }
.shop-address { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.shop-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.shop-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gray-100); padding: 4px 10px; border-radius: 20px;
  font-size: 12px; color: var(--gray-600); font-weight: 500;
}
.shop-tag.green { background: var(--green-light); color: var(--green); }
.shop-tag.blue { background: var(--blue-light); color: var(--blue); }
.shop-hours { margin-top: 12px; font-size: 12px; color: var(--gray-500); }
.shop-actions { margin-top: 14px; display: flex; gap: 8px; }
.shop-phone { font-size: 13px; color: var(--blue); font-weight: 500; }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content {
  position: relative; background: white; border-radius: 14px; padding: 32px;
  max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; background: var(--gray-100);
  border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--gray-200); }

/* ─── Workflow ──────────────────────────────────────────────────────────────── */
.workflow-steps { display: flex; flex-direction: column; gap: 16px; }
.workflow-step {
  background: white; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.2s;
}
.workflow-step.locked { opacity: 0.6; }
.workflow-step.active { border-color: var(--blue); }
.workflow-step.completed { border-color: var(--green); }
.step-header {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
.workflow-step.active .step-header { background: var(--blue-light); }
.workflow-step.completed .step-header { background: var(--green-light); }
.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: white; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.workflow-step.completed .step-number { background: var(--green); }
.step-info { flex: 1; }
.step-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.endpoint { font-size: 12px; color: var(--blue); background: var(--blue-light); padding: 2px 8px; border-radius: 4px; }
.step-status { font-size: 13px; font-weight: 500; }
.step-body { padding: 24px; }
.step-note { color: var(--gray-500); font-size: 14px; margin-bottom: 16px; }
.step-result {
  margin-top: 16px; padding: 16px; background: var(--gray-50); border-radius: 8px;
  border-left: 3px solid var(--blue);
}
.step-result.success { border-left-color: var(--green); background: var(--green-light); }
.step-result.error { border-left-color: #DC2626; background: #FEF2F2; }
.step-result pre { font-size: 12px; overflow-x: auto; white-space: pre-wrap; }

/* ─── Timeslots ─────────────────────────────────────────────────────────────── */
.shop-select-list { margin-top: 16px; }
.shop-select-item {
  padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.shop-select-item:hover { border-color: var(--blue); background: var(--blue-light); }
.shop-select-item.selected { border-color: var(--blue); background: var(--blue-light); }
.timeslots-title { font-size: 15px; font-weight: 600; margin: 20px 0 12px; }
.timeslot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.timeslot-day { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-top: 8px; }
.timeslot-btn {
  padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  background: white; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all 0.15s; text-align: center;
}
.timeslot-btn:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.timeslot-btn.selected { border-color: var(--blue); background: var(--blue); color: white; }

/* ─── API Explorer ──────────────────────────────────────────────────────────── */
.explorer-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.explorer-sidebar {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 20px; height: fit-content;
}
.sidebar-title { font-size: 13px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.endpoint-group { margin-bottom: 20px; }
.endpoint-group-title { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.endpoint-btn {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: 1px solid var(--gray-200); border-radius: 6px; background: white;
  font-size: 13px; cursor: pointer; margin-bottom: 4px; transition: all 0.15s;
  color: var(--gray-700);
}
.endpoint-btn:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.explorer-main { display: flex; flex-direction: column; gap: 16px; }
.explorer-request {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 24px;
}
.request-line { display: flex; gap: 10px; margin-bottom: 16px; }
.method-select {
  padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  font-size: 13px; font-weight: 600; background: white; cursor: pointer; min-width: 90px;
}
.endpoint-input {
  flex: 1; padding: 9px 13px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  font-size: 13px; font-family: 'Courier New', monospace; outline: none;
}
.endpoint-input:focus { border-color: var(--blue); }
.code-editor {
  width: 100%; padding: 12px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  font-family: 'Courier New', monospace; font-size: 13px; outline: none;
  resize: vertical; background: var(--gray-50);
}
.code-editor:focus { border-color: var(--blue); }
.request-body-section { margin-bottom: 16px; }
.explorer-response {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden;
}
.response-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
.response-label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.response-status { font-size: 13px; font-weight: 600; }
.response-status.ok { color: var(--green); }
.response-status.err { color: #DC2626; }
.response-body {
  padding: 20px; font-size: 12px; font-family: 'Courier New', monospace;
  white-space: pre-wrap; overflow-x: auto; max-height: 400px; overflow-y: auto;
  line-height: 1.6;
}

/* ─── Loading & Empty States ────────────────────────────────────────────────── */
.loading-state {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 48px; color: var(--gray-500);
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--gray-200);
  border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center; padding: 48px; color: var(--gray-500); font-size: 15px;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-brand strong { color: white; display: block; margin-bottom: 4px; }
.footer-brand p { font-size: 13px; }
.footer-links { display: flex; gap: 20px; }
.footer-link { color: var(--gray-400); text-decoration: none; font-size: 14px; }
.footer-link:hover { color: white; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: 32px; }
  .hero-stats { flex-wrap: wrap; }
  .capabilities-grid { grid-template-columns: 1fr; }
  .explorer-layout { grid-template-columns: 1fr; }
  .nav { display: none; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}
