/* Scan ERP shared site chrome: header, footer and the WhatsApp button.
 *
 * One source of truth for every landing page. The header and footer markup
 * live in scripts/partials/ and are copied into pages by
 * scripts/sync-partials.js; this file styles them. Page-specific styles stay
 * in each page's own stylesheet, so body content and its density are untouched.
 *
 * Classes are prefixed sx- so they cannot collide with the older .site-header,
 * .nav and .header-nav rules still present in styles.css, blog.css and inline
 * page styles.
 *
 * Colours are checked against the brand ground #F4F1E9, not white:
 * #53605D is 5.82:1 there, #0F172A 16:1, white on #047857 5.48:1.
 */
:root {
  --sx-ground: #F4F1E9;
  --sx-surface: #FFFFFF;
  --sx-ink: #0F172A;
  --sx-muted: #53605D;
  --sx-line: #DCD6C8;
  --sx-green: #047857;
  --sx-green-dark: #065F46;
  --sx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sx-max: 1200px;
  --sx-z-header: 50;
}

/* ── Button ─────────────────────────────────────────────────────────── */
.sx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  font: 700 16px/1.2 var(--sx-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.sx-btn-wa,
.sx-btn-wa:visited { background: var(--sx-green); color: #fff; }
.sx-btn-wa:hover { background: var(--sx-green-dark); color: #fff; }
.sx-btn:focus-visible,
.sx-nav a:focus-visible,
.sx-menu summary:focus-visible,
.sx-menu-panel a:focus-visible,
.sx-logo:focus-visible,
.sx-footer a:focus-visible {
  outline: 3px solid var(--sx-green);
  outline-offset: 2px;
}
.sx-icon { flex: none; }

/* ── Header ─────────────────────────────────────────────────────────── */
.sx-header {
  position: sticky;
  top: 0;
  z-index: var(--sx-z-header);
  background: var(--sx-surface);
  border-bottom: 1px solid var(--sx-line);
  font-family: var(--sx-font);
}
.sx-header-in {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.sx-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--sx-ink);
  text-decoration: none;
  flex: none;
}
.sx-logo img { display: block; width: 32px; height: 32px; }
.sx-logo-name { font: 800 18px/1 var(--sx-font); white-space: nowrap; color: var(--sx-ink); }
.sx-nav { display: flex; gap: 4px; margin-left: auto; }
.sx-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--sx-ink);
  font: 600 15px/1 var(--sx-font);
  text-decoration: none;
}
.sx-nav a:hover { color: var(--sx-green); background: var(--sx-ground); }
.sx-header .sx-btn { flex: none; }

/* Phone menu: <details>, so it works without JavaScript. */
.sx-menu { display: none; position: relative; flex: none; }
.sx-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--sx-ink);
  cursor: pointer;
}
.sx-menu summary::-webkit-details-marker { display: none; }
.sx-menu[open] summary { background: var(--sx-ground); }
.sx-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 8px;
  background: var(--sx-surface);
  border: 1px solid var(--sx-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.sx-menu-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--sx-ink);
  font: 600 16px/1 var(--sx-font);
  text-decoration: none;
}
.sx-menu-panel a:hover { background: var(--sx-ground); color: var(--sx-green); }

@media (max-width: 860px) {
  .sx-nav { display: none; }
  .sx-header .sx-btn { margin-left: auto; }
  .sx-menu { display: block; }
}
@media (max-width: 480px) {
  .sx-header-in { padding: 8px 16px; gap: 8px; }
  /* Keep the button label whole on phones; the logo mark carries the brand. */
  .sx-header .sx-logo-name { display: none; }
  .sx-header .sx-btn { padding: 10px 14px; font-size: 15px; }
}
@media (max-width: 360px) {
  /* 320px phones: drop the icon and tighten the pill so the label stays whole. */
  .sx-header-in { padding: 8px 12px; gap: 6px; }
  .sx-header .sx-btn { padding: 8px 12px; font-size: 14px; gap: 0; }
  .sx-header .sx-btn .sx-icon { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.sx-footer {
  background: var(--sx-surface);
  border-top: 1px solid var(--sx-line);
  font-family: var(--sx-font);
  color: var(--sx-ink);
  margin-top: 48px;
}
.sx-footer-in {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.sx-footer-brand p { margin: 12px 0 16px; color: var(--sx-muted); font-size: 15px; line-height: 1.6; max-width: 34ch; }
.sx-footer-col { display: flex; flex-direction: column; }
.sx-footer-col h2 {
  margin: 0 0 8px;
  font: 700 15px/1.3 var(--sx-font);
  color: var(--sx-ink);
}
.sx-footer-col a {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--sx-muted);
  font-size: 15px;
  text-decoration: none;
}
.sx-footer-col a:hover { color: var(--sx-green); text-decoration: underline; }
.sx-footer-base {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 16px 24px 32px;
  border-top: 1px solid var(--sx-line);
  color: var(--sx-muted);
  font-size: 14px;
}
@media (max-width: 960px) {
  .sx-footer-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .sx-footer-in { padding: 32px 16px 16px; gap: 24px; }
  .sx-footer-col a { min-height: 44px; }
  .sx-footer-base { padding: 16px 16px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .sx-btn, .sx-nav a { transition: none; }
}
