/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0 auto;
  background: rgba(var(--bg-primary-rgb), 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.header.scrolled {
  background: rgba(var(--bg-primary-rgb), 0.98);
  box-shadow: 0 8px 32px var(--shadow);
  top: 15px;
  width: 90%;
  max-width: 1100px;
  border-radius: 12px;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.navbar {
  padding: 1rem 0;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.header.scrolled .navbar {
  padding: 0.6rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 50px;
  width: auto;
  transition: all 0.3s ease;
  max-width: 180px;
  object-fit: contain;
}

.header.scrolled .logo-img {
  height: 45px;
}

.nav-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  list-style: none;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  display: flex;
  align-items: center;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #16a34a;
  background: var(--bg-tertiary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.cart-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #16a34a;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.cart-count.show {
  opacity: 1;
  transform: scale(1);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-secondary);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

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

/* Mega Menu Styles */
.mega-menu-item {
  position: relative;
}

.mega-menu-item > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-menu-item > a i {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.mega-menu-item:hover > a i {
  transform: rotate(180deg);
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px var(--shadow);
  padding: 2rem;
  min-width: 600px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
  margin-top: 1rem;
}

.mega-menu-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  margin-top: 0.5rem;
}

.mega-menu-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.mega-menu-column h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-bottom: 2px solid #16a34a;
  padding-bottom: 0.5rem;
}

.mega-menu-column ul {
  list-style: none;
  padding: 0;
}

.mega-menu-column ul li {
  margin-bottom: 0.5rem;
}

.mega-menu-column ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  transition: all 0.2s ease;
  display: block;
}

.mega-menu-column ul li a:hover {
  color: #16a34a;
  padding-left: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .mega-menu {
    min-width: 600px;
  }

  .mega-menu-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 999;
  backdrop-filter: blur(5px);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: var(--bg-primary);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1001;
  overflow-y: auto;
  box-shadow: -10px 0 30px var(--shadow);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-logo {
  height: 35px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.mobile-menu-close:hover {
  background: var(--bg-tertiary);
  color: #16a34a;
}

.mobile-menu-content {
  padding: 1rem 0;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--border-secondary);
}

.mobile-menu-item > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mobile-submenu-toggle i {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 0.8rem;
}

.mobile-menu-item > a:hover {
  background: var(--bg-secondary);
  color: #16a34a;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-submenu.active {
  max-height: 500px;
}

.mobile-submenu-content {
  padding: 0.5rem 0;
}

.mobile-submenu-column {
  margin-bottom: 1rem;
}

.mobile-submenu-column h4 {
  color: #16a34a;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 2rem;
  margin: 0;
}

.mobile-submenu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-submenu-column ul li a {
  display: block;
  padding: 0.5rem 2.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.mobile-submenu-column ul li a:hover {
  background: var(--bg-primary);
  color: #16a34a;
  transform: translateX(5px);
}

@media (max-width: 1024px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    display: none;
  }

  .mega-menu {
    min-width: 600px;
  }

  .mega-menu-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu {
    width: 90%;
  }

  .mega-menu {
    position: static;
    transform: none;
    min-width: auto;
    width: 100%;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
  }

  .mega-menu-content {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .mega-menu-item:hover .mega-menu {
    transform: none;
  }
}

@media (max-width: 480px) {
  .mobile-menu {
    width: 95%;
  }

  .nav-container {
    padding: 0 15px;
  }
}
