/* v1.3.29 — Global megamenu component (desktop + mobile) */

:root {
  --flm-header-offset: 118px;
  --flm-mega-overlay-top: 118px;
}

body.admin-bar {
  --flm-header-offset: 150px;
  --flm-mega-overlay-top: 150px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --flm-header-offset: 164px;
    --flm-mega-overlay-top: 164px;
  }
}

body.flmnt-mega-active::before {
  top: var(--flm-mega-overlay-top) !important;
}

body.flmnt-mega-active .flm-site-header .flm-nav {
  height: 70px !important;
}

@media (max-width: 900px) {
  body.flmnt-mega-active .flm-site-header .flm-nav {
    height: 56px !important;
  }

  body.flmnt-mega-active::before {
    display: none;
  }
}

.flm-site-header .flmnt-bumbu-mega {
  position: relative;
  z-index: 45;
}

.flm-site-header .flmnt-bumbu-mega__panel {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  left: auto;
  width: min(940px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: auto;
  max-height: min(520px, calc(100dvh - var(--flm-header-offset) - 24px));
  direction: rtl;
  grid-template-columns: 170px minmax(0, 1fr);
  transform: translateY(8px);
  overflow: hidden;
}

.flm-site-header .flmnt-bumbu-mega.is-open .flmnt-bumbu-mega__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.flm-site-header .flmnt-bumbu-mega__tabs {
  border-left: 1px solid #f0f0f0;
  border-right: 0;
  padding-left: 12px;
  padding-right: 0;
}

.flm-site-header .flmnt-bumbu-mega__contents {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .flm-mobile-mega-panel__body {
    padding-inline: 16px;
  }

  .flm-mobile-mega-panel .flmnt-mobile-catalog__contents {
    padding-inline: 14px 16px;
  }

  .flm-mobile-mega-panel .flmnt-mobile-catalog__tabs {
    padding-inline: 8px;
  }
}

@media (max-width: 430px) {
  .flm-mobile-mega-panel__head {
    padding-inline: 14px !important;
  }

  .flm-mobile-mega-panel__body,
  .flm-mobile-mega-panel .flmnt-mobile-catalog__contents {
    padding-inline: 12px 14px;
  }
}

@media (max-width: 360px) {
  .flm-mobile-mega-panel .flmnt-mobile-catalog {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }
}

/* v1.3.46 — desktop megamenu horizontal overflow guard */
@media (min-width: 901px) {
  .flm-site-header .flm-mega-v2.is-open .flm-mega-v2__panel {
    position: fixed;
    top: calc(var(--flm-header-offset, 118px) + 10px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(1500px, calc(100vw - 96px));
    max-width: min(1500px, calc(100vw - 96px));
    z-index: 10050;
  }

  .flm-site-header .flm-mega-v2__panel,
  .flm-site-header .flm-mega-v2__content,
  .flm-site-header .flm-mega-v2__panel-content,
  .flm-site-header .flm-mega-v2__material-grid,
  .flm-site-header .flm-mega-v2__card-grid {
    min-width: 0;
    max-width: none;
  }

  .flm-site-header .flmnt-bumbu-mega,
  .flmnt-bumbu-header .flmnt-bumbu-mega,
  .flm-site-header .flmnt-bumbu-mega *,
  .flmnt-bumbu-header .flmnt-bumbu-mega * {
    box-sizing: border-box;
  }

  .flm-site-header .flmnt-bumbu-mega__panel,
  .flmnt-bumbu-header .flmnt-bumbu-mega__panel {
    max-width: calc(100vw - 48px) !important;
    overflow-x: clip !important;
  }

  .flm-site-header .flmnt-bumbu-mega__contents,
  .flmnt-bumbu-header .flmnt-bumbu-mega__contents {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    overscroll-behavior-x: contain;
  }

  .flm-site-header .flmnt-bumbu-mega__content,
  .flmnt-bumbu-header .flmnt-bumbu-mega__content,
  .flm-site-header .flmnt-bumbu-mega__section,
  .flmnt-bumbu-header .flmnt-bumbu-mega__section {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  .flm-site-header .flmnt-bumbu-mega__grid,
  .flmnt-bumbu-header .flmnt-bumbu-mega__grid {
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(14px, 2vw, 28px) clamp(16px, 2.7vw, 42px) !important;
    overflow-x: clip !important;
  }

  .flm-site-header .flmnt-bumbu-mega__item,
  .flmnt-bumbu-header .flmnt-bumbu-mega__item {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .flm-site-header .flmnt-bumbu-mega__copy,
  .flmnt-bumbu-header .flmnt-bumbu-mega__copy {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .flm-site-header .flmnt-bumbu-mega__grid,
  .flmnt-bumbu-header .flmnt-bumbu-mega__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
