/**
 * Ova Mega Menu overrides
 * Scope: header only (#masthead).
 */

/* Desktop / large screens: modern, clean mega menu */
.site #masthead .main-header-menu > .menu-item.ova-megamenu-item > .menu-link {
  position: relative;
  font-weight: 400 !important;
  text-transform: none;
  letter-spacing: 0.005em;
  transition: color 0.2s ease;
}

.site #masthead .ova-megamenu-item {
  --sk-mm-row-gap: 0.42rem;
  --sk-mm-row-min-height: 2.02rem;
}

.site #masthead .main-header-menu > .menu-item.ova-megamenu-item:hover > .menu-link,
.site #masthead .main-header-menu > .menu-item.ova-megamenu-item.current-menu-item > .menu-link,
.site #masthead .main-header-menu > .menu-item.ova-megamenu-item.current-menu-ancestor > .menu-link {
  color: var(--brand-dark, #1f5b4f) !important;
}

.site #masthead .main-header-menu > .menu-item.ova-megamenu-item > .menu-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9fd8bc 0%, #c7e7d4 50%, #9fd8bc 100%);
  opacity: 0;
  transform: scaleX(0.25);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.site #masthead .main-header-menu > .menu-item.ova-megamenu-item:hover > .menu-link::after,
.site #masthead .main-header-menu > .menu-item.ova-megamenu-item.current-menu-item > .menu-link::after,
.site #masthead .main-header-menu > .menu-item.ova-megamenu-item.current-menu-ancestor > .menu-link::after {
  opacity: 1;
  transform: scaleX(1);
}

.site #masthead .ova-megamenu-item > .ova_megamenu_container {
  position: relative;
  background: #ffffff !important;
  border: 1px solid #d9e8df !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08), 0 20px 48px rgba(17, 24, 39, 0.05) !important;
  overflow: hidden;
}

.site #masthead .ova-megamenu-item > .ova_megamenu_container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  right: 1px;
  height: 2px;
  background: linear-gradient(90deg, rgba(78, 170, 118, 0.22), rgba(37, 95, 136, 0.22), rgba(78, 170, 118, 0.22));
  pointer-events: none;
}

.site #masthead .ova-megamenu-item .ova_megamenu {
  background: #ffffff !important;
  padding: clamp(0.95rem, 1.4vw, 1.25rem) !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_row {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_columns {
  gap: clamp(0.7rem, 1.2vw, 1rem);
  align-items: stretch !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_column {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  padding: 0.32rem 1.06rem 0.56rem !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_column:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.5rem;
  right: 0;
  width: 1px;
  height: calc(100% - 1rem);
  background: linear-gradient(180deg, transparent 0%, #e7f0eb 12%, #e7f0eb 88%, transparent 100%);
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova-widget {
  margin: 0 0 0.38rem !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova-widget .ova-content {
  margin: 0;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova-widget img {
  display: block;
  border-radius: 14px;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova-heading {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 0 0.5rem !important;
  min-height: 1.82rem;
  padding-bottom: 0.48rem;
  border-bottom: 1px solid #e7f0eb;
  color: var(--heading, #1f2c2b);
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-transform: none !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova-heading::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7bc7a4, #255f88);
  box-shadow: 0 0 0 4px rgba(123, 199, 164, 0.14);
  flex: 0 0 8px;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item {
  margin: 0;
  line-height: 1.2 !important;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu {
  display: grid;
  row-gap: var(--sk-mm-row-gap);
  margin: 0;
  padding: 0;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a {
  display: flex;
  align-items: center;
  margin: 0;
  min-height: var(--sk-mm-row-min-height);
  padding: 0.22rem 0.42rem 0.22rem 0.94rem !important;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--text, #2d3a38) !important;
  font-size: 0.92rem !important;
  font-weight: 400 !important;
  line-height: 1.36 !important;
  text-transform: none !important;
  text-decoration: none;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a::before {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: #a2c6b0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a:hover,
.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a:focus-visible {
  background: #f5faf7 !important;
  color: var(--brand-dark, #214e45) !important;
  transform: translateX(2px);
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a:hover::before,
.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item > a:focus-visible::before {
  background: #2d6e8f;
  transform: scale(1.3);
}

.site #masthead .ova-megamenu-item .ova_megamenu .ova_megamenu_sub_menu .ova_megamenu_item.active > a {
  background: #eef8f1 !important;
  color: var(--brand-dark, #1f5b4f) !important;
  font-weight: 500 !important;
}

/* Fallback menu elements (generated by JS for <=1200px) */
.site #masthead .sk-mm-fallback-toggle,
.site #masthead .sk-mm-fallback-submenu {
  display: none;
}

@media (max-width: 1200px) {
  /* Use normal compact WP-like menu instead of Ova panel */
  .site #masthead nav.sk-mm-plain-mode .ova-megamenu-item > .ova_megamenu_container {
    display: none !important;
  }

  .site #masthead nav.sk-mm-plain-mode .ova-megamenu-item {
    position: relative;
  }

  .site #masthead nav.sk-mm-plain-mode .ova-megamenu-item > .menu-link {
    font-weight: 400 !important;
    text-transform: none;
    padding-right: 2.55rem !important;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-toggle {
    position: absolute;
    top: 0.42rem;
    right: 0.85rem;
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d4e2da;
    border-radius: 8px;
    background: #ffffff;
    color: #2f4b40;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-toggle:hover,
  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-toggle:focus-visible {
    border-color: #adcad8;
    background: #f6f8fa;
    color: #255f88;
  }

  .site #masthead nav.sk-mm-plain-mode .menu-item.sk-mm-open > .sk-mm-fallback-toggle {
    background: #eef8f1;
    border-color: #cfe2d6;
    color: var(--brand-dark, #1f5b4f);
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu {
    display: block;
    margin: 0.1rem 0 0.42rem;
    padding: 0.22rem 0 0.12rem 0.72rem;
    border-left: 1px solid #e9f1ec;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu[hidden] {
    display: none !important;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .menu-item > .menu-link {
    display: block;
    padding: 0.2rem 0 !important;
    font-size: 0.93rem;
    line-height: 1.25;
    text-transform: none;
    border: 0 !important;
    background: transparent !important;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .menu-item > a.menu-link {
    color: var(--text, #2d3a38);
    font-weight: 400 !important;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .sk-mm-group-title > .menu-link {
    color: var(--heading, #1f2c2b);
    font-size: 0.84rem;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    padding-top: 0.32rem !important;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .sk-mm-group-spacer {
    height: 0.2rem;
    padding: 0 !important;
    margin: 0;
    pointer-events: none;
  }

  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .menu-item > a.menu-link:hover,
  .site #masthead nav.sk-mm-plain-mode .sk-mm-fallback-submenu .menu-item > a.menu-link:focus-visible {
    color: var(--brand-dark, #214e45);
    text-decoration: underline;
  }
}
