/* =====================
   HEADER STYLES
===================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.main-header {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Top Bar */
.header-topbar {
  background: #F37021;
  color: #fff;
  font-size: 13px;
  padding: 8px 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-topbar .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-left span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.price-badge {
  background: #F37021;
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.topbar-right {
  display: flex;
  gap: 24px;
  align-items: center;
}

.topbar-right a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s;
}

.topbar-right a:hover {
  opacity: 0.8;
}

/* Main Header */
.header-main {
  background: #1a1a1a;
  padding: 20px 0;
  border-bottom: 1px solid #333;
}

.header-main .header-container {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-logo {
  flex-shrink: 0;
}

.header-logo img {
  height: 90px;
  width: auto;
  filter: brightness(1.1) contrast(1.1);
}

.header-search {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.header-search form {
  display: flex;
  border: 2px solid #F37021;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.header-search input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  outline: none;
  font-size: 14px;
  background: #fff;
  color: #333;
}

.header-search button {
  background: #F37021;
  border: none;
  padding: 0 24px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 16px;
}

.header-search button:hover {
  background: #d96419;
}

/* Search Results Autocomplete */
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #F37021;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
}

.search-results.active {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s;
}

.search-item:last-of-type {
  border-bottom: none;
}

.search-item:hover {
  background: #fff5f0;
  padding-left: 20px;
}

.search-item.produto-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.search-item .item-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 112, 33, 0.1);
  border-radius: 8px;
  color: #F37021;
  font-size: 1.5rem;
}

.search-item .item-info {
  flex: 1;
}

.search-item .item-title {
  font-weight: 600;
  color: #2E2E2E;
  margin-bottom: 4px;
  font-size: 14px;
}

.search-item .item-subtitle {
  font-size: 12px;
  color: #666;
}

.search-item .item-price {
  font-weight: 700;
  color: #F37021;
  font-size: 14px;
  margin-top: 4px;
}

.search-item > i {
  color: #ccc;
  transition: all 0.3s;
}

.search-item:hover > i,
.search-item.focused > i {
  color: #F37021;
  transform: translateX(5px);
}

.search-item.focused {
  background: #fff9f5;
  border-left: 3px solid #F37021;
}

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.search-empty i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.3;
}

.search-empty p {
  margin: 0;
  font-size: 14px;
}

.search-footer {
  padding: 12px 16px;
  background: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.search-footer a {
  color: #F37021;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.search-footer a:hover {
  gap: 12px;
}

.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #F37021;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #d96419;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.3s;
  order: -1;
}

.mobile-menu-toggle:hover {
  color: #F37021;
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.mobile-menu-toggle.active i::before {
  content: "\f00d";
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}

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

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  transition: color 0.3s;
}

.header-user:hover {
  color: #F37021;
}

.header-user i {
  font-size: 32px;
  color: #F37021;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-greeting {
  font-size: 12px;
  color: #ccc;
}

.user-link {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.header-user:hover .user-link {
  color: #F37021;
}

.header-wishlist,
.header-social {
  position: relative;
  color: #fff;
  font-size: 24px;
  transition: all 0.3s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-wishlist:hover,
.header-social:hover {
  color: #F37021;
  transform: scale(1.1);
}

.header-social.whatsapp:hover {
  color: #25D366;
}

/* Navigation */
.header-nav {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.nav-departments {
  position: relative;
}

.departments-btn {
  background: #F37021;
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  transition: background 0.3s;
}

.departments-btn:hover {
  background: #d96419;
}

.departments-btn i {
  font-size: 16px;
}

.departments-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 4px;
  margin-top: 8px;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.departments-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.departments-menu ul {
  list-style: none;
  padding: 8px 0;
}

.departments-menu li {
  border-bottom: 1px solid #f0f0f0;
}

.departments-menu li:last-child {
  border-bottom: none;
}

.departments-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.departments-menu a:hover {
  background: #fff5f0;
  color: #F37021;
  padding-left: 24px;
}

.departments-menu i {
  color: #F37021;
  font-size: 12px;
}

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

.nav-menu li {
  position: relative;
}

/* Ocultar itens mobile-only no desktop */
.mobile-only {
  display: none;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  border-radius: 4px;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: #f8f8f8;
  color: #F37021;
}

.nav-item-featured a {
  background: #fff5f0;
  color: #F37021;
  font-weight: 600;
}

.nav-item-featured a i {
  color: #ff6b00;
}

.nav-item-featured a:hover {
  background: #ffe8d6;
}

.nav-admin {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.admin-link,
.logout-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.3s;
}

.admin-link:hover {
  background: #F37021;
  color: #fff;
}

.logout-link:hover {
  background: #dc3545;
  color: #fff;
}

/* Responsive */
@media (max-width: 1200px) {
  .nav-menu a {
    padding: 14px 12px;
    font-size: 13px;
  }
}

@media (max-width: 992px) {
  .header-topbar {
    font-size: 12px;
  }

  .topbar-right {
    gap: 16px;
  }

  .topbar-right a {
    font-size: 12px;
  }

  .header-main .header-container {
    gap: 20px;
  }

  .header-search {
    max-width: 400px;
  }

  .nav-menu {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  /* Topbar Mobile - Simplificada */
  .header-topbar {
    padding: 6px 0;
  }

  .header-topbar .header-container {
    flex-direction: column;
    gap: 6px;
    padding: 0 10px;
  }

  .topbar-left {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .topbar-left span {
    font-size: 10px;
    gap: 4px;
  }

  .price-badge {
    padding: 4px 10px;
    font-size: 10px;
  }

  .topbar-left span i {
    font-size: 10px;
  }

  .topbar-right {
    display: none;
  }

  /* Header Main Mobile - Layout Limpo */
  .header-main {
    padding: 10px 0;
  }

  .header-main .header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
    align-items: center;
  }

  .mobile-menu-toggle {
    display: block !important;
    grid-column: 1;
    grid-row: 1;
    font-size: 24px;
    padding: 8px;
  }

  .header-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .header-logo img {
    height: 35px;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
    gap: 10px;
    display: flex;
    align-items: center;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
    width: 100%;
  }

  .header-search input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .header-search button {
    padding: 0 16px;
    font-size: 14px;
  }

  .user-text {
    display: none;
  }

  .header-actions .header-user i,
  .header-actions .header-wishlist i,
  .header-actions .header-social i {
    font-size: 20px;
  }

  /* Menu Lateral Mobile */
  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  }

  .header-nav.mobile-active {
    right: 0;
  }

  .nav-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  /* Cabeçalho do Menu Mobile */
  .nav-wrapper::before {
    content: '';
    display: block;
    background: linear-gradient(135deg, #F37021 0%, #d96419 100%);
    padding: 20px;
    margin-bottom: 15px;
    background-image: url('/logo/logo.png');
    background-size: 120px;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 80px;
  }

  .nav-departments {
    margin: 0 20px 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
  }

  .departments-btn {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 6px;
  }

  .departments-menu {
    position: static;
    box-shadow: none;
    margin-top: 10px;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    border-radius: 6px;
    overflow: hidden;
  }

  .departments-menu.active {
    display: block;
  }

  .departments-menu a {
    font-size: 12px;
    padding: 12px 16px;
    background: #fafafa;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0;
    margin: 0 20px;
  }

  /* Mostrar itens mobile-only no mobile */
  .mobile-only {
    display: block !important;
  }

  .nav-menu li {
    border-bottom: 1px solid #f0f0f0;
  }

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

  .nav-menu a {
    padding: 14px 0;
    border-radius: 0;
    font-size: 13px;
  }

  .nav-item-page a {
    background: transparent;
    color: #F37021;
    font-weight: 600;
    font-size: 14px;
    padding: 16px 0;
  }

  .nav-item-page a:hover {
    background: #fff5f0;
    padding-left: 10px;
  }

  .nav-divider {
    height: 2px;
    background: #f0f0f0;
    margin: 15px 0;
    border: none;
  }

  .nav-item-featured a {
    background: transparent;
    color: #F37021;
    font-weight: 600;
    font-size: 14px;
  }

  .nav-admin {
    flex-direction: column;
    margin: 20px 20px 0;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    gap: 10px;
  }

  .admin-link,
  .logout-link {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 12px 16px;
    border-radius: 6px;
  }
}

@media (max-width: 576px) {
  .header-container {
    padding: 0 10px;
  }

  .topbar-left span {
    font-size: 9px;
  }

  .price-badge {
    font-size: 9px;
    padding: 3px 8px;
  }

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

  .header-actions {
    gap: 8px;
  }

  .header-actions .header-user i,
  .header-actions .header-wishlist i,
  .header-actions .header-social i {
    font-size: 18px;
  }

  .mobile-menu-toggle {
    font-size: 22px;
  }

  .header-search input {
    font-size: 12px;
    padding: 8px 10px;
  }

  .departments-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  .nav-wrapper::before {
    background-size: 100px;
    min-height: 70px;
  }
}
