/* ============================================
   HEADER PROFISSIONAL - NAVEGAÇÃO E CARRINHO
============================================ */

/* Container principal da navbar */
.navbar > .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 15px 0;
}

/* Logo e nome à esquerda */
.logo-nome {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.logo {
  width: 50px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.nome-empresa {
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  white-space: nowrap;
} /* ============================================
   MENU DESKTOP - POSICIONADO A 30% DA DIREITA
============================================ */

/* Container do menu desktop */
.d-none.d-lg-block {
  position: absolute;
  left: 70%;
  transform: translateX(-50%);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

/* Lista de navegação */
.d-none.d-lg-block .navbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}

/* Itens da navegação */
.d-none.d-lg-block .navbar-nav .nav-item {
  position: relative;
}

/* Links de navegação - TODOS (incluindo carrinho) */
.d-none.d-lg-block .navbar-nav .nav-link {
  color: white;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Efeito de sublinhado para TODOS os links */
.d-none.d-lg-block .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #0a5cff;
  transition: width 0.3s ease;
  border-radius: 1px;
}

/* Sublinhado ao passar mouse */
.d-none.d-lg-block .navbar-nav .nav-link:hover::after {
  width: 100%;
}

/* Sublinhado quando a página está ativa */
.d-none.d-lg-block .navbar-nav .nav-link.active::after {
  width: 100%;
  background: #0a5cff;
}

/* Cor do link ativo */
.d-none.d-lg-block .navbar-nav .nav-link.active {
  color: #0a5cff;
  font-weight: 600;
}

/* Carrinho com estilo especial */
.cart-icon-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Badge do carrinho */
.badge-carrinho {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #111;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   MENU DROPDOWN (3 BARRAS) - DESKTOP
============================================ */
/* Container do dropdown */
.dropdown.me-2.d-none.d-lg-block {
  margin-left: 10px;
}

/* Botão do menu dropdown */
.dropdown .btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.dropdown .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* ============================================
   BOTÃO MENU MÓVEL (TOGGLER)
============================================ */
.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  transition: all 0.3s ease;
  z-index: 1002;
}

.navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
}

/* ============================================
   MENU LATERAL MÓVEL - DRAWER PROFISSIONAL
============================================ */

/* Container do menu lateral (collapse) */
.navbar-collapse {
  position: fixed;
  top: 26vh;
  right: -10%; /* Inicialmente escondido */
  width: 10%;
  height: 80%;
  background: rgba(170, 193, 206, 0.72); /* Fundo azul escuro profissional */
  backdrop-filter: blur(10px);
  transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1001;
  padding: 0;
  margin: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
  display: block !important; /* Sobrescreve Bootstrap */
  visibility: hidden;
  opacity: 0;
}

/* Quando o menu está aberto */
.navbar-collapse.show {
  right: 0;
  visibility: visible;
  opacity: 1;
}

/* Lista do menu lateral */
#navbarNav .navbar-nav {
  padding: 80px 0 30px 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* Itens do menu lateral */
#navbarNav .navbar-nav .nav-item {
  margin: 0;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Links do menu lateral */
#navbarNav .navbar-nav .nav-link {
  padding: 16px 25px;
  color: rgba(62, 94, 201, 0.9);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 15px;
  width: 100%;
  background: transparent;
}

/* Hover dos links */
#navbarNav .navbar-nav .nav-link:hover {
  color: #0a5cff;
  padding-left: 30px;
}

/* Estado ativo dos links */
#navbarNav .navbar-nav .nav-link.active {
  background: rgba(10, 92, 255, 0.15);
  color: #0a5cff;
  border-left: 3px solid #0a5cff;
  font-weight: 100;
}

/* Carrinho no menu lateral */
#navbarNav .cart-icon-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Badge no menu lateral */
#navbarNav .badge-carrinho {
  position: static;
  margin-left: auto;
  top: 0;
  right: 0;
  min-width: 24px;
  height: 24px;
  font-size: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Overlay para fechar o menu */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(10, 27, 82, 0.49);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   PÁGINA ATIVA - SISTEMA UNIVERSAL
============================================ */

/* Este CSS funciona sem JavaScript adicional */
.nav-link[href="index.html"]:hover::after,
.nav-link[href="produtos.html"]:hover::after,
.nav-link[href="carrinho.html"]:hover::after,
.nav-link[href="contactos.html"]:hover::after {
  width: 100%;
}

/* Para página ativa via classe .active */
.nav-link.active::after {
  width: 100% !important;
}

/* ============================================
   RESPONSIVIDADE
============================================ */

@media (max-width: 1200px) {
  .d-none.d-lg-block {
    left: 65%;
  }

  .d-none.d-lg-block .navbar-nav {
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .d-none.d-lg-block {
    display: none !important;
  }

  /* Ajusta a largura do drawer para tablets */
  .navbar-collapse {
    width: 300px;
    right: -300px;
  }

  /* Container do navbar em telas pequenas */
  .navbar > .container {
    padding: 20px 0 !important;
    position: relative;
    z-index: 1002;
  }

  /* Garante que o cabeçalho fique acima do overlay */
  .navbar {
    position: relative;
    z-index: 1002;
  }
}

@media (max-width: 768px) {
  /* Ajusta a largura do drawer para mobile */
  .navbar-collapse {
    width: 280px;
    right: -280px;
  }
}

@media (max-width: 576px) {
  /* Drawer ocupa mais espaço em telas muito pequenas */
  .navbar-collapse {
    width: 60%;
    right: -60%;
  }
}
