/* ============================================================
   SaudiOne — Mega Menu Dropdowns
   ============================================================ */

/* Desktop nav: horizontal top-level items */
.so-nav .menu {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.so-nav .menu li {
  position: relative;
  list-style: none;
}

.so-nav .menu > li > a,
.so-nav .menu > li > span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s;
  position: relative;
}

.so-nav .menu > li > a:hover,
.so-nav .menu > li > a.is-active,
.so-nav .menu > li:hover > a {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Active indicator line */
.so-nav .menu > li > a.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #10A899;
  border-radius: 2px;
}

/* Chevron for items with children */
.so-nav .menu > li.menu-item--expanded > a::after {
  content: '';
  width: 12px;
  height: 12px;
  margin-inline-start: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}


.so-nav .menu > li.menu-item--expanded:hover > a::after {
  transform: rotate(180deg);
}

/* ---- Dropdown panel ---- */
.so-nav .menu > li > ul,
.so-nav .menu > li > .menu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 200;
  min-width: 280px;
  padding: 0.5rem;
  background: var(--lbayk-theme-surface, #fff);
  border: 1px solid var(--lbayk-dk-line, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}


.so-nav .menu > li:hover > ul,
.so-nav .menu > li:hover > .menu,
.so-nav .menu > li:focus-within > ul,
.so-nav .menu > li:focus-within > .menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---- Dropdown items ---- */
.so-nav .menu > li > ul li,
.so-nav .menu > li > .menu li {
  list-style: none;
}

.so-nav .menu > li > ul a,
.so-nav .menu > li > .menu a {
  display: block;
  padding: 0.625rem 0.875rem;
  color: var(--lbayk-theme-ink, #1f2937);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.12s;
  line-height: 1.4;
}

.so-nav .menu > li > ul a:hover,
.so-nav .menu > li > .menu a:hover {
  background: var(--lbayk-dk-tint-green, #f0fdf4);
  color: var(--lbayk-dk-text-teal, #087F72);
}

.so-nav .menu > li > ul a.is-active,
.so-nav .menu > li > .menu a.is-active {
  background: #087F72;
  color: #fff;
}

/* Description text under each link */
.so-nav .menu > li > ul a[title]::after,
.so-nav .menu > li > .menu a[title]::after {
  content: attr(title);
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: #9ca3af;
  margin-top: 2px;
  line-height: 1.3;
}

.so-nav .menu > li > ul a:hover[title]::after,
.so-nav .menu > li > .menu a:hover[title]::after {
  color: var(--lbayk-theme-muted, #6b7280);
}

.so-nav .menu > li > ul a.is-active[title]::after,
.so-nav .menu > li > .menu a.is-active[title]::after {
  color: rgba(255, 255, 255, 0.7);
}

/* ---- Mobile override: hide desktop nav ---- */
@media (max-width: 1024px) {
  .so-nav .menu,
  .so-nav .so-menu {
    display: none;
  }
}

/* ---- Mobile panel overrides for megamenu classes ---- */
@media (max-width: 1024px) {
  /* Remove title-based descriptions in mobile */
  .so-header__mobile-panel .menu a[title]::after,
  .so-header__mobile-panel .so-menu__link[title]::after {
    display: none;
  }

  /* Remove desktop dropdown chevron (replaced by our own toggle chevron in style.css) */
  .so-header__mobile-panel .menu > li.menu-item--expanded > a::after,
  .so-header__mobile-panel .so-nav .menu > li.menu-item--expanded > a::after {
    display: none;
  }
}

/* ---- Nav items with special styling ---- */
.so-nav .menu > li:last-child > a {
  /* Search link - subtle */
}

/* AI Planner link - accent */
.so-nav .menu > li > a[href*="/chat"] {
  color: #10A899;
  font-weight: 600;
}

.so-nav .menu > li > a[href*="/chat"]:hover {
  background: rgba(16,168,153, 0.15);
}

/* Offers link - gold accent */
.so-nav .menu > li > a[href*="/offers"] {
  color: #FF725E;
}

.so-nav .menu > li > a[href*="/offers"]:hover {
  background: rgba(255,114,94, 0.15);
}
