/* ====================================
   HEADER COMPLETO - ARQUIVO UNIFICADO
   Todos os estilos do header centralizados
   ==================================== */

/* Header Glassmorphic Avançado */
header.header,
.header {
  position: static;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: 100;
  background:
    linear-gradient(135deg,
      rgba(15, 25, 55, 0.95) 0%,
      rgba(12, 20, 45, 0.98) 50%,
      rgba(18, 28, 60, 0.95) 100%
    );
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid rgba(39, 195, 216, 0.3);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: visible;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(39, 195, 216, 0.6) 25%,
    rgba(125, 245, 210, 0.8) 50%,
    rgba(39, 195, 216, 0.6) 75%,
    transparent 100%
  );
  animation: headerGlow 4s ease-in-out infinite alternate;
}

.header::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.25) 6px, transparent 8px),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.22) 8px, transparent 10px),
    radial-gradient(circle at 45% 70%, rgba(255, 255, 255, 0.18) 4px, transparent 6px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.2) 7px, transparent 9px),
    radial-gradient(circle at 25% 80%, rgba(255, 255, 255, 0.16) 3px, transparent 5px),
    radial-gradient(circle at 60% 25%, rgba(125, 245, 210, 0.05) 100px, transparent 102px),
    radial-gradient(circle at 30% 55%, rgba(39, 195, 216, 0.04) 80px, transparent 82px);
  opacity: 0.6;
  animation: headerSparkle 6s ease-in-out infinite;
}

/* Header Inner Container */
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  position: relative;
}

/* Brand/Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: 20px;
  color: #ffffff;
  transition: all 0.3s ease;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  transition: all 0.3s ease;
}

.brand span {
  background: linear-gradient(135deg, #ffffff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
  white-space: nowrap;
  overflow: visible;
}

/* ====================================
   SEARCH BAR - BARRA DE BUSCA COMPLETA
   Todos os estilos centralizados aqui
   ==================================== */

/* Container da barra de busca */
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 450px; /* Desktop: tamanho otimizado para centralização */
  margin: 0 auto;
  width: 100%;
}

/* Input principal */
.searchbar input,
#searchInput {
  width: 100%;
  padding: 12px 16px 12px 60px;
  border: 2px solid rgba(39, 195, 216, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(160%);
  outline: none;
  color: #1a202c;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s ease;
  box-shadow:
    0 6px 20px rgba(39, 195, 216, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 3px rgba(39, 195, 216, 0.12);
  transform: translateY(-1px);
}

/* Placeholder do input */
.searchbar input::placeholder,
#searchInput::placeholder {
  color: rgba(26, 32, 44, 0.6);
  font-weight: 500;
  font-size: 15px;
}

/* Estado de foco */
.searchbar input:focus,
#searchInput:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(39, 195, 216, 0.7);
  box-shadow:
    0 8px 28px rgba(39, 195, 216, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 4px rgba(39, 195, 216, 0.15);
  transform: translateY(-2px);
}

/* Ícone de busca */
.searchbar::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) scale(1.0);
  color: rgba(39, 195, 216, 0.9);
  font-size: 17px;
  z-index: 2;
  transition: all 0.3s ease;
  pointer-events: none;
}

/* Ícone no foco */
.searchbar:has(input:focus)::before {
  color: rgba(39, 195, 216, 0.9);
  transform: translateY(-50%) scale(1.15);
}

/* Overflow management para sugestões */
.searchbar,
.search-container,
.search-input,
.search-wrapper {
  overflow: visible;
  z-index: 1002;
}

/* RESPONSIVO - TABLET */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .searchbar {
    max-width: 400px; /* Tablet: proporcional ao novo layout */
  }
}

/* RESPONSIVO - MOBILE */
@media screen and (max-width: 768px) {
  .searchbar {
    grid-row: 2;
    max-width: 100%; /* Mobile: full width */
    margin: 0;
  }

  .searchbar input,
  #searchInput {
    font-size: 15px;
    padding: 11px 14px 11px 55px;
  }

  .searchbar::before {
    left: 16px;
    font-size: 16px;
  }
}

/* RESPONSIVO - MOBILE PEQUENO */
@media screen and (max-width: 480px) {
  .searchbar input,
  #searchInput {
    font-size: 14px;
    padding: 10px 12px 10px 50px;
  }

  .searchbar::before {
    left: 14px;
    font-size: 15px;
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

/* Icon Buttons (Carrinho) */
.icon-btn,
#openCart {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 10px 14px;
  border: 2px solid rgba(39, 195, 216, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(150%);
  color: #1a202c;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.4s ease;
  box-shadow:
    0 4px 16px rgba(39, 195, 216, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.icon-btn:hover,
#openCart:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(39, 195, 216, 0.6);
  transform: translateY(-3px);
  box-shadow:
    0 10px 30px rgba(39, 195, 216, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.icon-btn i,
#openCart i {
  color: rgba(39, 195, 216, 1);
  font-size: 20px;
  margin-bottom: 4px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.icon-btn:hover i,
#openCart:hover i {
  color: rgba(39, 195, 216, 1);
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(39, 195, 216, 0.3));
}

#openCart span:not(.badge) {
  font-size: 15px;
  font-weight: 700;
  color: rgba(39, 195, 216, 1);
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.icon-btn .badge,
#openCart .badge,
#cartCount {
  position: absolute;
  top: -8px;
  right: -12px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
}

/* Televendas Link */
.televendas-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, #FFFF00 0%, #FFD700 100%);
  backdrop-filter: blur(16px) saturate(150%);
  color: #00008B;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.4s ease;
  box-shadow:
    0 4px 16px rgba(255, 255, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.televendas-link:hover {
  background: linear-gradient(135deg, #FFFF33 0%, #FFE55C 100%);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(255, 255, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #00008B;
}

.televendas-link span:nth-child(1) {
  font-size: 15px;
  font-weight: 700;
  color: #00008B;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.televendas-link span:nth-child(2) {
  font-size: 13px;
  font-weight: 500;
  color: #00008B;
  opacity: 0.9;
}


/* Shine effect */
.televendas-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  transition: left 0.5s ease;
}

.televendas-link:hover::before {
  left: 100%;
}

/* RESPONSIVO - MOBILE - REMOVIDO CONFORME SOLICITADO */

/* Animações */
@keyframes headerGlow {
  0% {
    opacity: 0.6;
    transform: scaleX(0.8);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0.6;
    transform: scaleX(0.8);
  }
}

@keyframes headerSparkle {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

@keyframes whatsapp-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.televendas-link:hover i {
  animation: whatsapp-pulse 1s ease-in-out infinite;
}

/* Header Logo/Brand Image - Tamanhos específicos */
.header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Brand logo já tem tamanho definido nas linhas 88-95 */

/* Header Layout e Overflow Management */
.header,
.topbar,
nav {
  overflow: visible; /* Para sugestões de busca */
  z-index: 1000;
}

.header-inner {
  overflow: visible;
  z-index: 1001;
}

/* ====================================
   HEADER MOBILE - RESPONSIVO LIMPO
   Criado do zero, sem sobreposições
   ==================================== */

/* TABLET - Layout intermediário */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  /* Container principal - ajuste para tablets */
  .header-inner {
    max-width: 100%;
    padding: 14px 20px;
    gap: 16px;
  }

  /* Brand/Logo - redução moderada */
  .brand {
    font-size: 18px;
  }

  .brand-logo {
    width: 70px;
    height: 70px;
  }

  /* Search bar - REMOVIDO (centralizado na seção SEARCH BAR) */

  /* Botões - redução moderada */
  .icon-btn,
  #openCart,
  .televendas-link {
    padding: 9px 12px;
  }

  .icon-btn i,
  #openCart i {
    font-size: 18px;
  }

  #openCart span:not(.badge) {
    font-size: 14px;
  }

  .televendas-link span:nth-child(1) {
    font-size: 14px;
  }

  .televendas-link span:nth-child(2) {
    font-size: 12px;
  }
}

/* MOBILE - Layout vertical principal */
@media screen and (max-width: 768px) {
  /* Container principal - Grid vertical de 3 linhas */
  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 14px;
    padding: 14px 18px;
    max-width: 100%;
  }

  /* Linha 1: Brand centralizado */
  .brand {
    grid-row: 1;
    justify-self: center;
    font-size: 16px;
    gap: 12px;
  }

  .brand-logo {
    width: 65px;
    height: 65px;
  }

  /* Linha 2: Search bar - REMOVIDO (centralizado na seção SEARCH BAR) */

  /* Linha 3: Actions centralizadas horizontalmente */
  .header-actions {
    grid-row: 3;
    justify-content: center;
    gap: 14px;
    flex-wrap: nowrap;
  }

  /* Botões mobile - tamanhos equalizados */
  .icon-btn,
  #openCart,
  .televendas-link {
    padding: 8px 12px;
    min-width: 75px;
    font-size: 11px;
  }

  /* Ícones dos botões */
  .icon-btn i,
  #openCart i {
    font-size: 17px;
    margin-bottom: 3px;
  }

  /* Texto do carrinho */
  #openCart span:not(.badge) {
    font-size: 11px;
    line-height: 1.2;
  }

  /* Textos do televendas */
  .televendas-link span:nth-child(1) {
    font-size: 12px;
    margin-bottom: 1px;
  }

  .televendas-link span:nth-child(2) {
    font-size: 10px;
  }

  /* Badge - posicionamento ajustado */
  .icon-btn .badge,
  #openCart .badge,
  #cartCount {
    top: -6px;
    right: -10px;
    font-size: 8px;
    padding: 1px 4px;
  }
}

/* MOBILE PEQUENO - Otimizações para telas menores */
@media screen and (max-width: 480px) {
  /* Container mais compacto */
  .header-inner {
    padding: 12px 15px;
    gap: 12px;
  }

  /* Brand ainda menor */
  .brand {
    font-size: 15px;
    gap: 10px;
  }

  .brand-logo {
    width: 55px;
    height: 55px;
  }

  /* Search bar - REMOVIDO (centralizado na seção SEARCH BAR) */

  /* Actions mais próximas */
  .header-actions {
    gap: 10px;
  }

  /* Botões menores */
  .icon-btn,
  #openCart,
  .televendas-link {
    padding: 6px 10px;
    min-width: 65px;
    font-size: 10px;
  }

  /* Ícones menores */
  .icon-btn i,
  #openCart i {
    font-size: 15px;
    margin-bottom: 2px;
  }

  /* Texto carrinho - ocultar em telas muito pequenas */
  #openCart span:not(.badge) {
    font-size: 10px;
  }

  /* Televendas compacto */
  .televendas-link span:nth-child(1) {
    font-size: 11px;
  }

  .televendas-link span:nth-child(2) {
    font-size: 9px;
  }
}

/* MOBILE EXTRA PEQUENO - Telas muito pequenas */
@media screen and (max-width: 360px) {
  /* Container mínimo */
  .header-inner {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Brand mínimo */
  .brand {
    font-size: 14px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  /* Actions compactas */
  .header-actions {
    gap: 8px;
  }

  /* Botões mínimos */
  .icon-btn,
  #openCart,
  .televendas-link {
    padding: 5px 8px;
    min-width: 60px;
  }

  /* Ocultar texto do carrinho em telas muito pequenas */
  #openCart span:not(.badge) {
    display: none;
  }

  /* Televendas minimalista */
  .televendas-link span:nth-child(1) {
    font-size: 10px;
  }

  .televendas-link span:nth-child(2) {
    font-size: 8px;
  }
}

/* ACESSIBILIDADE - Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .header, .header-inner, .searchbar, .icon-btn, .televendas-link {
    transition: none;
    animation: none;
  }
}