/**
 * 01XSTUDIO - Header & Navigation Styles
 */

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand Logo */
.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img, .header-logo svg {
  height: 38px;
  width: auto;
}

/* Desktop Navigation Links */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  padding: 8px 0;
  letter-spacing: 0.01em;
}

.nav-link:hover, .nav-link.active {
  opacity: 1;
  font-weight: 600;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Dropdown Menu for Categories */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -20px;
  min-width: 220px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 8px 0;
  display: none;
  animation: dropDown 0.2s ease;
  z-index: 100;
}

.has-dropdown:hover .dropdown-menu {
  display: block;
}

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

.dropdown-item {
  display: block;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
  opacity: 1;
}

/* Header Action Icons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.action-btn {
  position: relative;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.action-btn:hover {
  background-color: var(--bg-secondary);
}

.action-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--accent);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Hamburger toggle for mobile drawer */
.menu-toggle {
  display: none;
}

/* Search Drawer Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

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

.search-drawer {
  background: #FFFFFF;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  max-width: 800px;
  margin: 0 auto;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-hover);
  animation: slideDown 0.3s ease;
}

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

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 10px;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  font-size: 1.25rem;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  outline: none;
}

.search-close-btn {
  font-size: 28px;
  line-height: 1;
  color: var(--text-primary);
}

.live-search-results {
  margin-top: 20px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.search-result-item:hover {
  background-color: var(--bg-secondary);
  opacity: 1;
}

.search-result-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-secondary);
}

.search-result-info h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.search-result-info span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Mobile Slide-out Menu */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: #FFFFFF;
  z-index: 2500;
  box-shadow: 2px 0 20px rgba(0,0,0,0.1);
  transition: left 0.3s ease;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.active {
  left: 0;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Mobile Bottom Navigation Bar (Fixed 5 Items) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--mobile-nav-height);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 900;
  padding: 0 10px;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.04);
}

.mobile-bottom-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  position: relative;
  height: 100%;
}

.mob-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
}

.mob-nav-item.active, .mob-nav-item:hover {
  color: var(--text-primary);
  opacity: 1;
}

.mob-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  background: var(--accent);
  color: #FFF;
  font-size: 0.6rem;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .mobile-bottom-nav {
    display: block;
  }
  body {
    padding-bottom: var(--mobile-nav-height);
  }
}
