/* API Loja Mestre — documentação */
:root {
  --brand: #255096;
  --brand-2: #1fbbeb;
  --brand-3: #319ddb;
  --brand-ink: #122a52;

  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --border: #e3e8ef;
  --border-strong: #cfd8e5;
  --text: #1b2430;
  --muted: #5b6b7f;
  --link: #255096;
  --accent: #1fbbeb;

  --code-bg: #0f1c33;
  --code-head: #142543;
  --code-text: #e6edf5;
  --code-border: #223a5e;

  --sidebar-bg: linear-gradient(190deg, #122a52 0%, #1c3d73 55%, #255096 100%);
  --sidebar-text: #dbe7f7;
  --sidebar-muted: #8ba7ce;
  --sidebar-hover: rgba(255, 255, 255, .08);
  --sidebar-active: rgba(31, 187, 235, .18);

  --ok: #14804a;
  --ok-bg: #e6f6ee;
  --req: #b4232a;
  --req-bg: #fdecec;
  --warn-bg: #fff8e6;
  --warn-border: #f2d98c;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 8px 24px rgba(16, 30, 54, .06);
  --sidebar-w: 292px;
  --examples-w: 400px;
  --topbar-h: 58px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0c1424;
  --bg-soft: #0f1a2e;
  --panel: #101c31;
  --panel-2: #0e1829;
  --border: #1f2d47;
  --border-strong: #2b3d5d;
  --text: #e6edf5;
  --muted: #93a3b8;
  --link: #6fc6f2;

  --code-bg: #0a1220;
  --code-head: #0d1830;
  --code-text: #dbe7f7;
  --code-border: #223352;

  --ok: #4fd18b;
  --ok-bg: #102b1f;
  --req: #ff8a8a;
  --req-bg: #2c1416;
  --warn-bg: #2a2410;
  --warn-border: #5c4a1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
code, kbd, pre { font-family: var(--mono); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- layout ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 60;
}
.sidebar-brand { padding: 20px 20px 12px; position: relative; }
.sidebar-close {
  display: none; position: absolute; top: 16px; right: 14px;
  width: 34px; height: 34px; border-radius: 8px; font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .16);
}
.brand-link { display: flex; flex-direction: column; gap: 6px; color: #fff; }
.brand-link:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; align-self: flex-start; }
.brand-sub { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--sidebar-muted); }

.sidebar-search { position: relative; margin: 6px 16px 14px; }
.sidebar-search input {
  width: 100%; padding: 9px 34px 9px 34px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .09); color: #fff; font-size: 14px;
  outline: none;
}
.sidebar-search input::placeholder { color: var(--sidebar-muted); }
.sidebar-search input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .14); }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--sidebar-muted); display: flex; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--sidebar-muted); font-size: 18px; line-height: 1; padding: 4px;
}
.search-clear:hover { color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 10px 16px; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }

.nav-group { margin-bottom: 4px; }
.nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--sidebar-muted);
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--sidebar-hover); color: #fff; }
.nav-group > summary .chev { margin-left: auto; transition: transform .18s ease; display: flex; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group .count { font-weight: 600; color: var(--sidebar-muted); font-size: 11px; }

.nav-list { list-style: none; margin: 2px 0 6px; padding: 0; }
.nav-list a {
  display: flex; align-items: baseline; gap: 9px;
  padding: 7px 10px 7px 16px; margin: 1px 0;
  border-radius: 8px; color: var(--sidebar-text); font-size: 14px;
}
.nav-list a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-list a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav-list .code {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  color: var(--accent); background: rgba(31, 187, 235, .12);
  padding: 1px 6px; border-radius: 5px; flex: 0 0 auto;
}
.nav-list a.active .code { background: rgba(31, 187, 235, .28); }
.nav-list .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-empty { padding: 18px 14px; color: var(--sidebar-muted); font-size: 13.5px; }

.sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; font-size: 12px; color: var(--sidebar-muted);
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-footer .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.wrapper { margin-left: var(--sidebar-w); }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-toggle { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-link { font-size: 13.5px; color: var(--muted); }
.topbar-link:hover { color: var(--link); text-decoration: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
#theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] #theme-toggle .icon-sun { display: block; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) var(--examples-w); align-items: start; }

.content { min-width: 0; padding: 34px 44px 90px; max-width: 900px; }
.content:focus { outline: none; }

.examples {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 34px 28px 60px; border-left: 1px solid var(--border);
  background: var(--bg-soft);
}
.examples-inline { display: none; }

/* ---------- content typography ---------- */
.doc h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; }
.doc h2 { font-size: 21px; margin: 38px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.doc h3 { font-size: 16.5px; margin: 26px 0 8px; }
.doc p { margin: 12px 0; }
.doc .lead { font-size: 16.5px; color: var(--muted); margin-top: 0; }
.doc ul, .doc ol { margin: 12px 0; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc strong { font-weight: 650; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
.doc :not(pre) > code {
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; font-size: 13px;
}

.page-head { margin-bottom: 8px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong);
  color: var(--muted); background: var(--panel-2);
}
.badge.method { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge.code { font-family: var(--mono); color: var(--brand); background: rgba(31, 187, 235, .12); border-color: rgba(31, 187, 235, .35); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.params { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.params th, table.params td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.params thead th { background: var(--panel-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.params tbody tr:last-child td { border-bottom: 0; }
table.params td.name { font-family: var(--mono); font-weight: 650; color: var(--text); white-space: nowrap; }
table.params td.type { color: var(--muted); font-size: 13px; white-space: nowrap; }
table.params td.req .tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
table.params .yes { color: var(--req); background: var(--req-bg); }
table.params .no { color: var(--muted); background: var(--panel-2); }

/* ---------- code blocks ---------- */
.code {
  position: relative; margin: 16px 0;
  border: 1px solid var(--code-border); border-radius: var(--radius);
  background: var(--code-bg); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--code-head);
  border-bottom: 1px solid var(--code-border);
}
.code-head .name { font-size: 12.5px; font-weight: 650; color: #9fc3ee; letter-spacing: .03em; }
.copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #cfe0f7;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  padding: 4px 9px; border-radius: 6px;
}
.copy-btn:hover { background: rgba(255, 255, 255, .14); }
.copy-btn.done { color: #7ef0b0; border-color: rgba(126, 240, 176, .4); }
.code pre { margin: 0; padding: 15px 16px; overflow: auto; font-size: 12.8px; line-height: 1.65; color: var(--code-text); }
.code pre code { background: none; padding: 0; border: 0; }
.code.scroll pre { max-height: 460px; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 0; background: var(--code-head); border-bottom: 1px solid var(--code-border); }
.tab {
  border: 0; background: transparent; color: #9fc3ee;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
  border-radius: 7px 7px 0 0; border-bottom: 2px solid transparent;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tab.active { color: #fff; border-bottom-color: var(--accent); background: var(--code-bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* callouts */
.callout {
  display: flex; gap: 12px; margin: 18px 0; padding: 13px 15px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel-2);
}
.callout .ci { flex: 0 0 auto; margin-top: 1px; }
.callout p { margin: 0; }
.callout .ct { font-weight: 650; display: block; margin-bottom: 2px; }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.callout.ok { background: var(--ok-bg); border-color: transparent; }

/* ---------- examples panel ---------- */
.ex-title { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.ex-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ex-tab {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
}
.ex-tab:hover { border-color: var(--border-strong); color: var(--text); }
.ex-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.ex-panels .code { margin-top: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.hint code { font-size: 12px; }

.examples:empty { display: none; }
body.no-examples .columns { grid-template-columns: minmax(0, 1fr); }
body.no-examples .content { max-width: 1000px; }

/* params chips (mobile fallback not needed) */

/* ---------- guide extras ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 22px 0; }
.card {
  display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow); color: var(--text);
}
.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.card .ct { font-weight: 650; margin-bottom: 4px; }
.card .cd { font-size: 13.5px; color: var(--muted); }
.card .ci { color: var(--brand-2); margin-bottom: 10px; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { position: relative; padding: 0 0 20px 46px; }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.steps > li::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps .st { display: block; font-weight: 650; margin-bottom: 2px; color: var(--text); }

/* ---------- misc ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 0; box-shadow: var(--shadow);
}
.to-top:hover { background: var(--brand-3); }
.backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(8, 16, 30, .5);
  backdrop-filter: blur(1px);
}
.loading { padding: 60px 0; color: var(--muted); }
.notfound h1 { font-size: 26px; }

/* highlight.js tokens */
.hljs-tag, .hljs-name, .hljs-selector-tag { color: #7fd1ff; }
.hljs-attr { color: #ffd479; }
.hljs-string, .hljs-doctag { color: #9ae6a0; }
.hljs-comment { color: #7f93ad; font-style: italic; }
.hljs-keyword, .hljs-built_in, .hljs-type { color: #c792ff; }
.hljs-number, .hljs-literal { color: #ff9e64; }
.hljs-title, .hljs-function .hljs-title { color: #7fd1ff; }
.hljs-meta { color: #9fb6d4; }
.hljs-variable, .hljs-template-variable { color: #ffd479; }
.hljs-symbol, .hljs-bullet { color: #ff9e64; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --examples-w: 340px; }
  .content { padding: 30px 30px 80px; }
}
@media (max-width: 1024px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .examples { display: none; }
  .examples-inline { display: block; margin-top: 10px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .sidebar-close { display: block; }
  .wrapper { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .topbar-link { display: none; }
  .content { padding: 22px 16px 70px; }
  .doc h1 { font-size: 24px; }
  .breadcrumb { font-size: 12.5px; }
}
body.nav-open { overflow: hidden; }
@media (min-width: 769px) { .backdrop { display: none !important; } }
