/* Mega Menu Styles for GingerUp Theme */

/* Mega Menu Container */
.gingerup-mega-menu-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gingerup-mega-menu-container.active {
  opacity: 1;
}

.gingerup-mega-menu-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 30px;
  width: 100vw;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  pointer-events: all;
  position: relative;
}

/* Close button */
.gingerup-mega-menu-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  border-radius: 50%;
  color: #333;
  font-size: 22px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.gingerup-mega-menu-close:hover,
.gingerup-mega-menu-close:focus {
  background: #f5f5f5;
  outline: none;
}

.gingerup-mega-menu-container.active .gingerup-mega-menu-content {
  transform: translateY(0);
}

/* Products Grid */
.gingerup-mega-menu-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
}

/* Mega menu product grid - use same styling as shop */
.gingerup-mega-menu-container .gingerup-product-grid {
  margin-bottom: 0;
}

.gingerup-mega-menu-container .product-grid-container {
  justify-content: flex-start;
}

.gingerup-mega-menu-container .product-item {
  width: calc(33.333% - 20px) !important; /* Force 3 columns */
  margin: 10px;
  min-height: 350px; /* Slightly smaller for mega menu */
}

/* Product Image Container - use existing shop styles */
.gingerup-mega-menu-container .product-item .product-image {
  min-height: 200px; /* Smaller for mega menu */
}

/* Decoration Images - use existing shop styles */

/* Product Images - use existing shop styles */

/* Product Title, Description, Rating, Details Button - use existing shop styles */

/* Loading State */
.gingerup-mega-menu-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

/* Prevent default dropdown from showing on mega menu items */
.header-navigation .has-mega-menu .sub-menu,
.header-navigation .has-mega-menu .submenu {
  display: none !important;
}

/* Ensure mega menu is above other elements */
.gingerup-mega-menu-container {
  z-index: 10000; /* Higher than default dropdown z-index */
}

/* Body class when mega menu is active */
body.mega-menu-active {
  overflow-x: hidden;
}

/* Integration with Kadence theme header */
.header-navigation .menu-item.has-mega-menu > a {
  position: relative;
}

/* Disable pointer events on mega menu items' dropdown toggles */
.header-navigation .has-mega-menu .dropdown-nav-toggle {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gingerup-mega-menu-content {
    padding: 20px;
    width: 100vw;
    max-height: 70vh;
  }

  .gingerup-mega-menu-container .product-item {
    width: calc(50% - 20px) !important;
  }
}

@media (max-width: 480px) {
  .gingerup-mega-menu-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gingerup-mega-menu-container .product-item {
    width: calc(100% - 20px) !important;
  }
}

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

.mega-menu-product-wrapper {
  animation: fadeInUp 0.3s ease forwards;
}

.mega-menu-product-wrapper:nth-child(1) {
  animation-delay: 0.05s;
}
.mega-menu-product-wrapper:nth-child(2) {
  animation-delay: 0.1s;
}
.mega-menu-product-wrapper:nth-child(3) {
  animation-delay: 0.15s;
}
.mega-menu-product-wrapper:nth-child(4) {
  animation-delay: 0.2s;
}
.mega-menu-product-wrapper:nth-child(5) {
  animation-delay: 0.25s;
}
.mega-menu-product-wrapper:nth-child(6) {
  animation-delay: 0.3s;
}
