/* ==============================================================================
   DESTINATIONS MEGA MENU (Hover & Click Supported) - bookfh.com
   ============================================================================== */

/* Ensure the navbar item does not constrain the mega menu width */
.nav-links-center {
  align-self: stretch;
}

.nav-mega-dropdown {
  position: static !important;
  align-self: stretch;
  display: inline-flex !important;
  align-items: center;
}

.nav-mega-dropdown .nav-dropdown-chevron {
  width: 13px;
  height: 13px;
  margin-left: 2px;
  transition: transform 0.25s ease;
  display: inline-block;
  vertical-align: middle;
}

.nav-mega-dropdown:hover .nav-dropdown-chevron,
.nav-mega-dropdown.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-mega-dropdown:hover > .nav-link,
.nav-mega-dropdown.is-open > .nav-link {
  color: var(--color-primary, #E6911A) !important;
}

/* Mega Menu Dropdown Panel */
.nav-mega-dropdown .mega-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(1320px, calc(100% - 2rem));
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem 1.25rem;
  box-shadow: 0 25px 60px -15px rgba(20, 28, 46, 0.22), 0 0 0 1px rgba(226, 232, 240, 0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  z-index: 1200;
  max-height: calc(88vh - 4.75rem);
  overflow-y: auto;
}

/* Generous invisible hover bridge between trigger and mega menu panel */
.nav-mega-dropdown .mega-menu-panel::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 24px;
  background: transparent;
  pointer-events: auto;
}

/* Open on hover, focus-within, or when .is-open class is active */
.nav-mega-dropdown:hover .mega-menu-panel,
.nav-mega-dropdown:focus-within .mega-menu-panel,
.nav-mega-dropdown.is-open .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Custom sleek scrollbar for mega menu */
.nav-mega-dropdown .mega-menu-panel::-webkit-scrollbar {
  width: 6px;
}
.nav-mega-dropdown .mega-menu-panel::-webkit-scrollbar-track {
  background: #F8FAFC;
  border-radius: 10px;
}
.nav-mega-dropdown .mega-menu-panel::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}
.nav-mega-dropdown .mega-menu-panel::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Topbar */
.mega-menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #F1F5F9;
  gap: 1rem;
}

.mega-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mega-topbar-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: #FEF3C7;
  color: #92400E;
}

.mega-topbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-navy, #141C2E);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}

.mega-topbar-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-slate-500, #64748B);
}

.mega-topbar-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  background: var(--color-navy, #141C2E);
  color: #ffffff !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mega-topbar-ai-btn:hover {
  background: var(--color-primary, #E6911A);
  color: #141C2E !important;
  transform: translateY(-1px);
}

/* 5 Columns Grid */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
}

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

.mega-col-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.45rem;
  border-bottom: 2px solid #F1F5F9;
}

.mega-col-icon {
  width: 15px;
  height: 15px;
  color: var(--color-primary, #E6911A);
  flex-shrink: 0;
}

.mega-col-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--color-navy, #141C2E);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-col-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-slate-400, #94A3B8);
  background: #F1F5F9;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.mega-col-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mega-dest-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.mega-dest-link:hover {
  background-color: #F8FAFC;
  color: var(--color-navy, #141C2E);
  transform: translateX(2px);
}

.mega-dest-link.active {
  background-color: #EFF6FF;
  color: var(--color-accent-blue, #3FA9F5);
  font-weight: 700;
}

.mega-dest-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-dest-tag {
  font-size: 0.6875rem;
  color: #94A3B8;
  font-weight: 500;
  margin-left: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.mega-dest-link:hover .mega-dest-tag {
  color: #D97706;
}

/* Bottom Footer */
.mega-menu-footer {
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: #F8FAFC;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-slate-600, #475569);
}

.mega-footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-footer-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.mega-footer-link {
  color: var(--color-navy, #141C2E);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.mega-footer-link:hover {
  color: var(--color-primary, #E6911A);
}

.mega-footer-sep {
  color: #CBD5E1;
}

/* Mobile Mega Menu in Drawer */
.mobile-mega-wrap {
  width: 100%;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.25rem 0;
}

.mobile-mega-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy, #141C2E);
  cursor: pointer;
  text-align: left;
}

.mobile-mega-btn i {
  transition: transform 0.2s ease;
}

.mobile-mega-btn.open #mobileDestChevron {
  transform: rotate(180deg);
}

.mobile-mega-content {
  display: none;
  padding: 0.25rem 0.5rem 0.85rem;
  max-height: 380px;
  overflow-y: auto;
}

.mobile-mega-content.open {
  display: block;
}

.mobile-mega-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.05em;
  margin: 0.75rem 0 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #E2E8F0;
}

.mobile-mega-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.5rem;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  border-radius: 0.375rem;
}

.mobile-mega-link:active,
.mobile-mega-link:hover {
  background: #F1F5F9;
  color: var(--color-navy, #141C2E);
}

.mobile-mega-link-sub {
  font-size: 0.72rem;
  color: #94A3B8;
}
