/* ============================================
   EHERO Woo Supplier Stock Manager — Documentation
   ============================================ */

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

:root {
  --color-primary: #017cba;
  --color-primary-light: #0a8fd0;
  --color-primary-dark: #015d8c;
  --color-accent: #38bdf8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --color-bg: #f8fafc;
  --color-bg-alt: #ffffff;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-border: #e2e8f0;
  --color-code-bg: #f1f5f9;
  --sidebar-w: 290px;
  --header-h: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10);
  --transition: .25s ease;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: .85rem; padding-top: 1.5rem; }
h3 { font-size: 1.35rem; margin-bottom: .65rem; padding-top: 1rem; }
h4 { font-size: 1.1rem; margin-bottom: .5rem; }

p { margin-bottom: 1rem; }

ul, ol {
  margin: 0 0 1rem 1.5rem;
}
li { margin-bottom: .4rem; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--color-code-bg);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--color-primary-dark);
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.6;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
}

.header-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
}

.header-brand .brand-logo {
  height: 36px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

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

.version-badge {
  font-size: .75rem;
  background: var(--color-code-bg);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--color-text-light);
  font-weight: 600;
}

/* Language switcher */
.lang-switch {
  display: flex;
  background: var(--color-code-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.lang-switch button:hover {
  color: var(--color-primary);
}
.lang-switch button.active {
  background: var(--color-primary);
  color: #fff;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  color: var(--color-text);
}
.menu-toggle svg { width: 24px; height: 24px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--color-bg-alt);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 900;
  transition: transform var(--transition);
}

.sidebar-nav { list-style: none; margin: 0; padding: 0; }

.sidebar-nav > li { margin-bottom: 2px; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1.5rem;
  color: var(--color-text-light);
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar-nav a:hover {
  color: var(--color-primary);
  background: rgba(79,70,229,.04);
}
.sidebar-nav a.active {
  color: var(--color-primary);
  background: rgba(79,70,229,.07);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-section-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-light);
  padding: 1.2rem 1.5rem .4rem;
  font-weight: 700;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
}

/* ---------- Sections ---------- */
.doc-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.doc-section:last-child { border-bottom: none; }

.section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.section-header .section-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ---------- Callouts ---------- */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: .93rem;
  line-height: 1.6;
}
.callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.callout-tip {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.callout-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* ---------- Steps ---------- */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.2rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--color-border);
}
.steps li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

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

/* ---------- Tables ---------- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .9rem;
}
.doc-table th,
.doc-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.doc-table th {
  background: var(--color-code-bg);
  font-weight: 600;
  color: var(--color-text);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.doc-table tr:hover td {
  background: rgba(79,70,229,.02);
}

/* ---------- Accordion (FAQ) ---------- */
.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.accordion-header {
  width: 100%;
  border: none;
  background: transparent;
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--color-code-bg); }
.accordion-header .chevron {
  transition: transform var(--transition);
  font-size: .8rem;
  color: var(--color-text-light);
}
.accordion-item.open .accordion-header .chevron {
  transform: rotate(180deg);
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding: 0 1.25rem;
}
.accordion-item.open .accordion-body {
  max-height: 600px;
  padding: 0 1.25rem 1.25rem;
}

/* ---------- Feature cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card-icon {
  font-size: 1.6rem;
  margin-bottom: .75rem;
}
.feature-card h4 {
  margin-bottom: .4rem;
  font-size: 1rem;
}
.feature-card p {
  font-size: .88rem;
  color: var(--color-text-light);
  margin-bottom: 0;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 800;
  font-size: 1.2rem;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-left: var(--sidebar-w);
  padding: 2rem 3rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: .85rem;
  border-top: 1px solid var(--color-border);
}

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

/* ---------- Language visibility ---------- */
body:not(.lang-en) [data-lang="en"] { display: none !important; }
body.lang-en [data-lang="es"] { display: none !important; }
.lang-switch button[data-lang="en"],
.lang-switch button[data-lang="es"] { display: inline-block !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .main-content {
    padding: 2rem 2rem 3rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

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

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

  .main-content,
  .site-footer {
    margin-left: 0;
    padding: 1.5rem 1.25rem 3rem;
  }
  .site-footer { padding: 1.5rem 1.25rem; }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .sidebar, .back-to-top, .menu-toggle, .lang-switch { display: none !important; }
  .main-content, .site-footer { margin-left: 0; }
}
