/**
 * ===================================
 * HEADER FIXES CSS - CAMPING JOURNEY
 * Additional fixes for header functionality
 * ===================================
 */

/* Ensure hamburger menu works correctly */
.hamburger-menu {
  z-index: 1001 !important;
  position: relative;
}

.hamburger-menu.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.2) 100%) !important;
  border-color: rgba(212, 175, 55, 0.8) !important;
}

/* Hamburger menu overlay improvements */
.hamburger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

.hamburger-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hamburger panel improvements */
.hamburger-panel {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.hamburger-panel.active {
  transform: translateX(0) !important;
}

/* Mobile menu compatibility (alternative naming) */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

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

/* Enhanced panel animations */
.hamburger-panel {
  will-change: transform;
}

.hamburger-panel.opening {
  animation: slideInFromLeft 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hamburger-panel.closing {
  animation: slideOutToLeft 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutToLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0.8;
  }
}

/* Stagger animation for menu items */
.hamburger-panel.active .section-links li {
  animation: fadeInUp 0.4s ease forwards;
}

.hamburger-panel.active .section-links li:nth-child(1) { animation-delay: 0.1s; }
.hamburger-panel.active .section-links li:nth-child(2) { animation-delay: 0.15s; }
.hamburger-panel.active .section-links li:nth-child(3) { animation-delay: 0.2s; }
.hamburger-panel.active .section-links li:nth-child(4) { animation-delay: 0.25s; }
.hamburger-panel.active .section-links li:nth-child(5) { animation-delay: 0.3s; }

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

/* Enhanced hamburger menu toggle animations */
.menu-toggle,
.hamburger-menu {
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.menu-toggle span,
.hamburger-line {
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-origin: center;
}

/* Active state animations - Multiple selectors for compatibility */
.menu-toggle.active span:nth-child(1),
.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2),
.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3),
.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Alternative animation style - Smooth X formation */
.hamburger-menu.active-alt .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active-alt .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}

.hamburger-menu.active-alt .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Hover effects for hamburger lines */
.hamburger-menu:hover .hamburger-line {
  background: #FFD700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.hamburger-menu.active:hover .hamburger-line {
  background: #D4AF37;
}

/* Body scroll lock when menu is open */
body.hamburger-menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* Language dropdown improvements */
.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1000;
}

.language-dropdown.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #D4AF37;
  transform: translateX(4px);
}

.language-option.active {
  background: rgba(212, 175, 55, 0.15);
  color: #D4AF37;
}

/* Theme toggle improvements */
.theme-toggle-button.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
  border-color: rgba(212, 175, 55, 0.5);
}

/* Cart button improvements */
.cart-button {
  position: relative;
}

.cart-button .cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #EF4444;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

/* Menu section improvements */
.menu-section {
  margin-bottom: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #D4AF37;
  margin-bottom: 8px;
  padding: 0 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-links li {
  margin: 0;
}

.section-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.section-links a:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #D4AF37;
  border-left-color: #D4AF37;
  transform: translateX(4px);
}

/* Menu footer improvements */
.hamburger-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 16px;
}

.social-link:hover {
  background: #D4AF37;
  color: #1a1a1a;
  transform: translateY(-2px);
}

/* Notification improvements */
.notification {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Focus improvements for accessibility */
.hamburger-menu:focus,
.language-toggle-button:focus,
.theme-toggle-button:focus,
.cart-button:focus {
  outline: 2px solid #D4AF37;
  outline-offset: 2px;
}

.hamburger-close:focus,
.section-links a:focus,
.language-option:focus {
  outline: 2px solid #D4AF37;
  outline-offset: 2px;
}

/* Mobile specific improvements */
@media (max-width: 768px) {
  .hamburger-panel {
    width: 280px;
  }
  
  .language-dropdown {
    right: -20px;
    min-width: 120px;
  }
}

/* Light theme adjustments */
body.light-theme .hamburger-overlay {
  background: rgba(255, 255, 255, 0.3);
}

body.light-theme .language-dropdown {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 248, 0.95) 100%);
  border-color: rgba(212, 175, 55, 0.3);
  color: #1a1a1a;
}

body.light-theme .language-option {
  color: rgba(0, 0, 0, 0.8);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .language-option:hover {
  color: #D4AF37;
}

/* Animation performance improvements */
* {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hamburger-panel,
.hamburger-overlay,
.language-dropdown {
  will-change: transform, opacity;
}

/* Micro-interactions and advanced animations */
.hamburger-menu {
  position: relative;
  overflow: hidden;
}

.hamburger-menu::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
  z-index: -1;
}

.hamburger-menu:active::before {
  width: 60px;
  height: 60px;
}

/* Enhanced section title animations */
.hamburger-panel.active .section-title {
  animation: slideInRight 0.5s ease forwards;
}

.hamburger-panel.active .section-title:nth-of-type(1) { animation-delay: 0.2s; }
.hamburger-panel.active .section-title:nth-of-type(2) { animation-delay: 0.3s; }
.hamburger-panel.active .section-title:nth-of-type(3) { animation-delay: 0.4s; }
.hamburger-panel.active .section-title:nth-of-type(4) { animation-delay: 0.5s; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Smooth scroll behavior for menu links */
.section-links a {
  scroll-behavior: smooth;
}

/* Enhanced close button animation */
.hamburger-close {
  position: relative;
  overflow: hidden;
}

.hamburger-close::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
  transition: left 0.6s ease;
}

.hamburger-close:hover::before {
  left: 100%;
}

/* Overlay pulse effect */
.hamburger-overlay.active {
  animation: overlayPulse 0.3s ease-out;
}

@keyframes overlayPulse {
  0% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 1;
    backdrop-filter: blur(2px);
  }
}

/* Menu item hover ripple effect */
.section-links a {
  position: relative;
  overflow: hidden;
}

.section-links a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transform: translateY(-50%);
  transition: width 0.3s ease;
}

.section-links a:hover::before {
  width: 100%;
}

/* Loading states for better UX */
.hamburger-menu.loading {
  pointer-events: none;
  opacity: 0.7;
}

.hamburger-menu.loading .hamburger-line {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.5;
  }
}

/* Prevent text selection on interactive elements */
.hamburger-menu,
.language-toggle-button,
.theme-toggle-button,
.cart-button,
.hamburger-close {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Ensure proper stacking order */
.header-premium {
  z-index: 100;
}

.hamburger-overlay {
  z-index: 999;
}

.hamburger-panel {
  z-index: 1000;
}

.language-dropdown {
  z-index: 1001;
} 