/* ========================================
   HEADER - SEBO O ALFARRÁBIO
   CSS Melhorado e Responsivo
   ======================================== */

/* ========================================
   ESTRUTURA PRINCIPAL DO HEADER
   ======================================== */

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 2rem;
  background: var(--bg-header);
  height: 95px;
  box-shadow: 0 2px 10px var(--shadow-light);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ========================================
   CONTAINER LOGO + TÍTULO
   ======================================== */

/* ========================================
   LOGO CONTAINER (logo + nome lado a lado)
   ======================================== */

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Posicionamento apenas no desktop */
@media (min-width: 769px) {
  .logo-container {
    margin-right: 2rem;
    margin-left: -5rem;
    position: relative;
    right: 5rem;
  }
}

/* ========================================
   LOGO
   ======================================== */

.logo {
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
  box-shadow: 0 3px 8px var(--shadow-medium);
  flex-shrink: 0;

}

.logo:hover {
  transform: scale(1.05) rotate(5deg);
}

/* ========================================
   TÍTULO DO SITE
   ======================================== */

.alfa {
  font-family: 'Merriweather', serif;
  color: var(--text-primary);
  /* Darker brown for better contrast */
  font-size: 1.4em;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

/* ========================================
   NAVEGAÇÃO
   ======================================== */

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}

nav ul li {
  position: relative;
}

nav ul li a {
  text-decoration: none;
  font-weight: bold;
  font-family: 'Merriweather', serif;
  color: var(--text-primary);
  /* Darker brown for contrast */
  justify-content: center;
  align-items: center;
  display: flex;
  font-size: 1.2rem;
  padding: 0.6rem 1.2rem;
  min-height: 44px;
  /* Accessibility: Touch target */
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Efeito de sublinhado animado */
nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 80%;
}

nav ul li a:hover {
  color: var(--accent);
}

nav ul li a.active {
  color: var(--accent);
}

/* ========================================
   ÍCONE DE PERFIL
   ======================================== */

.user-profile-header {
  position: relative;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .user-profile-header {
    margin-left: 2rem;
    left: 5rem;
  }
}

.profile-btn-header {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 3px 10px var(--border-accent);
}

.profile-btn-header:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px var(--shadow-medium);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-dark));
}

.profile-btn-header:active {
  transform: scale(1.05);
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-name-header {
  color: #fff;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   DROPDOWN DO PERFIL
   ======================================== */

.profile-dropdown-header {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  background: var(--dropdown-bg);
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-medium);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden;
  border: 2px solid var(--border-accent);
  z-index: 1000;
}

/* Seta do dropdown */
.profile-dropdown-header::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 15px;
  height: 15px;
  background: var(--dropdown-bg);
  border-left: 2px solid var(--border-accent);
  border-top: 2px solid var(--border-accent);
  transform: rotate(45deg);
}

.user-profile-header:hover .profile-dropdown-header,
.profile-dropdown-header.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-user-info {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--dropdown-hover-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-user-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dropdown-user-name {
  display: block;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Merriweather', serif;
  word-break: break-all;
}

.profile-dropdown-header a {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: var(--dropdown-text);
  text-decoration: none;
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.profile-dropdown-header a:last-of-type {
  border-bottom: none;
}

.profile-dropdown-header a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--border-color), transparent);
  transition: width 0.3s ease;
}

.profile-dropdown-header a:hover::before {
  width: 100%;
}

.profile-dropdown-header a:hover {
  color: var(--accent);
  padding-left: 28px;
  background: var(--dropdown-hover-bg);
}

.profile-dropdown-header a i {
  margin-right: 12px;
  width: 20px;
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.profile-dropdown-header a:hover i {
  transform: scale(1.15);
}

.profile-dropdown-header hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   BOTÃO DO CARRINHO (se existir)
   ======================================== */

.btn-carrinho {
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 10px var(--border-accent);
}

@media (min-width: 769px) {
  .btn-carrinho {
    margin-left: 1rem;
    left: 5rem;
  }
}

.btn-carrinho:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-dark));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow-medium);
}

.cart-count {
  background: linear-gradient(135deg, #e63946, #dc2f3d);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}