/* Mega Menu Styles - Enhanced & Lighter */
.has-megamenu {
  position: relative;
}

.mega-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

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

/* Made megamenu lighter and more compact */
.mega-menu-container {
  position: absolute;
  top: 0px !important;
  left: 0;
  width: 100%;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  overflow: hidden;
}

.mega-menu-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 500px;
  overflow-y: auto;
}

/* Custom scrollbar for megamenu */
.mega-menu-container::-webkit-scrollbar {
  width: 8px;
}

.mega-menu-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.mega-menu-container::-webkit-scrollbar-thumb {
  background: #ff8c42;
  border-radius: 4px;
}

.mega-menu-container::-webkit-scrollbar-thumb:hover {
  background: #ff6b35;
}

.mega-menu-container .container {
  padding: 30px 30px;
  display: flex;
  gap: 30px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  flex: 1;
}

.mega-menu-column {
  display: flex;
  flex-direction: column;
}

/* Made category header more compact */
.mega-menu-category-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f5f5f5;
}

.category-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #fff8f0 0%, #ffe8d6 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.category-icon i {
  font-size: 16px;
  color: #ff8c42;
}

.mega-menu-column:hover .category-icon {
  background: linear-gradient(135deg, #ff8c42, #ff9966);
  transform: scale(1.05);
}

.mega-menu-column:hover .category-icon i {
  color: white;
}

.mega-menu-category-header h3 {
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 3px;
  font-weight: 600;
}

.product-count {
  font-size: 11px;
  color: #999;
  font-weight: 400;
}

/* Made product list more compact */
.mega-menu-products {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
  flex: 1;
}

.mega-menu-products li {
  margin-bottom: 8px;
}

.mega-menu-products li a {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
  display: block;
  padding: 4px 0;
  font-weight: 400;
  position: relative;
  padding-left: 12px;
}

.mega-menu-products li a:before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mega-menu-products li a:hover {
  color: #ff8c42;
  padding-left: 16px;
}

.mega-menu-products li a:hover:before {
  background: #ff8c42;
  width: 6px;
  height: 6px;
}

.view-all-link {
  color: #ff8c42;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  margin-top: auto;
}

.view-all-link:hover {
  gap: 10px;
  color: #ff6b35;
}

.view-all-link i {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.view-all-link:hover i {
  transform: translateX(3px);
}

/* Made featured banner smaller */
.mega-menu-featured {
  width: 280px;
  flex-shrink: 0;
}

.mega-menu-banner {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  min-height: 280px;
}

.mega-menu-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mega-menu-banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
}

.banner-tag-small {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #ff8c42;
  background: white;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.mega-menu-banner-content h4 {
  font-size: 16px;
  margin-bottom: 15px;
  line-height: 1.3;
}

.banner-cta-small {
  display: inline-block;
  padding: 8px 20px;
  background: #ff8c42;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.banner-cta-small:hover {
  background: white;
  color: #1a1a1a;
  transform: translateY(-2px);
}

/* Responsive Design for Mega Menu */
@media (max-width: 1200px) {
  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .mega-menu-featured {
    width: 100%;
    margin-top: 20px;
  }

  .mega-menu-container .container {
    flex-direction: column;
  }
}

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

  .mega-menu-container .container {
    padding: 30px 20px;
  }
}

/* Enhanced mobile megamenu with better UX */
@media (max-width: 768px) {
  .mega-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
    z-index: 1000;
    border-radius: 0;
  }

  [dir="rtl"] .mega-menu-container {
    transform: translateX(100%);
    left: auto;
    right: 0;
  }

  .mega-menu-container.active {
    transform: translateX(0);
    max-height: 100vh;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mega-menu-container .container {
    padding: 70px 20px 30px 20px;
  }

  .mega-menu-featured {
    margin-top: 15px;
  }

  .mega-menu-banner {
    min-height: 200px;
  }

  /* Close button for mobile */
  .mega-menu-close {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    padding: 0;
  }

  .mega-menu-close::before {
    content: "✕";
    font-size: 20px;
    line-height: 1;
  }

  [dir="rtl"] .mega-menu-close {
    right: auto;
    left: 15px;
  }

  .mega-menu-close:hover {
    background: #ff8c42;
    transform: rotate(90deg);
  }
}

@media (max-width: 480px) {
  .mega-menu-category-header h3 {
    font-size: 13px;
  }

  .mega-menu-products li a {
    font-size: 12px;
  }

  .category-icon {
    width: 32px;
    height: 32px;
  }

  .category-icon i {
    font-size: 14px;
  }

  .mega-menu-container .container {
    padding: 70px 15px 30px 15px;
  }

  .mega-menu-grid {
    gap: 15px;
  }

  .mega-menu-category-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .mega-menu-products li {
    margin-bottom: 6px;
  }
}

/* RTL Support for Mega Menu */
[dir="rtl"] .mega-menu-products li a {
  padding-left: 0;
  padding-right: 12px;
}

[dir="rtl"] .mega-menu-products li a:before {
  left: auto;
  right: 0;
}

[dir="rtl"] .mega-menu-products li a:hover {
  padding-left: 0;
  padding-right: 16px;
}

[dir="rtl"] .view-all-link i {
  transform: rotate(180deg);
}

[dir="rtl"] .view-all-link:hover i {
  transform: rotate(180deg) translateX(3px);
}


