/* UPREPAIR · Header canônico v2.1 · 2026-05-19 */
/* Injetável via /js/site-header.js. Mobile-first, defensivo, cross-browser. */
/* v2.1: adicionadas listras decorativas globais (.bars) */

/* ========================================
   ANTI-FLASH: esconde qualquer header legado
   ======================================== */
header.topo,
.topo,
header.site-header:not([data-canonical]) {
  display: none !important;
}

/* ========================================
   CONTAINER RAIZ
   ======================================== */
header.site-header[data-canonical] {
  --header-h: 56px;
  --header-bg: #FFFFFF;
  --header-fg: #000000;
  --header-accent: #FFEB00;
  --drawer-w: 280px;

  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-accent);
  width: 100%;
  display: block;
  box-sizing: border-box;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
}

.site-header[data-canonical] *,
.site-header[data-canonical] *::before,
.site-header[data-canonical] *::after {
  box-sizing: border-box;
}

/* ========================================
   INNER COM ALTURA FIXA EXPLÍCITA
   (defensivo contra colapso no Chrome iOS)
   ======================================== */
.site-header[data-canonical] .site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   LOGO
   ======================================== */
.site-header[data-canonical] .brand {
  display: inline-flex;
  align-items: center;
  height: 100%;
  min-height: 56px;
  flex-shrink: 0;
  flex-grow: 0;
  text-decoration: none;
  color: #000000;
  font-family: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-header[data-canonical] .brand span {
  display: inline-block;
}

/* ========================================
   NAV DESKTOP: ESCONDIDA EM MOBILE
   ======================================== */
.site-header[data-canonical] .site-header-nav {
  display: none;
}

/* ========================================
   BOTÃO HAMBURGER: VISÍVEL EM MOBILE
   ======================================== */
.site-header[data-canonical] .site-header-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin-right: -10px;
  background: transparent;
  border: 0;
  color: #000000;
  cursor: pointer;
  flex-shrink: 0;
  flex-grow: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.site-header[data-canonical] .site-header-burger svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

/* ========================================
   DRAWER MOBILE
   ======================================== */
.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 110;
  pointer-events: none;
  visibility: hidden;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
}

.site-drawer[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.site-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 200ms ease;
}

.site-drawer[aria-hidden="false"] .site-drawer-overlay {
  opacity: 1;
}

.site-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #FFFFFF;
  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: 56px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-drawer[aria-hidden="false"] .site-drawer-panel {
  transform: translateX(0);
}

.site-drawer-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #000000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.site-drawer-close svg {
  width: 20px;
  height: 20px;
}

.site-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.site-drawer-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 24px;
  text-decoration: none;
  color: #000000;
  border-bottom: 1px solid #EEEEEE;
  transition: background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.site-drawer-item:last-child {
  border-bottom: 0;
}

.site-drawer-item .num {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #999999;
  letter-spacing: 0.08em;
  line-height: 1;
}

.site-drawer-item .label {
  font-family: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: #000000;
}

.site-drawer-item[aria-current="page"] {
  background: #FFEB00;
}

/* Bloqueia scroll do body quando drawer aberto */
body.site-drawer-open {
  overflow: hidden;
}

/* ========================================
   LISTRAS DECORATIVAS GLOBAIS DE FUNDO
   (replicadas da /precos/, agora cross-site)
   ======================================== */
.bars {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100vh;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    #FFEB00 0 2px,
    transparent 2px 6px,
    #FFEB00 6px 12px,
    transparent 12px 22px,
    #FFEB00 22px 24px,
    transparent 24px 40px,
    #FFEB00 40px 50px,
    transparent 50px 68px
  );
  background-size: 68px 100%;
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 100%);
  z-index: -1;
}

@media (max-width: 720px) {
  .bars {
    width: 100vw;
    opacity: 0.3;
  }
}

/* ========================================
   DESKTOP ≥768px
   ======================================== */
@media (min-width: 768px) {
  .site-header[data-canonical] .site-header-inner {
    height: 64px;
    min-height: 64px;
    padding: 0 32px;
  }

  .site-header[data-canonical] .brand {
    font-size: 20px;
    min-height: 64px;
  }

  .site-header[data-canonical] .site-header-nav {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    height: 100%;
  }

  .site-header[data-canonical] .site-header-burger {
    display: none;
  }

  .site-header[data-canonical] .header-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #000000;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    height: 100%;
    transition: color 150ms ease;
  }

  .site-header[data-canonical] .header-link:hover {
    color: #555555;
  }

  .site-header[data-canonical] .header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 40px;
    min-height: 40px;
    background: #FFEB00;
    color: #000000;
    text-decoration: none;
    border-radius: 999px;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 150ms ease, box-shadow 150ms ease;
  }

  .site-header[data-canonical] .header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .site-header[data-canonical] .header-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
  }

  .site-header[data-canonical] .header-cta span {
    display: inline-block;
  }

  .site-drawer {
    display: none !important;
  }
}

.site-drawer[aria-hidden="true"] { pointer-events: none; }

body > .site-drawer-overlay { pointer-events: none; }
.footer-bars .bars { display: none; }
