/* ======================================================
   HEADER: tarja mobile, header desktop, menus, busca e
   dropdown. Carregado depois de index.css (head.ejs).
====================================================== */

.header-lg {
  display: none !important;
}

/* TARJA SUPERIOR - CTA de instalação (apenas mobile/tablet) */

/* a tarja gruda no topo enquanto este container estiver na tela; quando o
   rodape dele alcanca o rodape da tarja, o proprio sticky empurra a tarja
   para fora, deslizando junto com a rolagem */
.top-bar-sticky-area {
  position: relative;
}

.top-bar-install {
  position: sticky;
  top: 0;
  z-index: 110;
  padding: 7px 16px 9px;
  text-align: center;
}

.top-bar-install-text {
  display: grid;
  overflow: hidden;
  margin: 0 0 6px;
  font-family: "Poppins", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
}

/* carrossel de frases: todas na mesma celula do grid, entao a altura da
   tarja e a da frase mais alta e nao muda durante o ciclo */
.top-bar-phrase {
  grid-area: 1 / 1;
  align-self: center;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s;
}

.top-bar-phrase.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* a frase que esta saindo desliza para a esquerda */
.top-bar-phrase.is-leaving {
  transform: translateX(-100%);
}

@media (prefers-reduced-motion: reduce) {
  .top-bar-phrase {
    transition: none;
  }
}

.btn-top-install {
  display: inline-block;
  padding: 5px 15px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: #262626;
  background-color: #fcce0b;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-top-install:hover,
.btn-top-install:focus {
  background-color: #e6bb09;
  color: #262626;
}

.nav-link-custom-cart {
  display: flex;
  position: relative;
  text-decoration: none !important;
}

.nav-link-custom-cart svg {
  position: relative;
}

.nav-link-custom-cart span {
  font-size: .8em !important;
  position: relative;
  background-color: #fcce0b;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  left: -20%;
  font-weight: bolder;
  user-select: none;
  border: 2px solid #fff;
}

.item-menu-js {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

/* Mobile: até 600px */
@media (max-width: 600px) {
  .search-form {
    display: flex;
    margin-top: 6px;
  }

  /* lupa dentro do campo, ambos arredondados */
  .search-field {
    position: relative;
    width: 100%;
  }

  .search-input {
    width: 100%;
    padding-right: 48px !important;
    border-radius: 999px !important;
  }

  .search-button {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
  }

  .search-button svg {
    width: 15px !important;
    height: 15px !important;
    color: black !important;
  }
}

/* Tablet: 601px a 1024px */
@media (min-width: 601px) and (max-width: 1024px) {
  .search-form {
    display: flex;
    margin-top: 6px;
  }

  /* lupa dentro do campo, ambos arredondados */
  .search-field {
    position: relative;
    width: 100%;
  }

  .search-input {
    width: 100%;
    padding-right: 48px !important;
    border-radius: 999px !important;
  }

  .search-button {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
  }

  .search-button svg {
    width: 15px !important;
    height: 15px !important;
    color: black !important;
  }
}

/* Desktop: a partir de 1025px */
@media (min-width: 1025px) {
  .header-lg {
    display: block !important;
  }

  /* no desktop só a barra de menus (.header-lg-sticky) gruda no topo */
  header.header-lg {
    position: static;
  }

  .area-logo-lg {
    width: 160px;
    overflow: hidden;
  }

  .area-logo-lg img {
    width: 100%;
    object-fit: contain;
  }

  .nav-item-lg {
    margin-left: 3% !important;
  }

  /* HEADER LG - linha 1 (logo + busca + usuário/carrinho) */
  .header-lg-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .header-lg-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 6px 0 0;
  }

  /* carrossel de frases (reaproveita .top-bar-phrase) */
  .header-lg-phrases {
    display: grid;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding-right: 20px;
    border-right: 1px solid #54545466;
    text-align: right;
    font-size: 1rem;
    line-height: 1.2;
    color: #0c0c0cbb;
    font-weight: bold;
  }

  /* desktop: deslize curto (a area das frases e larga, 100% andaria demais) */
  .header-lg-phrases .top-bar-phrase {
    transform: translateX(40px);
  }

  .header-lg-phrases .top-bar-phrase.is-active {
    transform: translateX(0);
  }

  .header-lg-phrases .top-bar-phrase.is-leaving {
    transform: translateX(-40px);
  }

  .header-lg-topmenu {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .header-lg-topmenu a {
    font-size: 0.80rem;
    color: #545454bb;
    text-decoration: none;
  }

  .header-lg-topmenu a:hover {
    text-decoration: underline;
  }

  .header-lg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
  }

  /* busca + CTA, juntos no fim da linha dos menus */
  .header-lg-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* lupa dentro do campo, ambos arredondados */
  .header-lg-search {
    position: relative;
    flex: 0 0 auto;
  }

  .header-lg-search .form-control {
    width: 240px;
    padding-right: 46px;
    border-radius: 999px;
  }

  .header-lg-search .btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
  }

  .header-lg-search .btn svg {
    width: 14px;
    height: 14px;
  }

  /* HEADER LG - linha 2 (menus abaixo da logo + CTA) */
  .header-lg-menus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 8px 0 4px;
    border-top: 1px solid #eeeeee;
  }

  /* o header e a barra sticky são navs separados: tira o padding vertical
     do navbar que se somava e abria um vão entre a logo e os menus */
  header.header-lg > .navbar {
    padding-bottom: 0;
  }

  .header-lg-sticky > .navbar {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* barra de menus + busca gruda no topo ao rolar */
  .header-lg-sticky {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: #ffffff;
  }

  /* na página de produto a barra de menus rola junto com a página */
  .product-page .header-lg-sticky {
    position: static;
  }

  .header-lg-nav-list {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 0 !important;
  }

  .header-lg-actions .btn-schedule-install {
    padding: 7px 20px;
    font-weight: 600;
    color: #262626;
    white-space: nowrap;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.2s ease;
  }

  .header-lg-actions .btn-schedule-install:hover {
    background-color: #ffc400 !important;
    color: #262626;
  }

  /* HEADER LG - links e dropdowns dos menus */
  .header-lg-nav-list > .nav-item > .nav-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .header-lg-nav-list > .nav-item > .nav-link:hover,
  .header-lg-nav-list > .nav-item > .nav-link:focus,
  .header-lg-nav-list > .nav-item > .nav-link.show {
    background-color: #f6f6f6;
    color: #000000 !important;
  }

  /* sem a borda azul de foco que o hover (dropdown.show) deixava no menu */
  .header-lg-nav-list > .nav-item > .nav-link:focus,
  .header-lg-nav-list > .nav-item > .nav-link:focus-visible {
    outline: none;
    box-shadow: none;
  }

  /* seta em chevron: para baixo fechado, para cima e amarela quando aberto */
  .header-lg-nav-list .dropdown-toggle::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 10px;
    margin-bottom: 3px;
    border: 0;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    border-radius: 2px;
    vertical-align: middle;
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .header-lg-nav-list .dropdown-toggle.show::after {
    margin-bottom: 0;
    border-right-color: #d6af09;
    border-bottom-color: #d6af09;
    transform: rotate(-135deg);
  }

  .header-lg-nav-list .dropdown-menu {
    min-width: 260px;
    margin-top: 10px;
    padding: 8px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    animation: headerDropdownIn 0.18s ease-out;
  }

  /* faixa amarela no topo do dropdown */
  .header-lg-nav-list .dropdown-menu::before {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin: 0 0 8px 12px;
    border-radius: 3px;
    background-color: #fcce0b;
  }

  .header-lg-nav-list .dropdown-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333333;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease,
      padding-left 0.2s ease;
  }

  .header-lg-nav-list .dropdown-item:hover,
  .header-lg-nav-list .dropdown-item:focus {
    background-color: #fff8db;
    color: #000000;
    padding-left: 18px;
  }

  .header-lg-nav-list .dropdown-item:active {
    background-color: #fcce0b;
    color: #262626;
  }

  @keyframes headerDropdownIn {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .area-menus-nav-lg {
    display: flex;
    flex-grow: 1;
    gap: 1rem;

  }
}
