/* ==========================================================================
   Guia da Esteira — Design System (tema CINZA CLARO / light)
   Base: tokens, tipografia, layout, header, footer
   ========================================================================== */

:root {
  /* Paleta cinza claro */
  --bg: #f4f5f7;            /* fundo geral cinza claro */
  --bg-soft: #eceef1;       /* faixas alternadas */
  --surface: #ffffff;       /* cards e superfícies */
  --surface-2: #f8f9fb;     /* superfície secundária */
  --border: #e2e5ea;        /* bordas suaves */
  --border-strong: #d4d8df;

  --text: #1f2733;          /* texto principal */
  --text-soft: #46505f;     /* texto secundário */
  --text-muted: #79828f;    /* metadados, labels */

  --accent: #0891b2;        /* ciano-esteira */
  --accent-dark: #0e7490;
  --accent-soft: #cffafe;
  --accent-ink: #123640;

  --dark: #123640;          /* petróleo — navbar, rodapé, blocos escuros */
  --dark-line: #1e5162;     /* bordas sobre o petróleo */
  --dark-field: #17444f;    /* campos sobre o petróleo (busca) */

  --amber: #f59e0b;
  --blue: #2563eb;
  --purple: #7c3aed;

  --pros-bg: #e8f7ef;
  --pros-tx: #117a4e;
  --contras-bg: #fdecec;
  --contras-tx: #c0392b;

  --cta-accent: linear-gradient(180deg, #ffb84d 0%, #f59e0b 100%);
  --ml: #ffe600;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,30,45,.04), 0 6px 20px rgba(20,30,45,.06);
  --shadow-lg: 0 10px 40px rgba(20,30,45,.12);
  --maxw: 1180px;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "Barlow Condensed", "Poppins", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.page { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--dark);
  border-bottom: 1px solid var(--dark-line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 22px;
}
.logo-link { display: flex; align-items: center; gap: 12px; }
.logo-link:hover { text-decoration: none; }
.logo-svg { flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-weight: 800; font-size: 19px; color: #fff; letter-spacing: -.02em; }
.logo-name .hl { color: var(--accent); }
.logo-tagline { font-family: var(--mono); font-size: 10.5px; color: #7e8895; letter-spacing: .02em; }

.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-link {
  font-size: 14.5px; font-weight: 600; color: #cdd4dd;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav-link:hover { background: rgba(8,145,178,.22); color: #fff; text-decoration: none; }
.nav-link--active { background: var(--accent); color: #fff; }
.nav-link--active:hover { background: var(--accent-dark); color: #fff; }

.header-right { display: flex; align-items: center; }
.search-wrap { position: relative; }
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--dark-field); border: 1px solid var(--dark-line);
  border-radius: 999px; padding: 8px 14px; color: #8fa8b2;
}
.search-trigger:focus-within { border-color: var(--accent); background: #1b4d59; }
.search-input {
  border: 0; background: transparent; outline: none; font-family: var(--font);
  font-size: 14px; width: 130px; color: #fff;
}

/* mobile nav */
.nav-toggle { display: none; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--dark); color: #cbdde3;
  border-top: 4px solid var(--accent);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 22px 28px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
}
.footer-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo-name { font-weight: 800; font-size: 18px; color: #fff; }
.footer-logo-name .hl { color: var(--accent); }
.footer-about { font-size: 14px; line-height: 1.7; color: #9aa4b1; max-width: 320px; }
.label--dim {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: #6f7a87; margin-bottom: 14px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { color: #b6bec9; font-size: 14px; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 22px 0;
  border-top: 1px solid var(--dark-line); margin-top: 36px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: #7e8895;
}
.footer-bottom a { color: inherit; text-decoration: underline; }

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 900px) {
  .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(280px, 82vw);
    background: var(--surface); flex-direction: column; gap: 4px;
    padding: 78px 18px 24px; box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .25s ease; margin: 0;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-link { width: 100%; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--dark-line);
    background: var(--dark-field); cursor: pointer; color: #fff;
  }
  .header-right { order: -1; }
  .search-input { width: 92px; }
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==================================================================
   BUSCA DROPDOWN (formato Mestres do Hardware) — tematizado
   ================================================================== */
.search-wrap { position: relative; width: 180px; height: 34px; flex-shrink: 0; }
.search-trigger {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px;
  background: var(--dark-field); border: 1px solid var(--dark-line);
  padding: 6px 14px; border-radius: 999px; font-size: 12px;
  color: #8fa8b2; width: 180px; cursor: text; z-index: 10;
  transition: width 300ms ease, border-color 200ms ease, background 150ms ease;
}
.search-trigger:focus-within {
  border-color: var(--accent);
  background: #1b4d59; width: 260px;
}
.search-trigger svg { flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 12px; font-family: var(--font-body, inherit); min-width: 0;
}
.search-input::placeholder { color: #8fa8b2; }
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  width: 380px; max-width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  overflow: hidden; z-index: 300;
}
.search-dropdown.is-open { display: block; }
.search-results { max-height: 380px; overflow-y: auto; }
.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-track { background: transparent; }
.search-results::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 2px; }
.search-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background 120ms ease;
}
.search-item:hover { background: var(--surface-2); }
.search-item:last-child { border-bottom: none; }
.search-item-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 2px 7px; border-radius: 3px; white-space: nowrap; flex-shrink: 0;
}
.search-item-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.search-empty {
  padding: 28px 16px; text-align: center; font-family: var(--mono);
  font-size: 11px; color: var(--text-muted, #8a93a3); letter-spacing: 0.1em;
}
.search-group-label {
  padding: 8px 16px 4px; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.14em; color: var(--text-muted, #8a93a3);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.search-hl { background: var(--accent); color: #fff; border-radius: 2px; }
@media (max-width: 900px) {
  .search-trigger { right: auto; left: 0; }
  .search-dropdown { right: auto; left: 0; }
}
/* Busca no celular: logo + menu na 1ª linha, busca full-width na 2ª */
@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; row-gap: 10px; column-gap: 12px; }
  .header-right { order: 3; width: 100%; flex: 1 0 100%; }
  .search-wrap { width: 100%; height: auto; }
  .search-trigger { position: static; transform: none; width: 100%; }
  .search-trigger:focus-within { width: 100%; }
  .search-dropdown { width: 100%; max-width: 100%; }
}

.search-item:hover, .search-item:focus { text-decoration: none; }
