/* ============================================
   HEADER MODERNO E PROFISSIONAL
   Design limpo, elegante e funcional
   ============================================ */

/* Reset do header antigo */
.header {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10000;
  transition: all 0.3s ease;
}

.header.header--scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

/* Container principal do header */
.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 32px;
}

/* Logo - Centralizada e com tamanho adequado */
.header__logo {
  flex-shrink: 0;
}

.header__logo a {
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 50px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.header__logo:hover img {
  transform: scale(1.05);
}

/* Navegação principal - Limpa e espaçada */
.header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.header__nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__nav li {
  margin: 0;
}

.header__nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  color: #2c3e50 !important;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
}

.header__nav a:hover {
  background: rgba(0, 102, 255, 0.08);
  color: #0066FF !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.header__nav li.active a {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.header__nav li.active a:hover {
  color: #fff !important;
}

.header__nav a i {
  font-size: 0.875rem;
}

/* Ações do header - Direita */
.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Busca compacta */
.header__search {
  position: relative;
}

.header__search-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0066FF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.header__search-toggle i {
  color: #fff !important;
  transition: color 0.3s ease;
}

.header__search-toggle:hover {
  background: #0052CC;
  color: #fff;
  transform: scale(1.05);
}

.header__search-toggle:hover i {
  color: #fff !important;
}

/* Busca em formato de Modal (Popup) */
.header__search-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  /* Fundo mais escuro */
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 999999;
  padding: 40px 20px;
}

.header__search-form.active {
  opacity: 1;
  visibility: visible;
}

.header__search-form form {
  width: 100%;
  max-width: 800px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transform: translateY(30px);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header__search-form.active form {
  transform: translateY(0);
}

.header__search-form input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 3px solid rgba(255, 255, 255, 0.3);
  padding: 20px 0;
  font-size: 2.8rem;
  font-weight: 300;
  color: #fff !important;
  outline: none;
  transition: border-color 0.3s ease;
  text-align: center;
  letter-spacing: 1px;
}

.header__search-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.header__search-form input:focus {
  border-color: #0066FF;
}

.header__search-form button[type="submit"] {
  padding: 18px 50px;
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
  font-size: 1.2rem;
  align-self: center;
  letter-spacing: 1px;
  box-shadow: 0 8px 30px rgba(0, 102, 255, 0.4);
}

.header__search-form button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 102, 255, 0.6);
}

/* Botão de Fechar Busca */
.header__search-close {
  position: fixed;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.8;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

.header__search-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg) scale(1.1);
}

@media (max-width: 768px) {
  .header__search-form input {
    font-size: 1.8rem;
    padding: 15px 0;
  }

  .header__search-form button[type="submit"] {
    padding: 15px 40px;
    font-size: 1rem;
  }

  .header__search-close {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

/* Botões de ação */
.header__action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8f9fa;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #495057 !important;
  text-decoration: none;
}

.header__action-btn:hover {
  background: #0066FF;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
  text-decoration: none;
}

.header__action-btn i {
  font-size: 1.125rem;
  color: inherit;
  transition: color 0.3s ease;
}

.header__action-btn:hover i {
  color: #fff !important;
}

/* Badge de notificação */
.header__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

/* Botão de login/cadastro */
.header__auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__auth-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}

.header__auth-btn--login {
  background: transparent;
  color: #495057 !important;
  border: 1px solid #dee2e6;
}

.header__auth-btn--login:hover {
  background: #f8f9fa;
  border-color: #0066FF;
  color: #0066FF !important;
  text-decoration: none;
}

.header__auth-btn--register {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.header__auth-btn--register:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
  color: #fff !important;
  text-decoration: none;
}

.header__auth-btn--account {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.header__auth-btn--account:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  color: #fff !important;
  text-decoration: none;
}

/* Menu mobile */
.header__mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8f9fa;
  border: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.header__mobile-toggle:hover {
  background: #0066FF;
}

.header__mobile-toggle span {
  width: 20px;
  height: 2px;
  background: #495057;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.header__mobile-toggle:hover span {
  background: #fff;
}

.header__mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(7px);
}

.header__mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.header__mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-7px);
}

/* Carrinho com preview */
.header__cart-preview {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.header__action-btn:hover .header__cart-preview {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Topbar opcional */
.header__topbar {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: #fff;
  padding: 8px 0;
  font-size: 0.8125rem;
}

.header__topbar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.header__topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__topbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
}

.header__topbar-item i {
  font-size: 0.75rem;
}

.header__topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__topbar-social a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
  margin-left: 8px;
}

.header__topbar-social a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 991px) {
  .header__container {
    padding: 12px 0;
  }

  .header__nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 24px 24px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 999;
  }

  .header__nav.active {
    left: 0;
  }

  .header__nav ul {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .header__nav a {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
  }

  .header__mobile-toggle {
    display: flex;
  }

  .header__auth {
    display: none;
  }

  .header__logo img {
    height: 40px;
  }

  .header__topbar-left {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .header__actions {
    gap: 8px;
  }

  .header__action-btn {
    width: 36px;
    height: 36px;
  }

  .header__search-form {
    width: 280px;
  }

  .header__topbar {
    display: none;
  }
}

/* Overlay para menu mobile */
.header__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.header__overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Animações */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  animation: slideDown 0.4s ease-out;
}

/* Scroll behavior */
.header--hidden {
  transform: translateY(-100%);
}

/* Mega menu hint */
.header__nav li.has-megamenu>a::after {
  content: '\f107';
  font-family: 'FontAwesome';
  margin-left: 4px;
  font-size: 0.75rem;
}

/* Correções de cor - Força as cores corretas */
.header a {
  text-decoration: none;
}

.header__nav li.active a,
.header__nav li.active a:hover,
.header__nav li.active a:focus,
.header__nav li.active a:visited {
  color: #fff !important;
}

.header__auth-btn--register,
.header__auth-btn--register:hover,
.header__auth-btn--register:focus,
.header__auth-btn--register:visited {
  color: #fff !important;
}

.header__auth-btn--account,
.header__auth-btn--account:hover,
.header__auth-btn--account:focus,
.header__auth-btn--account:visited {
  color: #fff !important;
}

.header__action-btn:hover,
.header__action-btn:hover i {
  color: #fff !important;
}


/* ============================================
   CORREÇÕES DE COR - ÍCONES E TEXTOS
   Força as cores corretas em todos os estados
   ============================================ */

/* Ícones dentro dos botões de ação */
.header__action-btn i,
.header__action-btn .fa {
  color: inherit;
}

.header__action-btn:hover i,
.header__action-btn:hover .fa {
  color: #fff !important;
}

/* Ícones dentro dos botões de autenticação */
.header__auth-btn i,
.header__auth-btn .fa {
  color: inherit;
  transition: color 0.3s ease;
}

.header__auth-btn--login i,
.header__auth-btn--login .fa {
  color: #495057;
}

.header__auth-btn--login:hover i,
.header__auth-btn--login:hover .fa {
  color: #0066FF !important;
}

.header__auth-btn--register i,
.header__auth-btn--register .fa,
.header__auth-btn--register:hover i,
.header__auth-btn--register:hover .fa {
  color: #fff !important;
}

.header__auth-btn--account i,
.header__auth-btn--account .fa,
.header__auth-btn--account:hover i,
.header__auth-btn--account:hover .fa {
  color: #fff !important;
}

/* Ícones dentro do menu ativo */
.header__nav li.active a i,
.header__nav li.active a .fa,
.header__nav li.active a:hover i,
.header__nav li.active a:hover .fa {
  color: #fff !important;
}

/* Botão de busca */
.header__search-toggle i,
.header__search-toggle .fa {
  color: inherit;
}

.header__search-toggle:hover i,
.header__search-toggle:hover .fa {
  color: #fff !important;
}

.header__search-form button i,
.header__search-form button .fa {
  color: #fff !important;
}

/* Badges */
.header__badge {
  color: #fff !important;
}

/* Topbar */
.header__topbar a,
.header__topbar i,
.header__topbar .fa {
  color: rgba(255, 255, 255, 0.9) !important;
}

.header__topbar a:hover {
  color: #fff !important;
}

/* Mobile toggle */
.header__mobile-toggle:hover span {
  background: #fff !important;
}

/* Garantir que todos os links do header não tenham sublinhado */
.header a:hover,
.header a:focus,
.header a:active {
  text-decoration: none !important;
}

/* Correção específica para Font Awesome */
.header .fa,
.header [class^="fa-"],
.header [class*=" fa-"] {
  text-decoration: none !important;
}


/* ============================================
   CORREÇÃO - ÍCONES DAS REDES SOCIAIS
   ============================================ */

/* Topbar - Redes Sociais */
.header__topbar-social a,
.header__topbar-social a i,
.header__topbar-social a .fa {
  color: rgba(255, 255, 255, 0.9) !important;
}

.header__topbar-social a:hover,
.header__topbar-social a:hover i,
.header__topbar-social a:hover .fa {
  color: #fff !important;
}

/* Garantir que todos os ícones da topbar sejam brancos */
.header__topbar i,
.header__topbar .fa,
.header__topbar [class^="fa-"],
.header__topbar [class*=" fa-"] {
  color: rgba(255, 255, 255, 0.9) !important;
}

.header__topbar a:hover i,
.header__topbar a:hover .fa,
.header__topbar a:hover [class^="fa-"],
.header__topbar a:hover [class*=" fa-"] {
  color: #fff !important;
}

/* Topbar - Todos os elementos */
.header__topbar,
.header__topbar * {
  color: rgba(255, 255, 255, 0.9) !important;
}

.header__topbar a {
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: none !important;
}

.header__topbar a:hover {
  color: #fff !important;
}

/* Topbar - Ícones específicos (incluindo caminhão de frete) */
.header__topbar-item i.fa-truck,
.header__topbar-item i.fa-envelope,
.header__topbar-item .fa {
  color: #fff !important;
}