/* ============================================
   Navbar & Mega Dropdown - CSS
   ============================================ */

#cssmenu ul li.has-mega-dropdown {
  position: relative;
}

#cssmenu ul li.has-mega-dropdown > a .nav-arrow {
  font-size: 10px;
  margin-left: 4px;
  vertical-align: middle;
  display: inline-block;
  transition: transform 0.2s ease;
}

#cssmenu ul li.has-mega-dropdown:hover > a .nav-arrow {
  transform: rotate(180deg);
}

.mega-dropdown {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: 0;
  transform: translateY(8px);
  top: calc(100% + 2px);
  z-index: 9999;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(8, 66, 152, 0.18), 0 2px 8px rgba(0,0,0,0.08);
  min-width: 480px;
  width: max-content;
  max-width: 820px;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

#cssmenu ul li.has-mega-dropdown:hover .mega-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-dropdown-inner {
  padding: 24px 28px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 36px;
}

.mega-col {
  min-width: 0;
}

.mega-country {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mega-country-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 16px;
  color: #084298 !important;
  text-decoration: none !important;
  line-height: 1.8;
  margin-bottom: 6px;
  padding: 4px 28px !important;
  border-radius: 6px;
  background: #f0f5ff;
  width: fit-content;
  transition: background 0.18s ease, color 0.18s ease;
}

.mega-country-link:hover {
  color: #fff !important;
  background: #e12e36;
}

.mega-divider {
  display: none;
}

.mega-city a {
  display: block;
  font-size: 12.5px;
  color: #555 !important;
  text-decoration: none !important;
  padding: 3px 0 3px 4px;
  line-height: 1.7;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, padding-left 0.15s ease;
}

.mega-city a:hover {
  color: #e12e36 !important;
  border-left-color: #e12e36;
  padding-left: 8px;
}

/* Override style.css: #header must be static so the li becomes the containing block.
   Only applies on desktop — mobile uses fixed positioning via responsive.css */
@media (min-width: 1025px) {
  #header:not(.sticky-shadow) {
    position: static !important;
  }
}

/* Ensure the cssmenu ul is the containing block for dropdowns */
#cssmenu > ul {
  position: relative;
}

/* ── Mobile (≤1024px) ── */
@media (max-width: 1024px) {
  #cssmenu ul li.has-mega-dropdown {
    position: relative;
  }

  .mega-dropdown {
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    display: none;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: unset;
    width: 100%;
    max-width: unset;
    transform: none !important;
    transition: none;
  }

  #cssmenu ul li.has-mega-dropdown:hover .mega-dropdown {
    display: none;
    visibility: visible;
    opacity: 1;
  }

  #cssmenu ul li.has-mega-dropdown.open .mega-dropdown {
    display: block;
  }

  .mega-dropdown-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 0;
  }

  .mega-col {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
  }

  .mega-col:last-child {
    border-bottom: none;
  }

  .mega-country-link {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    /* Reset desktop pill styles */
    background: transparent !important;
    padding: 2px 0 !important;
    border-radius: 0 !important;
    width: auto !important;
    display: block !important;
  }

  .mega-country-link:hover {
    color: #ffdf0f !important;
    background: transparent !important;
  }

  .mega-city a {
    color: rgba(255,255,255,0.75) !important;
    font-size: 12px;
    padding: 4px 0 4px 12px;
  }

  .mega-city a:hover {
    color: #ffdf0f !important;
  }

  #cssmenu ul li.has-mega-dropdown > a .nav-arrow {
    float: right;
  }

  #cssmenu ul li.has-mega-dropdown.open > a .nav-arrow {
    transform: rotate(180deg);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .mega-dropdown-inner {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 30px;
    padding: 24px 28px 20px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .mega-dropdown-inner {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px 30px;
    padding: 24px 28px 20px;
  }
}

@media (min-width: 1200px) {
  .mega-dropdown-inner {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}


/* Desktop header alignment fix */
@media (min-width: 1025px) {
  .header-sec {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .left-header,
  .middle-header,
  .right-header {
    display: flex !important;
    align-items: center !important;
  }

  .middle-header {
    flex: 1 !important;
    justify-content: center !important;
    padding-top: 18px !important;
  }
}
