/* Categories Mega Menu */

header {
  position: relative;
  z-index: 1000;
}

.menu__sec ul li.cmh-has-mega {
  position: relative;
}

.menu__sec ul li.cmh-has-mega > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.menu__sec ul li.cmh-has-mega > a .cmh-mega-chevron {
  font-size: 12px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.menu__sec ul li.cmh-has-mega:hover > a,
.menu__sec ul li.cmh-has-mega:focus-within > a {
  color: var(--primary_color) !important;
}

.menu__sec ul li.cmh-has-mega:hover > a .cmh-mega-chevron,
.menu__sec ul li.cmh-has-mega:focus-within > a .cmh-mega-chevron {
  transform: rotate(180deg);
}

.cmh-mega-menu {
  position: absolute;
  top: 100%;
  left: 0%;
  transform: translateX(-50%) translateY(14px);
  width: min(980px, 86vw);
  background: #ffffff;
  border: 1px solid #e8dff3;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(88, 22, 152, 0.12);
  padding: 22px 24px 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 999;
  text-align: left;
}

.cmh-mega-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}

.menu__sec ul li.cmh-has-mega:hover .cmh-mega-menu,
.menu__sec ul li.cmh-has-mega:focus-within .cmh-mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(10px);
}

/* Featured parent categories with children */
.cmh-mega-menu__featured {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.cmh-mega-card {
  background: linear-gradient(180deg, #faf7fd 0%, #f4eefb 100%);
  border: 1px solid #eadff6;
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cmh-mega-card:hover {
  border-color: #c9a9e8;
  box-shadow: 0 8px 20px rgba(88, 22, 152, 0.08);
}

.cmh-mega-card__title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--primary_color) !important;
  line-height: 1.3 !important;
  margin-bottom: 10px;
  padding: 0 !important;
}

.cmh-mega-card__title span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8d79a8;
  background: #fff;
  border-radius: 999px;
  padding: 3px 8px;
}

.cmh-mega-card__list {
  list-style: none;
  margin: 0;
  padding: 0 !important;
  display: grid;
  gap: 6px;
}

.cmh-mega-card__list li {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

.cmh-mega-card__list li a {
  display: block !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #555 !important;
  line-height: 1.4 !important;
  padding: 6px 10px !important;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.cmh-mega-card__list li a:hover {
  background: #ffffff !important;
  color: var(--primary_color) !important;
}

/* Flat category grid */
.cmh-mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  padding-top: 4px;
}

.cmh-mega-link {
  display: block !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #3f3f3f !important;
  line-height: 1.35 !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  background: #f8f8f8;
  white-space: normal;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cmh-mega-link:hover {
  background: #f0e8f8 !important;
  color: var(--primary_color) !important;
  transform: translateY(-1px);
}

.cmh-mega-menu__footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eee5f6;
  text-align: right;
}

.cmh-mega-menu__footer a {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--primary_color) !important;
  padding: 0 !important;
}

.cmh-mega-menu__footer a i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.cmh-mega-menu__footer a:hover i {
  transform: translateX(3px);
}

.cmh-mega-menu__empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  font-size: 14px;
  color: #999;
  font-weight: 500;
}
