/**
 * PrestaHeroes Mega Menu
 * Apache-2.0 — Attribution required: PrestaHeroes.com — contact info@prestasheroes.com
 */
.ph-modern-menu {
  position: relative;
  z-index: 40;
  width: 100%;
  background: #fff;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.ph-modern-menu__toggle {
  display: none;
  width: 100%;
  border: 0;
  background: #fff;
  color: #222;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  text-transform: none;
}

.ph-modern-menu__toggle-icon {
  display: inline-block;
  margin-right: 8px;
}

.ph-modern-menu__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0 4px;
  width: calc(100% - 24px);
  max-width: none;
  margin: 0 auto;
  padding: 0 12px;
  list-style: none;
}

.ph-modern-menu__item {
  position: static;
  margin: 0;
}

.ph-modern-menu__link {
  display: block;
  padding: 16px 12px;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}

.ph-modern-menu--case-uppercase .ph-modern-menu__link {
  text-transform: uppercase;
}

.ph-modern-menu--case-capitalize .ph-modern-menu__link {
  text-transform: capitalize;
}

.ph-modern-menu__link:hover,
.ph-modern-menu__link:focus,
.ph-modern-menu__item.is-submenu-open > .ph-modern-menu__link {
  color: #00a7cf;
  background: #f7f7f7;
  text-decoration: none;
}

.ph-modern-menu__open {
  display: none;
}

.ph-modern-menu__panel {
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(1320px, calc(100vw - 24px));
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
}

.ph-modern-menu__item.is-submenu-open > .ph-modern-menu__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ph-modern-menu__panel-inner {
  margin-top: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-top: 3px solid #111;
  box-shadow: 0 16px 28px rgba(0, 0, 0, .14);
}

.ph-modern-menu__featured {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.ph-modern-menu__view-all {
  display: inline-block;
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.ph-modern-menu__children {
  display: grid;
  grid-template-columns: repeat(var(--ph-menu-columns, 4), minmax(0, 1fr));
  gap: 14px 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ph-modern-menu__child-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.ph-modern-menu__child-link:hover,
.ph-modern-menu__child-link:focus,
.ph-modern-menu__grandchildren a:hover,
.ph-modern-menu__grandchildren a:focus {
  color: #000;
  text-decoration: underline;
}

.ph-modern-menu__child-image {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
}

.ph-modern-menu__grandchildren {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.ph-modern-menu__grandchildren li {
  margin: 3px 0;
}

.ph-modern-menu__grandchildren a {
  color: #666;
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
}

/* Optional desktop hamburger mode. */
.ph-modern-menu--desktop-hamburger .ph-modern-menu__toggle {
  display: block;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__list {
  display: none;
  width: 100%;
  padding: 0;
}

.ph-modern-menu--desktop-hamburger.is-open .ph-modern-menu__list {
  display: block;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__item {
  position: relative;
  border-top: 1px solid #eee;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__link {
  padding: 14px 50px 14px 16px;
  white-space: normal;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__open {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  border: 0;
  background: #f5f5f5;
  color: #111;
  font-size: 20px;
  line-height: 1;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__panel {
  position: static;
  display: none;
  width: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__item.is-submenu-open > .ph-modern-menu__panel {
  display: block;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__panel-inner {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid #eee;
  box-shadow: none;
  background: #fafafa;
}

.ph-modern-menu--desktop-hamburger .ph-modern-menu__children {
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (max-width: 991px) {
  .ph-modern-menu__toggle {
    display: block;
  }

  .ph-modern-menu__list {
    display: none;
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .ph-modern-menu.is-open .ph-modern-menu__list {
    display: block;
  }

  .ph-modern-menu__item {
    position: relative;
    border-top: 1px solid #eee;
  }

  .ph-modern-menu__link {
    padding: 14px 50px 14px 16px;
    white-space: normal;
  }

  .ph-modern-menu__open {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border: 0;
    background: #f5f5f5;
    color: #111;
    font-size: 20px;
    line-height: 1;
  }

  .ph-modern-menu__panel {
    position: static;
    display: none;
    width: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .ph-modern-menu__item.is-submenu-open > .ph-modern-menu__panel {
    display: block;
  }

  .ph-modern-menu__panel-inner {
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-top: 1px solid #eee;
    box-shadow: none;
    background: #fafafa;
  }

  .ph-modern-menu__children {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Mobile header hook placement: always render as a compact hamburger trigger/drawer. */
.ph-modern-menu--placement-mobile_header .ph-modern-menu__toggle {
  display: block;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__list {
  display: none;
  width: 100%;
  max-width: none;
  padding: 0;
}

.ph-modern-menu--placement-mobile_header.is-open .ph-modern-menu__list {
  display: block;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__item {
  position: relative;
  border-top: 1px solid #eee;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__link {
  padding: 14px 50px 14px 16px;
  white-space: normal;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__open {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  border: 0;
  background: #f5f5f5;
  color: #111;
  font-size: 20px;
  line-height: 1;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__panel {
  position: static;
  display: none;
  width: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__item.is-submenu-open > .ph-modern-menu__panel {
  display: block;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__panel-inner {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid #eee;
  box-shadow: none;
  background: #fafafa;
}

.ph-modern-menu--placement-mobile_header .ph-modern-menu__children {
  grid-template-columns: 1fr;
  gap: 10px;
}

/*
 * When the theme renders the mobile-header hook, displayTop would otherwise
 * create a second hamburger below the search box. Keep displayTop for desktop
 * and let displayMobileHeaderMenu own the mobile header placement.
 */
@media (max-width: 991px) {
  .ph-modern-menu--placement-top {
    display: none;
  }
}
