/**
 * 6DDrones - Header Stylesheet (Current Design)
 * Identidade Visual 6DDrones: Botões com Chanfro Exato (polygon) e Tipografia Barlow Condensed
 */

#header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(245, 248, 252, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--borda, rgba(26, 76, 153, 0.16));
  box-shadow: 0 2px 18px rgba(26, 76, 153, 0.07);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

/* Logo - Botão de Início */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.9;
}

.brand-logo img {
  height: 44px;
  width: auto;
  display: block;
}

/* Navegação Principal */
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--texto-sec, #1E2E42);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

nav.main-nav a:hover,
nav.main-nav a.ativo {
  color: var(--azul-vivo, #2563C8);
}

/* Agrupamento da Direita: Botões e Hamburguer */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Ações - Botões Lado a Lado Sempre com Identidade Visual 6DDrones */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Botão com Chanfro Oficial 6DDrones */
.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 44px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.btn-header:visited,
.btn-header:hover {
  color: #ffffff !important;
}

.btn-header:active {
  transform: scale(0.96);
}

.btn-header svg {
  flex-shrink: 0;
  stroke: #ffffff;
}

/* WhatsApp */
.btn-header.wpp {
  background: #25D366;
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

.btn-header.wpp svg {
  stroke: none !important;
  fill: #ffffff !important;
}

.btn-header.wpp:hover {
  background: #1ebd57;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* Solicitar Proposta / Inspeção */
.btn-header.cal,
.btn-header.proposal {
  background: var(--azul, #1A4C99);
  box-shadow: 0 2px 10px rgba(26, 76, 153, 0.25);
}

.btn-header.cal:hover,
.btn-header.proposal:hover {
  background: var(--azul-vivo, #2563C8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 200, 0.35);
}

/* Textos adaptativos */
.btn-header .txt-mob {
  display: none;
}

.btn-header .txt-desk {
  display: inline;
}

/* Dropdown Contato */
.header-contact-dropdown {
  position: relative;
  display: inline-block;
}

.header-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dropdown-chevron {
  transition: transform 0.25s ease;
  margin-left: 2px;
}

.contact-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 270px;
  background: #0d2140;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  padding: 8px 0;
}

@media (hover: hover) and (pointer: fine) {
  .header-contact-dropdown:hover .contact-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .header-contact-dropdown:hover .dropdown-chevron {
    transform: rotate(180deg);
  }
}

.header-contact-dropdown.active .contact-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.header-contact-dropdown.active .dropdown-chevron {
  transform: rotate(180deg);
}

.contact-dropdown-item {
  display: block;
  padding: 12px 18px;
  text-decoration: none !important;
  transition: background 0.2s ease, padding-left 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.contact-dropdown-item:last-child {
  border-bottom: none;
}

.contact-dropdown-item:hover,
.contact-dropdown-item:focus {
  background: rgba(37, 99, 200, 0.4);
  padding-left: 22px;
}

.contact-dropdown-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-dropdown-item .item-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-dropdown-item .item-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.3;
  font-weight: 400;
}

/* Botão Hamburguer Mobile com o mesmo chanfro */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--azul, #1A4C99);
  color: #ffffff;
  border: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: background 0.2s ease;
  line-height: 0;
}

.mobile-toggle:hover {
  background: var(--azul-vivo, #2563C8);
}

.mobile-toggle svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

/* Responsividade: Tablet (<= 1150px) */
@media (max-width: 1150px) {
  nav.main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    flex-direction: column;
    padding: 20px 24px;
    gap: 12px;
    border-bottom: 2px solid var(--azul-vivo, #2563C8);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  }

  nav.main-nav.aberto {
    display: flex;
    animation: fadeInMenu 0.2s ease-out;
  }

  nav.main-nav a {
    display: block;
    padding: 12px 16px;
    background: #F8FAFC;
    border-radius: 6px;
    font-size: 16px;
  }

  nav.main-nav a:hover,
  nav.main-nav a.ativo {
    background: rgba(37, 99, 200, 0.08);
  }

  .mobile-toggle {
    display: flex;
  }

  .header-right {
    gap: 10px;
  }
}

/* Responsividade: Smartphone (<= 768px) */
@media (max-width: 768px) {
  .header-inner {
    height: 64px;
  }

  nav.main-nav {
    top: 64px;
  }

  .brand-logo img {
    height: 36px;
  }

  .header-actions {
    gap: 8px;
  }

  .btn-header {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .mobile-toggle {
    width: 40px;
    height: 40px;
  }
}

/* Responsividade: Telas Ultra-Estreitas (<= 460px) */
@media (max-width: 460px) {
  .header-inner {
    padding-left: 10px;
    padding-right: 10px;
    gap: 6px;
  }

  .brand-logo img {
    height: 30px;
  }

  .btn-header {
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
    gap: 6px;
  }

  .btn-header.wpp {
    padding: 0;
    width: 38px;
    justify-content: center;
  }

  .btn-header.wpp .txt-desk {
    display: none;
  }

  .btn-header.cal .txt-desk,
  .btn-header.proposal .txt-desk {
    display: none;
  }

  .btn-header.cal .txt-mob,
  .btn-header.proposal .txt-mob {
    display: inline;
  }

  .mobile-toggle {
    width: 38px;
    height: 38px;
  }
}

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