/* Piranot v15 — Header (preservado do site ao vivo)
   Classes pira-* — NÃO alterar sem autorização.
   ------------------------------------------------- */

/* =============================================
   TOPBAR PRINCIPAL
   ============================================= */
.pira-top {
  background: linear-gradient(180deg, #0b3b8f 0%, #082c6b 100%);
  color: #fff;
  position: relative;
  /* Impede qualquer overflow horizontal */
  overflow-x: hidden;
  width: 100%;
}

.pira-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Container padrão — usado em todas as seções */
.pira-wrap {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.pira-topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-wrap: nowrap; /* nunca quebra linha no topo */
}

/* =============================================
   LOGO / BRAND
   ============================================= */
.pira-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: #fff;
  flex: 1 1 auto;  /* cresce e encolhe */
  min-width: 0;    /* permite encolher abaixo do tamanho intrínseco */
  overflow: hidden;
}

.pira-brand img,
.pira-logo {
  display: block;
  width: auto;
  max-width: 200px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 1;
}

.pira-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================
   HAMBURGUER (oculto no desktop)
   ============================================= */
.pira-menu-toggle {
  display: none;
  flex-direction: column;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  order: 99; /* sempre à direita */
}

.pira-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* Ícone X quando aberto */
.pira-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.pira-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.pira-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   BUSCA
   ============================================= */
.pira-search-bar {
  flex: 1 1 auto;
  max-width: 380px;
  min-width: 0;
}

.pira-search-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 0 14px;
  height: 42px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pira-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  font-family: inherit;
}

.pira-search-input::placeholder { color: rgba(255,255,255,.6); }

.pira-search-btn {
  background: none;
  border: none;
  outline: none;
  color: rgba(255,255,255,.9);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* =============================================
   BOTÕES UTILITÁRIOS (pira-pill)
   ============================================= */
.pira-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.pira-pill {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: .3px;
  height: 40px;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}

.pira-pill:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

/* =============================================
   MENU DE NAVEGAÇÃO PRINCIPAL
   ============================================= */
.pira-nav {
  border-top: 1px solid rgba(255,255,255,.15);
  background: linear-gradient(0deg, #0a2f73, #0b3b8f);
  overflow-x: hidden;
  width: 100%;
}

.pira-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
}

.pira-nav li { margin: 0; }

.pira-nav a {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 13px 14px;
  height: 44px;
  opacity: .9;
  border-radius: 4px;
  position: relative;
  transition: opacity .2s;
  white-space: nowrap;
}

.pira-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #ffd200;
  opacity: 0;
  transition: opacity .2s;
}

.pira-nav a:hover,
.pira-nav .current-menu-item > a { opacity: 1; }

.pira-nav a:hover::after,
.pira-nav .current-menu-item > a::after { opacity: 1; }

/* =============================================
   TICKER — ÚLTIMAS NOTÍCIAS
   ============================================= */
.pira-trending {
  background: linear-gradient(135deg, #05204a 0%, #072d6a 100%);
  color: #fff;
  border-top: 2px solid rgba(255,210,0,.3);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.pira-trending-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 9px 0;
  overflow: hidden;
  flex-wrap: nowrap;
}

.pira-tag {
  background: linear-gradient(135deg, #ffd200 0%, #e6bd00 100%);
  color: #111;
  font-weight: 900;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 1px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.pira-ticker {
  display: flex;
  gap: 36px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.pira-ticker a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  opacity: .95;
  display: inline-block;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.pira-ticker a:hover { opacity: 1; text-decoration: underline; }

/* =============================================
   CHIPS DE SERVIÇO RÁPIDO
   ============================================= */
.pira-service-bar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  overflow: hidden;
  width: 100%;
}

.pira-service-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.pira-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #0b3b8f;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-right: 1px solid #e5e5e5;
  text-decoration: none;
  transition: background .2s, color .2s;
  overflow: hidden;
}

.pira-chip:last-child { border-right: none; }
.pira-chip:hover { background: #0b3b8f; color: #fff; }
.pira-chip svg { width: 18px; height: 18px; stroke: currentColor; fill: none; flex-shrink: 0; }

/* =============================================
   OVERLAY quando menu mobile está aberto
   ============================================= */
body.menu-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
}

/* =============================================
   RESPONSIVO
   ============================================= */

/* Tablet largo (≤ 1100px) */
@media (max-width: 1100px) {
  .pira-brand img { max-width: 180px; }
  .pira-search-bar { max-width: 280px; }
  .pira-pill { padding: 8px 12px; font-size: 11px; height: 38px; }
}

/* Tablet estreito (≤ 900px) — esconde pills, mantém busca */
@media (max-width: 900px) {
  .pira-tools { display: none !important; }
  .pira-search-bar { max-width: 240px; }
  .pira-brand img { max-width: 160px; }
}

/* Mobile (≤ 768px) — ativa drawer lateral */
@media (max-width: 768px) {
  /* Topbar simplificada: só logo + hamburguer */
  .pira-topbar {
    padding: 10px 0;
    gap: 8px;
  }

  .pira-brand img  { max-width: 140px; max-height: 40px; }
  .pira-logo-text  { font-size: 15px; }

  .pira-menu-toggle { display: inline-flex; }

  .pira-search-bar,
  .pira-tools { display: none !important; }

  /* -----------------------------------------------
     DRAWER — usa transform (sem overflow issues)
     ----------------------------------------------- */
  .pira-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(290px, 82vw);
    height: 100vh;
    height: 100dvh;          /* dynamic viewport height (iOS fix) */
    background: #0b3b8f;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
    /* transform é a forma correta — não usa left negativo que causa overflow */
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }

  .pira-nav.is-open {
    transform: translateX(0);
  }

  .pira-nav ul {
    flex-direction: column;
    padding: 80px 0 40px;
    gap: 0;
    flex-wrap: nowrap;
    width: 100%;
  }

  .pira-nav li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  .pira-nav a {
    display: block;
    padding: 16px 24px;
    font-size: 15px;
    height: auto;
    border-radius: 0;
    white-space: normal;
    width: 100%;
  }

  .pira-nav a::after { display: none; }

  /* Ticker menor */
  .pira-tag  { font-size: 9px; padding: 4px 8px; }
  .pira-ticker a { font-size: 12px; }

  /* Chips: 2 colunas */
  .pira-service-chips { grid-template-columns: repeat(2, 1fr); }
  .pira-chip { padding: 10px 6px; font-size: 10px; }
}

/* WP admin bar — compensa o topo quando logado */
@media (min-width: 601px) {
  .admin-bar .pira-nav { top: 32px; }
}
@media (max-width: 600px) {
  .admin-bar .pira-nav { top: 46px; }
}

/* Phones pequenos (≤ 480px) */
@media (max-width: 480px) {
  .pira-brand img  { max-width: 110px; max-height: 34px; }
  .pira-logo-text  { font-size: 13px; }
  .pira-menu-toggle { width: 40px; height: 40px; }
  .pira-ticker a   { font-size: 11px; }
  .pira-trending-row { gap: 8px; padding: 7px 0; }
  .pira-chip       { padding: 8px 4px; font-size: 9px; }
  .pira-chip svg   { width: 15px; height: 15px; }
}

/* Phones muito pequenos (≤ 360px) */
@media (max-width: 360px) {
  .pira-topbar { gap: 6px; }
  .pira-brand img { max-width: 90px; max-height: 30px; }
  .pira-service-chips { grid-template-columns: repeat(4, 1fr); }
  .pira-chip { padding: 6px 2px; font-size: 8px; gap: 2px; }
  .pira-chip svg { width: 13px; height: 13px; }
}
