:root {
  --ehero-blue: #017cba;
  --ehero-blue-dark: #015e8e;
  --ehero-blue-light: #e8f4fb;
  --sidebar-width: 280px;
  --header-height: 64px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
}

/* ── Header ── */
.doc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.doc-header__logo {
  height: 36px;
  width: auto;
}

.doc-header__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-header__spacer { flex: 1; }

.lang-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.lang-toggle__btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-500);
  transition: background var(--transition), color var(--transition);
}

.lang-toggle__btn.active {
  background: var(--ehero-blue);
  color: #fff;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--gray-700);
}

.mobile-menu-btn svg { display: block; }

/* ── Sidebar ── */
.doc-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 90;
  transition: transform .3s ease;
}

.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.doc-sidebar__nav { list-style: none; }

.doc-sidebar__link {
  display: block;
  padding: 8px 24px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.doc-sidebar__link:hover {
  background: var(--ehero-blue-light);
  color: var(--ehero-blue);
}

.doc-sidebar__link.active {
  color: var(--ehero-blue);
  border-left-color: var(--ehero-blue);
  background: var(--ehero-blue-light);
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 89;
}

/* ── Main content ── */
.doc-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 40px 48px 80px;
  max-width: 860px;
}

.doc-section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--gray-200);
}

.doc-section:last-child { border-bottom: none; }

.doc-section h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ehero-blue);
  display: inline-block;
}

.doc-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 24px 0 12px;
}

.doc-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 16px 0 8px;
}

.doc-section p {
  margin-bottom: 12px;
  color: var(--gray-700);
}

.doc-section ul, .doc-section ol {
  margin: 8px 0 16px 24px;
  color: var(--gray-700);
}

.doc-section li { margin-bottom: 6px; }

.doc-section strong { color: var(--gray-900); }

.doc-section a {
  color: var(--ehero-blue);
  text-decoration: none;
}
.doc-section a:hover { text-decoration: underline; }

/* Code blocks */
.code-block {
  position: relative;
  background: var(--gray-900);
  color: #e5e7eb;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.code-block code {
  font-family: inherit;
  font-size: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ehero-blue-dark);
}

/* Info boxes */
.info-box {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 14px;
}

.info-box--tip {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.info-box--warning {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.info-box--info {
  background: var(--ehero-blue-light);
  border-left: 4px solid var(--ehero-blue);
  color: var(--ehero-blue-dark);
}

/* Tables */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.doc-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-900);
}

.doc-table tr:hover td { background: var(--gray-50); }

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  border: none;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  transition: background var(--transition);
}

.faq-question:hover { background: var(--gray-50); }

.faq-question::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--ehero-blue);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-question::after {
  content: "−";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.faq-answer__inner {
  padding: 0 20px 16px;
  color: var(--gray-700);
  font-size: 14px;
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.steps li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--ehero-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* Language display */
[data-lang] { display: none; }
body.lang-es [data-lang="es"] { display: block; }
body.lang-en [data-lang="en"] { display: block; }

/* Shortcode card */
.shortcode-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.shortcode-card__name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ehero-blue);
  margin-bottom: 8px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .doc-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .doc-sidebar {
    transform: translateX(-100%);
  }

  .doc-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .mobile-menu-btn {
    display: block;
  }

  .doc-header__title {
    font-size: 15px;
  }
}

@media (max-width: 500px) {
  .doc-section h2 { font-size: 22px; }
  .doc-table { font-size: 12.5px; }
  .doc-table th, .doc-table td { padding: 8px 10px; }
}
