.bp-megamenu,
.bp-megamenu * {
  box-sizing: border-box;
}

.bp-megamenu {
  --bpmm-bg: #fff;
  --bpmm-text: #202124;
  --bpmm-muted: #687385;
  --bpmm-border: #e8ebf0;
  --bpmm-soft: #f5f6f8;
  --bpmm-active: #111827;
  --bpmm-shadow: 0 16px 44px rgba(15, 23, 42, .18);
  color: var(--bpmm-text);
  font-size: 14px;
  line-height: 1.7;
}

.bp-megamenu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid var(--bpmm-border);
  border-radius: 12px;
  color: var(--bpmm-text);
  background: var(--bpmm-bg);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.bp-megamenu__trigger:hover,
.bp-megamenu__trigger:focus-visible {
  background: var(--bpmm-soft);
  border-color: #d7dce4;
  outline: none;
}

.bp-megamenu__trigger-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}

.bp-megamenu__trigger-icon span {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.bp-megamenu__trigger-icon svg,
.bp-megamenu__trigger-icon i {
  display: block;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.bp-megamenu__overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.bp-megamenu__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: auto;
  z-index: 10002;
  width: min(940px, 94vw);
  max-width: 100vw;
  background: var(--bpmm-bg);
  box-shadow: var(--bpmm-shadow);
  transform: translate3d(-110%, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: transform .24s ease, visibility .24s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bp-megamenu[dir="rtl"] .bp-megamenu__panel {
  left: auto;
  right: 0;
  transform: translate3d(110%, 0, 0);
}

.bp-megamenu.is-open .bp-megamenu__overlay {
  opacity: 1;
  pointer-events: auto;
}

.bp-megamenu.is-open .bp-megamenu__panel,
.bp-megamenu.is-open[dir="rtl"] .bp-megamenu__panel {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}

body.bp-megamenu-lock {
  overflow: hidden;
}

.bp-megamenu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--bpmm-border);
}

.bp-megamenu__title {
  font-size: 1rem;
  font-weight: 700;
}

.bp-megamenu__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bpmm-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.bp-megamenu__close:hover,
.bp-megamenu__close:focus-visible {
  background: var(--bpmm-soft);
  outline: none;
}

.bp-megamenu__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(210px, 30%) 1fr;
  overflow: hidden;
}

.bp-megamenu__tabs {
  min-width: 0;
  overflow-y: auto;
  padding: .75rem;
  border-inline-end: 1px solid var(--bpmm-border);
  background: #fbfbfc;
}

.bp-megamenu__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: .7rem .85rem;
  border-radius: 12px;
  color: var(--bpmm-text);
  text-decoration: none;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}

button.bp-megamenu__tab {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: inherit;
  font-family: inherit;
  cursor: pointer;
}

.bp-megamenu__tab:hover,
.bp-megamenu__tab:focus-visible,
.bp-megamenu__tab.is-active {
  background: var(--bpmm-bg);
  color: var(--bpmm-active);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--bpmm-border);
}

.bp-megamenu__tab.is-current {
  color: var(--bpmm-active);
}

.bp-megamenu__chevron,
.bp-megamenu__list-chevron,
.bp-megamenu__accordion span {
  width: .55rem;
  height: .55rem;
  border-block-start: 2px solid currentColor;
  border-inline-end: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .55;
  flex: 0 0 auto;
}

.bp-megamenu[dir="rtl"] .bp-megamenu__chevron {
  transform: rotate(-135deg);
}

.bp-megamenu__contents {
  min-width: 0;
  overflow-y: auto;
  padding: 1rem;
}

.bp-megamenu__content[hidden] {
  display: none !important;
}

.bp-megamenu__content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-end: .85rem;
  margin-block-end: .85rem;
  border-bottom: 1px solid var(--bpmm-border);
}

.bp-megamenu__content-title {
  color: var(--bpmm-active);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
}

.bp-megamenu__content-title:hover,
.bp-megamenu__content-title:focus-visible,
.bp-megamenu a:hover,
.bp-megamenu a:focus-visible {
  color: var(--bpmm-active);
  text-decoration: none;
  outline: none;
}

.bp-megamenu__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.bp-megamenu__group {
  min-width: 0;
  padding: .8rem;
  border: 1px solid var(--bpmm-border);
  border-radius: 16px;
  background: var(--bpmm-bg);
}

.bp-megamenu__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-block-end: .45rem;
}

.bp-megamenu__group-title {
  color: var(--bpmm-text);
  text-decoration: none;
  font-weight: 800;
}

button.bp-megamenu__group-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

button.bp-megamenu__group-title:hover,
button.bp-megamenu__group-title:focus-visible {
  color: var(--bpmm-active);
  outline: none;
}

.bp-megamenu__accordion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bpmm-soft);
  color: var(--bpmm-muted);
  cursor: pointer;
}

.bp-megamenu__accordion[aria-expanded="false"] span {
  transform: rotate(135deg);
}

.bp-megamenu[dir="rtl"] .bp-megamenu__accordion span {
  transform: rotate(-135deg);
}

.bp-megamenu[dir="rtl"] .bp-megamenu__accordion[aria-expanded="false"] span {
  transform: rotate(-45deg);
}

.bp-megamenu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bp-megamenu__list--level-1,
.bp-megamenu__list--level-2,
.bp-megamenu__list--level-3,
.bp-megamenu__list--level-4,
.bp-megamenu__list--level-5,
.bp-megamenu__list--level-6,
.bp-megamenu__list--level-7,
.bp-megamenu__list--level-8 {
  padding-inline-start: .85rem;
  margin-block-start: .25rem;
  border-inline-start: 1px dashed var(--bpmm-border);
}

.bp-megamenu__list-link {
  display: block;
  padding: .25rem 0;
  color: var(--bpmm-muted);
  text-decoration: none;
  font-size: .92rem;
}

button.bp-megamenu__list-link {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: inherit;
  cursor: pointer;
}

.bp-megamenu__list-link--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.bp-megamenu__list-link--toggle[aria-expanded="true"],
.bp-megamenu__list-link--toggle:hover,
.bp-megamenu__list-link--toggle:focus-visible {
  color: var(--bpmm-active);
  outline: none;
}

.bp-megamenu__list-link--toggle[aria-expanded="true"] .bp-megamenu__list-chevron {
  transform: rotate(135deg);
}

.bp-megamenu[dir="rtl"] .bp-megamenu__list-link--toggle[aria-expanded="true"] .bp-megamenu__list-chevron {
  transform: rotate(-45deg);
}

.bp-megamenu__accordion-panel.is-collapsed,
.bp-megamenu__sublist-panel.is-collapsed {
  display: none;
}

.bp-megamenu__list-link:hover,
.bp-megamenu__list-item.is-current > .bp-megamenu__list-link,
.bp-megamenu__group.is-current > .bp-megamenu__group-head .bp-megamenu__group-title {
  color: var(--bpmm-active);
}

.bp-megamenu__empty {
  color: var(--bpmm-muted);
  margin: 0;
}


@media (min-width: 992px) {
  .bp-megamenu__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-megamenu__accordion {
    display: none;
  }

  .bp-megamenu__accordion-panel.is-collapsed,
  .bp-megamenu__sublist-panel.is-collapsed {
    display: block;
  }

  button.bp-megamenu__group-title,
  button.bp-megamenu__list-link--toggle {
    cursor: default;
    pointer-events: none;
  }

  .bp-megamenu__list-link--toggle {
    color: var(--bpmm-active);
  }

  .bp-megamenu__list-chevron {
    display: none;
  }
}

@media (max-width: 991px) {
  .bp-megamenu__panel {
    width: min(760px, 96vw);
  }

  .bp-megamenu__body {
    grid-template-columns: minmax(150px, 42%) 1fr;
  }

  .bp-megamenu__groups {
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  .bp-megamenu__tabs,
  .bp-megamenu__contents {
    padding: .65rem;
  }

  .bp-megamenu__tab {
    min-height: 42px;
    padding: .62rem .7rem;
    font-size: .92rem;
  }

  .bp-megamenu__group {
    padding: .68rem;
    border-radius: 14px;
  }

  .bp-megamenu__accordion {
    display: inline-flex;
  }

  .bp-megamenu__accordion-panel.is-collapsed {
    display: none;
  }
}

@media (max-width: 420px) {
  .bp-megamenu__panel {
    width: 100vw;
  }

  .bp-megamenu__body {
    grid-template-columns: 43% 57%;
  }

  .bp-megamenu__trigger-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* v1.2.4: make leaf category cards fully clickable. */
.bp-megamenu__group.no-children {
  padding: 0;
  overflow: hidden;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.bp-megamenu__group.no-children:hover,
.bp-megamenu__group.no-children:focus-within {
  border-color: #d7dce4;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.bp-megamenu__group.no-children .bp-megamenu__group-head {
  min-height: 100%;
  margin: 0;
  align-items: stretch;
}

.bp-megamenu__group.no-children .bp-megamenu__group-title {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: .8rem;
  border-radius: inherit;
}

.bp-megamenu__group.no-children .bp-megamenu__group-title:hover,
.bp-megamenu__group.no-children .bp-megamenu__group-title:focus-visible {
  background: var(--bpmm-soft);
}

@media (max-width: 991px) {
  .bp-megamenu__group.no-children {
    padding: 0;
  }

  .bp-megamenu__group.no-children .bp-megamenu__group-title {
    min-height: 48px;
    padding: .68rem;
  }
}

/* v1.2.5: extra links next to the desktop category button and below the mobile menu. */
.bp-megamenu__bar {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  max-width: 100%;
  vertical-align: middle;
}

.bp-megamenu__extra {
  min-width: 0;
}

.bp-megamenu__extra--desktop {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

.bp-megamenu__extra--mobile {
  display: none;
}

.bp-megamenu__extra-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .45rem .75rem;
  border-radius: 10px;
  color: var(--bpmm-text);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}

.bp-megamenu__extra-link:hover,
.bp-megamenu__extra-link:focus-visible {
  background: var(--bpmm-soft);
  color: var(--bpmm-active);
  outline: none;
}

@media (max-width: 991px) {
  .bp-megamenu__bar {
    display: inline-flex;
  }

  .bp-megamenu__extra--desktop {
    display: none;
  }

  .bp-megamenu__extra--mobile {
    display: flex;

    gap: .25rem;
    padding: .75rem;
    border-top: 1px solid var(--bpmm-border);
    background: #fbfbfc;
  }

  .bp-megamenu__extra--mobile .bp-megamenu__extra-link {

    min-height: 42px;
    justify-content: flex-start;
    padding: .6rem .75rem;
    border-radius: 12px;
  }
}


/* v1.2.6: explicit category entry link for items that have submenus. */
.bp-megamenu__view-all {
  color: var(--bpmm-active);
  text-decoration: none;
  font-weight: 700;
}

.bp-megamenu__view-all:hover,
.bp-megamenu__view-all:focus-visible {
  color: var(--bpmm-active);
  text-decoration: none;
  outline: none;
}

/* v1.3.5: keep View all beside parent category titles from level 2 downward. */
.bp-megamenu__group-title-row,
.bp-megamenu__list-link-row {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  min-width: 0;
}

.bp-megamenu__group-title-row {
  flex: 1 1 auto;
}

.bp-megamenu__list-link-row {
  justify-content: space-between;
}

.bp-megamenu__group-title-row .bp-megamenu__group-title,
.bp-megamenu__list-link-row .bp-megamenu__list-link {
  min-width: 0;
  flex: 1 1 auto;
}

.bp-megamenu__view-all--inline {
  flex: 0 0 auto;
  font-size: .76rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--bpmm-muted);
  white-space: nowrap;
}

.bp-megamenu__view-all--inline:hover,
.bp-megamenu__view-all--inline:focus-visible {
  color: var(--bpmm-active);
}

@media (max-width: 420px) {
  .bp-megamenu__group-title-row,
  .bp-megamenu__list-link-row {
    gap: .35rem;
  }

  .bp-megamenu__view-all--inline {
    font-size: .72rem;
  }
}


/* v1.3.6: optional category images by category depth. */
.bp-megamenu__category-text {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  max-width: 100%;
}

.bp-megamenu__category-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bp-megamenu__category-image {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bpmm-soft);
  border: 1px solid var(--bpmm-border);
}

.bp-megamenu__category-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bp-megamenu__tab .bp-megamenu__category-text,
.bp-megamenu__group-title .bp-megamenu__category-text,
.bp-megamenu__list-link .bp-megamenu__category-text {
  text-align: start;
}

.bp-megamenu__list-link .bp-megamenu__category-image {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.bp-megamenu__group-title .bp-megamenu__category-image {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

@media (max-width: 575px) {
  .bp-megamenu__category-image {
    width: 30px;
    height: 30px;
  }

  .bp-megamenu__group-title .bp-megamenu__category-image {
    width: 34px;
    height: 34px;
  }
}
