/* =========================================================
   Cabeçalho desktop — pills no padrão da toolbar
   Escopo: header .header-action (não altera logo nem header mobile)
   Tokens: --ht-* / --um-* em app-light.css / app-dark.css (:root)
   ========================================================= */

header .header-action .pesquisa {
  gap: 10px;
}

header .header-action .header-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  min-height: 40px;
  height: 40px;
  overflow: visible;
  border: 1px solid var(--ht-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

header .header-action .header-toolbar__btn,
header .header-action .header-toolbar__icon,
header .header-action .header-toolbar__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--ht-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

header .header-action .header-toolbar__icon {
  width: 34px;
  min-width: 34px;
  padding: 0;
  color: var(--ht-muted);
  font-size: 16px;
}

header .header-action .header-toolbar__btn:hover,
header .header-action .header-toolbar__icon:hover,
header .header-action .header-toolbar__login:hover {
  color: var(--ht-ink);
  background: var(--ht-hover);
}

header .header-action .header-toolbar__btn i,
header .header-action .header-toolbar__login i {
  margin-right: 8px;
  font-size: 15px;
}

/* Busca e placa — mesmo tamanho de antes */
header .header-action #formsearch {
  margin-right: 0 !important;
}

header .header-action #formsearchPlate .ms-md-2 {
  margin-left: 0 !important;
}

header .header-action #formsearch,
header .header-action #formsearchPlate #form-placa form,
header .header-action #formsearchPlate .position-relative {
  height: 40px;
}

header .header-action #formsearch input,
header .header-action #form-placa #placa,
header .header-action #form-placa #chassi {
  height: 40px !important;
  min-height: 40px;
  border: 1px solid var(--ht-border) !important;
  background: var(--ht-surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
  color: var(--ht-ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}
header .header-action #formsearch input:focus,
header .header-action #form-placa #placa:focus,
header .header-action #form-placa #chassi:focus {
  -webkit-border-top-left-radius: 8px;
  -webkit-border-top-right-radius: 8px;
  -moz-border-radius-topleft: 8px;
  -moz-border-radius-topright: 8px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}


header .header-action #formsearch input {
  padding: 0 40px;
}

header .header-action #form-placa #placa,
header .header-action #form-placa #chassi {
  padding-left: 40px;
  padding-right: 40px;
}

header .header-action #formsearch input:focus,
header .header-action #form-placa #placa:focus,
header .header-action #form-placa #chassi:focus {
  border-color: color-mix(in srgb, var(--ht-accent) 40%, var(--ht-border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ht-accent) 12%, transparent);
}

header .header-action #formsearch input::placeholder,
header .header-action #form-placa #placa::placeholder,
header .header-action #form-placa #chassi::placeholder {
  color: var(--ht-muted);
  text-transform: none;
}

header .header-action .btn-search,
header .header-action .btn-search.disabled {
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-size: 16px;
  color: var(--ht-muted);
}

header .header-action .plate-type {
  top: 50%;
  bottom: auto;
  right: 10px;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--ht-muted);
}

header .header-action #formsearch .filter-search,
header .header-action #form-placa .filter-search,
header .header-action .plate-search-close {
  top: 11px;
}

/* Idioma */
header .header-action .idiomas__toggle {
  min-width: 36px;
  min-height: 36px;
}

header .header-action .idiomas__toggle .flag-icon,
header .header-action .idiomas__toggle span.flag-icon {
  width: 26px !important;
  height: 26px !important;
}

/* Grupo de ícones */
header .header-action .header-toolbar--icons {
  margin-left: auto;
  margin-right: 0 !important;
  padding: 3px;
  height: 40px;
}

header .header-action .header-toolbar--icons > a:not(.header-toolbar__login),
header .header-action .header-toolbar--icons > div > a,
header .header-action .header-toolbar--icons .style-switcher-toggle,
header .header-action .header-toolbar--icons .notification-icon,
header .header-action .header-toolbar--icons .cart-icon,
header .header-action .header-toolbar--icons .user-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin: 0 !important;
  padding: 0;
  border-radius: 8px;
  color: var(--ht-ink);
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}

header .header-action .header-toolbar--icons > a:hover,
header .header-action .header-toolbar--icons > div > a:hover,
header .header-action .header-toolbar--icons .style-switcher-toggle:hover {
  color: var(--ht-ink);
  background: var(--ht-hover);
}

header .header-action .header-toolbar--icons .session-button-share,
header .header-action .header-toolbar--icons .alerta-not,
header .header-action .header-toolbar--icons .user-menu,
header .header-action .header-toolbar--icons .ms-auto,
header .header-action .header-toolbar--icons > div {
  margin: 0 !important;
}

header .header-action .header-toolbar__login {
  margin-left: 0;
  text-transform: none;
  letter-spacing: 0;
}

/* Menu */
header .header-action .sub-header > div {
  height: auto;
  min-height: 38px;
}

header .header-action .homemenu > a {
  display: inline-flex;
  align-items: center;
  color: var(--ht-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 10px;
  border-bottom: 0;
  border-radius: 8px;
}

header .header-action .homemenu > a:hover {
  color: var(--ht-ink);
  background: var(--ht-hover);
}

header .header-action .homemenu.active > a {
  color: #FFF;
  background: color-mix(in srgb, var(--ht-accent) 10%, transparent);
  border-bottom: 0;
  font-weight: 500;
}

/* Telas 768–1199px: busca ao lado do logo, só ícones e menu rolável */
@media (min-width: 768px) and (max-width: 1199px) {
  header .header-action {
    min-width: 0;
  }

  header .header-action .pesquisa {
    min-width: 0;
    gap: 6px;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  header .header-action #formsearch {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  header .header-action #formsearch,
  header .header-action #formsearchPlate #form-placa form,
  header .header-action #formsearchPlate .position-relative,
  header .header-action #formsearch input,
  header .header-action #form-placa #placa,
  header .header-action #form-placa #chassi,
  header .header-action .btn-search,
  header .header-action .btn-search.disabled {
    height: 36px !important;
    min-height: 36px;
  }

  header .header-action .btn-search,
  header .header-action .btn-search.disabled {
    line-height: 36px;
  }

  header .header-action #formsearch input,
  header .header-action #form-placa #placa,
  header .header-action #form-placa #chassi {
    font-size: 13px;
  }

  header .header-action #form-placa #placa,
  header .header-action #form-placa #chassi {
    min-width: 170px;
    max-width: 170px;
  }

  header .header-action #formsearch .filter-search,
  header .header-action #form-placa .filter-search,
  header .header-action .plate-search-close {
    top: 9px;
  }

  header .header-action .header-toolbar,
  header .header-action .header-toolbar--icons {
    min-height: 36px;
    height: 36px;
  }

  header .header-action .header-toolbar__btn,
  header .header-action .header-toolbar__icon,
  header .header-action .header-toolbar__login,
  header .header-action .header-toolbar--icons > a:not(.header-toolbar__login),
  header .header-action .header-toolbar--icons > div > a,
  header .header-action .header-toolbar--icons .style-switcher-toggle {
    min-height: 30px;
    height: 30px;
  }

  header .header-action .header-toolbar--icons > a:not(.header-toolbar__login),
  header .header-action .header-toolbar--icons > div > a,
  header .header-action .header-toolbar--icons .style-switcher-toggle {
    width: 30px;
    min-width: 30px;
    font-size: 16px;
  }

  header .header-action .vehicle-control .header-toolbar__btn {
    width: 30px;
    padding: 0;
  }

  header .header-action .vehicle-control .header-toolbar__btn i {
    margin-right: 0;
  }

  header .header-action .vehicle-control .header-toolbar__btn span {
    display: none;
  }

  header .header-action .sub-header > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  header .header-action .sub-header > div::-webkit-scrollbar {
    display: none;
  }

  header .header-action .homemenu,
  header .header-action .homemenu > a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  header .header-action .homemenu > a {
    font-size: 12px;
    padding: 7px 8px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  header .header-action .pesquisa > .header-toolbar__icon {
    display: none;
  }

  header .header-action #form-placa #placa,
  header .header-action #form-placa #chassi {
    min-width: 150px;
    max-width: 150px;
    padding-left: 34px;
    padding-right: 30px;
  }

  header .header-action .header-toolbar__login {
    width: 30px;
    padding: 0;
  }

  header .header-action .header-toolbar__login i {
    margin-right: 0;
  }

  header .header-action .header-toolbar__login span {
    display: none;
  }
}

/* =========================================================
   Submenu do usuário (popover)
   ========================================================= */

#popover-user-menu {
  width: 240px;
  right: 16px;
  top: 52px;
  padding: 0;
  overflow: hidden;
  background: var(--um-surface);
  border: 1px solid var(--um-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgb(15 23 42 / 12%);
}

#popover-user-menu .arrow {
  display: none;
}

#popover-user-menu .popover-body {
  padding: 6px !important;
  background: transparent;
  color: var(--um-ink);
}

#popover-user-menu .user-menu-label {
  padding: 8px 10px 6px;
  color: var(--um-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#popover-user-menu .user-menu-grid {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

#popover-user-menu .user-menu-grid li {
  display: block;
  list-style: none;
  border: 0;
  background: transparent;
}

#popover-user-menu .user-menu-grid li:hover {
  background: transparent;
}

#popover-user-menu .user-menu-grid li a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--um-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

#popover-user-menu .user-menu-grid li a:hover,
#popover-user-menu .user-menu-grid li a:focus {
  color: var(--um-ink);
  background: var(--um-hover);
}

#popover-user-menu .user-menu-grid li a i {
  flex: 0 0 18px;
  width: 18px;
  margin-right: 0;
  color: var(--um-muted);
  font-size: 14px;
  text-align: center;
}

#popover-user-menu .user-menu-grid li a:hover i {
  color: var(--um-accent);
}

#popover-user-menu .user-menu-grid li a .text,
#popover-user-menu .user-menu-grid li a .text-add,
#popover-user-menu .user-menu-grid li a .text-remove {
  flex: 1 1 auto;
}

#popover-user-menu .n-comparar-p {
  margin-left: auto;
}

#popover-user-menu .n-comparar-p span.alerts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 0;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--um-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

#popover-user-menu .user-menu-grid__logout {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--um-border);
}

#popover-user-menu .user-menu-grid__logout a,
#popover-user-menu .user-menu-grid__logout a i {
  color: #dc2626;
}

#popover-user-menu .user-menu-grid__logout a:hover,
#popover-user-menu .user-menu-grid__logout a:focus {
  color: #dc2626;
  background: #fef2f2;
}

@media (max-width: 767px) {
  #popover-user-menu {
    top: 65px;
    right: 10px;
  }
}
