/* ================================
   ORAL CLÍNICA - HEADER STYLES
   Sistema de Navegação Global
   ================================ */

/* ================================
   1. HEADER CONTAINER
   ================================ */

.header {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--color-white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  padding: 0 40px;
}

@media (max-width: 767px) {
  .header-content {
    height: 60px;
    padding: 0 16px;
  }
}

/* ================================
   2. LOGO
   ================================ */

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition-base);
  z-index: 1001;
}

.logo:hover {
  opacity: 0.8;
}

/* Logo como imagem */
.logo img,
.logo-img {
  height: 60px;
  width: auto;
  display: block;
}

@media (max-width: 767px) {
  .logo img,
  .logo-img {
    height: 45px;
  }
}

/* Logo como texto (placeholder) */
.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

@media (max-width: 767px) {
  .logo-text {
    font-size: 20px;
  }
}

/* ================================
   3. NAVEGAÇÃO DESKTOP
   ================================ */

.nav-menu {
  display: none;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    margin: 0 24px;
  }
}

.nav-menu ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-menu ul {
    gap: 16px;
  }
}

.nav-item a {
  display: block;
  color: var(--color-neutral-dark);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  position: relative;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-item a {
    font-size: 15px;
    padding: 8px 10px;
  }
}

.nav-item a:hover {
  color: var(--color-primary);
  background-color: rgba(0, 102, 204, 0.05);
}

.nav-item a.active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-item a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background-color: var(--color-primary);
}

/* ================================
   4. BOTÃO CTA (DESKTOP)
   ================================ */

.header-cta {
  display: none;
}

@media (min-width: 768px) {
  .header-cta {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
  }

  .header-cta:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
  }

  .header-cta:active {
    transform: translateY(0);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .header-cta {
    padding: 8px 16px;
    font-size: 15px;
  }
}

/* ================================
   5. ÍCONE HAMBÚRGUER (MOBILE)
   ================================ */

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--color-neutral-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animação do hambúrguer para X */
.hamburger.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translateY(9px);
}

.hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translateY(-9px);
}

/* ================================
   6. OVERLAY MOBILE
   ================================ */

.mobile-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.visible {
  display: block;
  opacity: 1;
}

@media (min-width: 768px) {
  .mobile-overlay {
    display: none !important;
  }
}

/* ================================
   7. MENU MOBILE
   ================================ */

.mobile-menu {
  position: fixed;
  top: 60px;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: calc(100vh - 60px);
  background: var(--color-white);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow-y: auto;
  padding: 24px 16px;
}

.mobile-menu.open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Lista de navegação mobile */
.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid var(--color-neutral-light);
}

.mobile-nav-list li:last-child {
  border-bottom: none;
}

.mobile-nav-list a {
  display: block;
  padding: 16px 0;
  color: var(--color-neutral-dark);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-base);
}

.mobile-nav-list a:hover,
.mobile-nav-list a.active {
  color: var(--color-primary);
}

.mobile-nav-list a.active {
  font-weight: 600;
}

/* CTA dentro do menu mobile */
.mobile-cta {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-neutral-light);
}

.mobile-cta .btn-primary {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 24px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

.mobile-cta .btn-primary:hover {
  background: var(--color-primary-hover);
}

/* ================================
   8. BLOQUEIO DE SCROLL (MOBILE MENU ABERTO)
   ================================ */

body.no-scroll {
  overflow: hidden;
}

@media (min-width: 768px) {
  body.no-scroll {
    overflow: auto;
  }
}

/* ================================
   9. ESTADOS DE FOCO (ACESSIBILIDADE)
   ================================ */

.nav-item a:focus-visible,
.header-cta:focus-visible,
.hamburger:focus-visible,
.mobile-nav-list a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ================================
   10. AJUSTES PARA HEADER FIXO
   ================================ */

/* Adicionar padding-top ao body para compensar header fixo */
body {
  padding-top: 0;
}

/* Classe auxiliar para smooth scroll */
html {
  scroll-behavior: smooth;
}

/* ================================
   11. ANIMAÇÕES ADICIONAIS
   ================================ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ================================
   12. UTILITÁRIOS ESPECÍFICOS
   ================================ */

/* Evitar quebra de texto nos itens de menu */
.nav-item {
  white-space: nowrap;
}

/* Garantir que o header esteja sempre por cima */
.header * {
  box-sizing: border-box;
}
