/* ============================================
   MEGA MENU — mega-menu.css
   Full-width, horizontal grid layout
   ============================================ */

/* ===== Navbar links: <li> wrapper ===== */
.navbar__links {
  list-style: none;
}

.navbar__links li {
  position: relative;
}

.navbar__links li>a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-600);
  position: relative;
  transition: color 0.25s;
}

.navbar__links li>a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.3s var(--ease);
}

.navbar__links li>a:hover {
  color: var(--deep-blue);
}

.navbar__links li>a:hover::after {
  width: 100%;
}

/* ===== Mega Trigger ===== */
.nav-mega-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Extend hover zone below the trigger to bridge gap to mega menu */
.nav-mega-parent {
  padding-bottom: 20px;
  margin-bottom: -20px;
}

.nav-mega-arrow {
  transition: transform 0.3s var(--ease);
  margin-top: 1px;
}

.nav-mega-parent:hover .nav-mega-arrow,
.nav-mega-parent.open .nav-mega-arrow {
  transform: rotate(180deg);
}

/* ===== Mega Menu: Full-Width Dropdown ===== */
.mega-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  pointer-events: none;
  z-index: 999;
}

.nav-mega-parent:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Invisible bridge: covers gap between trigger and dropdown */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 40px;
}

.mega-menu__inner {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 20px 60px rgba(1, 87, 155, 0.1), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mega-menu__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Main Grid: Items Left + Featured Right ===== */
.mega-menu__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 0;
}

/* No featured: full width for items */
.mega-menu__grid--no-featured {
  grid-template-columns: 1fr;
}

/* ===== Left: Items Section ===== */
.mega-menu__items {
  padding: 32px 40px 32px 0;
  border-right: 1px solid var(--gray-100);
}

.mega-menu__grid--no-featured .mega-menu__items {
  border-right: none;
  padding-right: 0;
}

.mega-menu__label {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-400);
  margin-bottom: 20px;
  display: block;
}

/* Items in a responsive grid */
.mega-menu__items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

/* Reset inherited nav link styles inside mega menu */
.mega-menu a,
.mega-menu a::after {
  all: unset;
  cursor: pointer;
}

/* ===== Individual Mega Item ===== */
.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}

.mega-item:hover {
  background: var(--pale-cyan);
}

.mega-item__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--teal);
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
}

.mega-item:hover .mega-item__icon {
  background: linear-gradient(135deg, var(--mid-blue), var(--teal));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 151, 167, 0.3);
}

.mega-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}

.mega-item__text strong {
  font-family: 'Outfit', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.mega-item__text span {
  font-size: 12.5px;
  color: var(--gray-400);
  line-height: 1.5;
}

.mega-item__badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: var(--white);
  border-radius: 100px;
  letter-spacing: 0.3px;
}

/* ===== Right: Featured Card ===== */
.mega-menu__featured {
  padding: 32px 0 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mega-featured-card {
  position: relative;
  background: linear-gradient(160deg, var(--gray-900) 0%, var(--deep-blue) 60%, var(--teal) 100%);
  border-radius: 16px;
  padding: 28px 26px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mega-featured-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -30%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 188, 212, 0.2), transparent 70%);
}

.mega-featured-card::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -20%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(2, 119, 189, 0.15), transparent 70%);
}

.mega-featured-card>* {
  position: relative;
  z-index: 2;
}

.mega-featured-card__badge {
  display: inline-block;
  padding: 4px 14px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  background: rgba(0, 188, 212, 0.15);
  color: var(--cyan);
  border-radius: 100px;
  border: 1px solid rgba(0, 188, 212, 0.2);
  margin-bottom: 16px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  width: fit-content;
}

.mega-featured-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.25;
}

.mega-featured-card p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  margin-bottom: 22px;
}

.mega-featured-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cyan);
  padding: 8px 20px;
  background: rgba(0, 188, 212, 0.12);
  border: 1px solid rgba(0, 188, 212, 0.2);
  border-radius: 8px;
  width: fit-content;
  transition: all 0.25s;
}

.mega-featured-card__link:hover {
  background: rgba(0, 188, 212, 0.25);
  gap: 10px;
  color: var(--white);
}

/* ===== Badge style for admin ===== */
.menu-type-badge--featured {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

/* ============================================
   ANIMATION: stagger items
   ============================================ */
.mega-item {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s var(--ease);
}

.nav-mega-parent:hover .mega-item {
  opacity: 1;
  transform: translateY(0);
}

.nav-mega-parent:hover .mega-item:nth-child(1) {
  transition-delay: 0.04s;
}

.nav-mega-parent:hover .mega-item:nth-child(2) {
  transition-delay: 0.08s;
}

.nav-mega-parent:hover .mega-item:nth-child(3) {
  transition-delay: 0.12s;
}

.nav-mega-parent:hover .mega-item:nth-child(4) {
  transition-delay: 0.16s;
}

.nav-mega-parent:hover .mega-item:nth-child(5) {
  transition-delay: 0.20s;
}

.nav-mega-parent:hover .mega-item:nth-child(6) {
  transition-delay: 0.24s;
}

.mega-featured-card {
  opacity: 0;
  transform: translateX(12px);
  transition: all 0.4s var(--ease) 0.1s;
}

.nav-mega-parent:hover .mega-featured-card {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {

  /* ===== Mobile Nav: slide-down with smooth transition ===== */
  .navbar__links {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 0 24px;
    box-shadow: 0 12px 40px rgba(1, 87, 155, 0.12);
    border-radius: 0 0 14px 14px;
    gap: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease,
      padding 0.35s ease;
  }

  .navbar__links.active {
    max-height: 85vh;
    opacity: 1;
    padding: 16px 24px 20px;
    overflow-y: auto;
    pointer-events: auto;
  }

  .navbar__links li {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
  }

  .navbar__links.active li {
    opacity: 1;
    transform: translateY(0);
  }

  .navbar__links.active li:nth-child(1) {
    transition-delay: 0.05s;
  }

  .navbar__links.active li:nth-child(2) {
    transition-delay: 0.08s;
  }

  .navbar__links.active li:nth-child(3) {
    transition-delay: 0.11s;
  }

  .navbar__links.active li:nth-child(4) {
    transition-delay: 0.14s;
  }

  .navbar__links.active li:nth-child(5) {
    transition-delay: 0.17s;
  }

  .navbar__links.active li:nth-child(6) {
    transition-delay: 0.20s;
  }

  .navbar__links.active li:nth-child(7) {
    transition-delay: 0.23s;
  }

  .navbar__links li>a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
  }

  .navbar__links li:last-child>a {
    border-bottom: none;
  }

  .navbar__links li>a::after {
    display: none;
  }

  /* ===== Mobile Mega Menu: accordion slide ===== */
  .mega-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-mega-parent.open .mega-menu {
    max-height: 800px;
  }

  .mega-menu::before {
    display: none;
  }

  .mega-menu__inner {
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid var(--gray-200);
    margin: 8px 0 4px;
    border-bottom: none;
  }

  .mega-menu__container {
    padding: 0;
  }

  .mega-menu__grid,
  .mega-menu__grid--no-featured {
    grid-template-columns: 1fr;
  }

  .mega-menu__items {
    padding: 16px;
    border-right: none;
  }

  .mega-menu__label {
    margin-bottom: 12px;
  }

  .mega-menu__items-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mega-menu__featured {
    padding: 0 16px 16px;
  }

  .mega-featured-card {
    border-radius: 12px;
    padding: 22px 18px;
  }

  .mega-featured-card h4 {
    font-size: 18px;
  }

  .mega-featured-card p {
    font-size: 12.5px;
    margin-bottom: 16px;
  }

  .mega-item {
    padding: 10px 12px;
    border-radius: 8px;
  }

  .mega-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .mega-item__text strong {
    font-size: 13.5px;
  }

  .mega-item__text span {
    font-size: 12px;
  }

  /* Reset desktop stagger animation for mobile */
  .mega-item,
  .mega-featured-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* ===== Mega Trigger in mobile ===== */
  .nav-mega-parent {
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .nav-mega-trigger {
    width: 100%;
    justify-content: center;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
  }

  .nav-mega-arrow {
    margin-left: 6px;
    transition: transform 0.3s ease;
  }

  /* Reset desktop hover rotation on mobile */
  .nav-mega-parent:hover .nav-mega-arrow {
    transform: none;
  }

  /* Only rotate via .open class on mobile */
  .nav-mega-parent.open .nav-mega-arrow {
    transform: rotate(180deg);
  }

  .nav-mega-parent.open .nav-mega-trigger {
    color: var(--teal);
    border-bottom-color: transparent;
  }

  /* ===== Hamburger toggle hide (base from style.css) ===== */
  .navbar__cta {
    display: none;
  }

  .navbar__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }

  .navbar__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

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

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

@media (min-width: 1025px) and (max-width: 1280px) {
  .mega-menu__grid {
    grid-template-columns: 1fr 280px;
  }

  .mega-menu__featured {
    padding-left: 28px;
  }
}