/* ═══════════════════════════════════════════════════════
   B2B Commerce Kit — Documentation Shared Stylesheet
   b2bcommercekit.com/b2bcommercekit
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@600;700&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --green-dark:   #0d5c38;
  --green-mid:    #17965f;
  --green-light:  #23ab70;
  --green-pale:   #e8f7f0;
  --ink:          #0f1a13;
  --ink-mid:      #3a4a40;
  --ink-light:    #6b7d72;
  --rule:         #dce8e1;
  --bg:           #f7faf8;
  --white:        #ffffff;
  --code-bg:      #eef4f0;
  --sidebar-w:    280px;
  --header-h:     64px;
  --radius:       8px;
  --shadow-sm:    0 1px 4px rgba(13,92,56,.08);
  --shadow-md:    0 4px 20px rgba(13,92,56,.12);
}

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-mid);
  background: var(--bg);
}

/* ── TOP HEADER ─────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 0;
  box-shadow: var(--shadow-sm);
}

/* Left: logo block */
.header-logo-block {
  display: flex; align-items: center;
  text-decoration: none;
  padding: 0 24px 0 20px;
  height: 100%;
  border-right: 1px solid var(--rule);
  flex-shrink: 0;
}
.header-logo-img {
  height: 34px; width: auto; display: block;
}
.header-title {
  font-family: 'Lora', serif; font-weight: 700;
  font-size: 15px; color: var(--ink); letter-spacing: -.2px;
  line-height: 1.2;
}
.header-title span { color: var(--green-mid); }
.header-title small {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400; font-size: 11px;
  color: var(--ink-light); letter-spacing: .2px;
  margin-top: 1px;
}

/* Centre: breadcrumb caption */
.header-breadcrumb {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  padding: 0 24px;
  font-size: 13px; color: var(--ink-light);
  overflow: hidden;
}
.header-breadcrumb a {
  color: var(--ink-light); text-decoration: none;
  white-space: nowrap;
  transition: color .12s;
}
.header-breadcrumb a:hover { color: var(--green-mid); }
.breadcrumb-sep { opacity: .5; font-size: 12px; }
.breadcrumb-current {
  color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

/* Right: actions */
.header-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 0 16px;
  height: 100%;
  border-left: 1px solid var(--rule);
  flex-shrink: 0;
}
.header-version {
  font-family: 'DM Mono', monospace; font-size: 11.5px;
  color: var(--green-mid); background: var(--green-pale);
  padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
}
.header-home-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius);
  background: var(--green-dark); color: #fff;
  font-size: 12.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.header-home-btn:hover { background: var(--green-mid); }
.header-home-btn svg { width: 12px; height: 12px; }

/* ── LAYOUT ─────────────────────────────────────────── */
.docs-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--rule);
  padding: 20px 0 60px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

/* Sidebar back link */
.sidebar-back {
  display: flex; align-items: center; gap: 7px;
  margin: 0 16px 16px;
  padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; color: var(--ink-mid);
  text-decoration: none; transition: all .12s;
}
.sidebar-back:hover { border-color: var(--green-light); color: var(--green-dark); background: var(--green-pale); }
.sidebar-back svg { width: 13px; height: 13px; flex-shrink: 0; }

.sidebar-search { margin: 0 16px 16px; position: relative; }
.sidebar-search input {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  color: var(--ink); background: var(--bg);
  outline: none; transition: border-color .15s;
}
.sidebar-search input:focus { border-color: var(--green-light); }
.sidebar-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--ink-light);
}

.nav-group { margin-bottom: 4px; }
.nav-group-label {
  display: block; padding: 6px 20px 4px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-light);
}
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px; font-size: 13.5px; font-weight: 400;
  color: var(--ink-mid); text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .12s; line-height: 1.3;
}
.nav-link:hover { color: var(--green-dark); background: var(--green-pale); }
.nav-link.active {
  color: var(--green-dark); font-weight: 600;
  background: var(--green-pale);
  border-left-color: var(--green-light);
}
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rule); flex-shrink: 0;
  transition: background .12s;
}
.nav-link:hover .nav-dot,
.nav-link.active .nav-dot { background: var(--green-light); }
.nav-new {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--green-mid);
  background: var(--green-pale); border: 1px solid #b2e4cc;
  padding: 1px 5px; border-radius: 3px; margin-left: auto;
}

/* ── MAIN CONTENT ───────────────────────────────────── */
.docs-main {
  flex: 1; min-width: 0;
  padding: 56px 64px 100px;
  max-width: 900px;
}

/* ── HERO (index page) ──────────────────────────────── */
.docs-hero {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.docs-hero-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 11px;
  font-weight: 500; color: var(--green-mid);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 12px;
}
.docs-hero h1 {
  font-family: 'Lora', serif; font-weight: 700;
  font-size: 36px; line-height: 1.2; color: var(--ink);
  letter-spacing: -.5px; margin-bottom: 16px;
}
.docs-hero p {
  font-size: 16px; color: var(--ink-light);
  max-width: 580px; line-height: 1.65;
}

/* ── PAGE HERO (detail pages) ───────────────────────── */
.page-hero {
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.page-hero-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.page-hero-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 10.5px;
  font-weight: 500; color: var(--green-mid);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.page-hero-badge {
  font-family: 'DM Mono', monospace; font-size: 10px;
  background: var(--green-pale); color: var(--green-dark);
  border: 1px solid #b2e4cc; padding: 2px 8px; border-radius: 12px;
  font-weight: 600;
}
.page-hero-new {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: #d97706;
  background: #fffbeb; border: 1px solid #fde68a;
  padding: 2px 7px; border-radius: 10px;
}
.page-hero h1 {
  font-family: 'Lora', serif; font-weight: 700;
  font-size: 32px; line-height: 1.25; color: var(--ink);
  letter-spacing: -.4px; margin-bottom: 14px;
}
.page-hero-desc {
  font-size: 16px; color: var(--ink-light);
  max-width: 600px; line-height: 1.65;
}
.page-hero-links {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px;
}

/* ── QUICK LINKS GRID (index) ───────────────────────── */
.quick-links {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 64px;
}
.quick-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px;
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius); text-decoration: none;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.quick-card:hover {
  border-color: var(--green-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.quick-card-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.quick-card-icon svg { width: 16px; height: 16px; color: var(--green-dark); }
.quick-card-title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.quick-card-desc { font-size: 12px; color: var(--ink-light); line-height: 1.4; }

/* ── DOC SECTIONS ───────────────────────────────────── */
.doc-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.section-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 10px;
  font-weight: 500; color: var(--green-mid);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 8px;
}
.doc-section h2 {
  font-family: 'Lora', serif; font-weight: 700;
  font-size: 24px; color: var(--ink); letter-spacing: -.3px;
  margin-bottom: 8px; line-height: 1.3;
  display: flex; align-items: center; gap: 10px;
}
.doc-section h2 .anchor-link {
  opacity: 0; font-size: 16px; color: var(--green-light);
  text-decoration: none; transition: opacity .15s;
}
.doc-section h2:hover .anchor-link { opacity: 1; }
.section-divider {
  width: 40px; height: 3px; background: var(--green-light);
  border-radius: 2px; margin-bottom: 20px;
}
/* ── USE CASES SECTION ──────────────────────────────── */
.doc-section h3 {
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  font-size: 17px; color: var(--ink);
  margin: 36px 0 10px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
}
.doc-section h3:first-of-type { border-top: none; margin-top: 24px; }
.doc-section p { margin-bottom: 14px; color: var(--ink-mid); }
.doc-section p + .doc-link { margin-bottom: 28px; }

/* ── FEATURE CARDS (detail pages) ───────────────────── */
.feature-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin: 24px 0;
}
.feature-card {
  padding: 18px 20px;
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius);
  border-top: 3px solid var(--green-light);
}
.feature-card h4 {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  margin-bottom: 6px;
}
.feature-card p { font-size: 13px; color: var(--ink-light); margin: 0; line-height: 1.55; }

/* ── STEPS ──────────────────────────────────────────── */
.steps { list-style: none; margin: 20px 0; }
.steps li {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 20px;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-dark); color: #fff;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.step-body h4 { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.step-body p { font-size: 13.5px; color: var(--ink-mid); margin: 0; line-height: 1.6; }

/* ── SETTINGS TABLE ─────────────────────────────────── */
.settings-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; margin: 20px 0;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--rule);
}
.settings-table th {
  background: var(--ink); color: #fff; padding: 10px 16px;
  font-weight: 600; text-align: left; font-size: 12px;
  letter-spacing: .3px; text-transform: uppercase;
}
.settings-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.settings-table tr:last-child td { border-bottom: none; }
.settings-table tr:nth-child(even) td { background: var(--bg); }
.settings-table code {
  font-family: 'DM Mono', monospace; font-size: 11.5px;
  background: var(--code-bg); padding: 1px 5px; border-radius: 3px;
  color: var(--green-dark);
}

/* ── REQ TABLE ──────────────────────────────────────── */
.req-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; margin: 20px 0;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--rule);
}
.req-table th {
  background: var(--ink); color: #fff; padding: 10px 16px;
  font-weight: 600; text-align: left; font-size: 12px;
  letter-spacing: .3px; text-transform: uppercase;
}
.req-table td { padding: 10px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.req-table tr:last-child td { border-bottom: none; }
.req-table tr:nth-child(even) td { background: var(--bg); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-green { background: var(--green-pale); color: var(--green-dark); }
.pill-orange { background: #fff4e6; color: #b35900; }

/* ── MODULE GRID ────────────────────────────────────── */
.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
.module-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius); text-decoration: none;
  transition: all .13s;
}
.module-card:hover { border-color: var(--green-light); background: var(--green-pale); transform: translateY(-1px); }
.module-num {
  font-family: 'DM Mono', monospace; font-size: 11px;
  font-weight: 500; color: var(--green-mid);
  background: var(--green-pale); padding: 3px 7px;
  border-radius: 4px; flex-shrink: 0; margin-top: 1px;
}
.module-info { min-width: 0; }
.module-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 2px; }
.module-desc { font-size: 12px; color: var(--ink-light); line-height: 1.4; }
.module-new {
  font-size: 9px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--green-mid);
  background: var(--green-pale); border: 1px solid #b2e4cc;
  padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle;
}

/* ── FAQ ACCORDION ──────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.faq-item {
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s;
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-item.open { border-color: #b2e4cc; box-shadow: var(--shadow-sm); }
.faq-q {
  width: 100%; display: flex; align-items: flex-start;
  gap: 14px; padding: 16px 20px;
  background: none; border: none; cursor: pointer;
  text-align: left; font-family: 'DM Sans', sans-serif;
  transition: background .12s;
}
.faq-q:hover { background: var(--green-pale); }
.faq-item.open .faq-q { background: var(--green-pale); }
.faq-q-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-pale); border: 1.5px solid #b2e4cc;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px; transition: all .2s;
}
.faq-item.open .faq-q-icon { background: var(--green-light); border-color: var(--green-light); }
.faq-q-icon svg { width: 10px; height: 10px; color: var(--green-dark); transition: transform .2s; }
.faq-item.open .faq-q-icon svg { color: #fff; transform: rotate(45deg); }
.faq-q-text { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.45; flex: 1; }
.faq-a { display: none; padding: 0 20px 18px 54px; font-size: 13.5px; color: var(--ink-mid); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }
.faq-a p { margin-bottom: 8px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a ul { padding-left: 18px; margin-bottom: 8px; }
.faq-a ul li { margin-bottom: 4px; }
.faq-a code {
  font-family: 'DM Mono', monospace; font-size: 12px;
  background: var(--code-bg); padding: 1px 5px; border-radius: 3px;
  color: var(--green-dark);
}

/* ── CALLOUT ────────────────────────────────────────── */
.callout {
  padding: 14px 18px; border-radius: var(--radius);
  margin: 20px 0; font-size: 13.5px; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.callout-info { background: #eef7ff; border-left: 3px solid #4faee8; color: #1a3d5c; }
.callout-tip { background: var(--green-pale); border-left: 3px solid var(--green-light); color: var(--green-dark); }
.callout-warn { background: #fffbeb; border-left: 3px solid #f59e0b; color: #78350f; }
.callout svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.callout strong { font-weight: 600; }

/* ── DOC LINKS ──────────────────────────────────────── */
.doc-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 9px 16px;
  background: var(--green-dark); color: #fff;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius); text-decoration: none;
  transition: background .15s;
}
.doc-link:hover { background: var(--green-mid); }
.doc-link svg { width: 13px; height: 13px; }
.doc-link-ghost {
  background: none; color: var(--green-dark);
  border: 1.5px solid var(--green-dark); margin-left: 8px;
}
.doc-link-ghost:hover { background: var(--green-pale); }

/* ── PREV/NEXT NAV (detail pages) ───────────────────── */
.page-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 60px; padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.page-nav-btn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--rule);
  text-decoration: none; flex: 1; max-width: 240px;
  transition: all .15s;
}
.page-nav-btn:hover { border-color: var(--green-light); box-shadow: var(--shadow-md); }
.page-nav-btn.next { text-align: right; margin-left: auto; }
.page-nav-label { font-size: 11px; color: var(--ink-light); text-transform: uppercase; letter-spacing: .5px; }
.page-nav-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) { .docs-main { padding: 40px 32px 80px; } }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .header-breadcrumb { display: none; }
}
@media (max-width: 600px) {
  .docs-main { padding: 28px 18px 60px; }
  .quick-links { grid-template-columns: 1fr; }
  .docs-hero h1 { font-size: 26px; }
  .page-hero h1 { font-size: 24px; }
  .header-actions { gap: 6px; padding: 0 12px; }
  .header-home-btn span { display: none; }
  .header-logo-img { height: 26px; }
}
