/* ================== MEGA MENU (як special-sub-menu теми) ================== */
.hs-mega-menu {
  width: 225px;
  max-width: 225px;
  position: relative;
  overflow: visible !important;
  z-index: 100;
}

.hs-mega-menu.hs-hover-on {
  background: transparent;
  box-shadow: none;
}

.hs-mega-list {
  display: block;
  width: 225px;
  max-width: 225px;
  background: var(--hs-mega-bg, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.hs-mega-item {
  position: relative;
  border-bottom: 1px solid #dedede;
}

.hs-mega-item:last-child {
  border-bottom: none;
}

.hs-mega-title {
  display: block;
  padding: 12px 15px;
  margin: 0;
  border-radius: 0;
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: normal;
  color: var(--hs-mega-color, #2d2d2d) !important;
  white-space: normal !important;
  word-break: break-word !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hs-mega-menu.hs-hover-on .hs-mega-item:hover > .hs-mega-title {
  background: #f0f0f0;
  color: var(--hs-mega-color, #2d2d2d) !important;
}

/* ================== SUBMENU (flyout праворуч) ================== */
.hs-mega-sub {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 620px;
  width: max-content;
  max-width: calc(100vw - 280px);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  padding: 12px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  column-gap: 24px;
  row-gap: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 200;
  align-items: start;
}

.hs-mega-item:hover > .hs-mega-sub {
  opacity: 1;
  visibility: visible;
}

.hs-mega-sub a {
  display: block;
  text-decoration: none;
}

.hs-mega-sub-item {
  padding: 8px 0;
  margin: 0;
  border-radius: 0;
  text-transform: uppercase;
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.35;
  color: var(--hs-mega-sub-color, #2d2d2d);
  transition: color 0.2s ease;
}

.hs-mega-sub-item:hover {
  color: #111111;
  background: transparent;
}

.hs-mega-sub-list {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
}

.hs-mega-sub-list li a {
  padding: 4px 0;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.35;
  color: #555555;
}

.hs-mega-sub-list li a:hover {
  color: #2d2d2d;
}

/* ================== ІНТЕГРАЦІЯ З МЕНЮ ШАПКИ ================== */
ul.menu,
nav ul {
  overflow: visible !important;
}

.menu-item-hs-mega {
  position: static !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
}

.menu-item-hs-mega > .hs-mega-menu {
  width: 225px;
  display: block;
}

header .hs-mega-menu,
.site-header .hs-mega-menu,
.menu-item-hs-mega .hs-mega-menu {
  z-index: 9999 !important;
  position: relative;
}

.hs-demo-container .hs-mega-menu {
  z-index: 10 !important;
  position: relative;
}

/* ================== ВІДЖЕТ У САЙДБАРІ (внутрішні сторінки) ================== */
.secondary-sidebar .widget_hs_collapse_widget .hs-mega-menu,
.secondary-sidebar .widget_hs_collapse_widget .hs-mega-list {
  width: 225px;
  max-width: 225px;
}

.secondary-sidebar .widget_hs_collapse_widget .hs-mega-sub {
  min-width: 640px;
  max-width: calc(100vw - 300px);
}

/* ================== MOBILE ================== */
@media (max-width: 992px) {
  .hs-mega-menu,
  .hs-mega-list {
    width: 100%;
    max-width: 100%;
  }

  .hs-mega-sub {
    all: unset;
    display: none !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 0 0 15px !important;
    margin: 0 !important;
    box-shadow: none !important;
    grid-template-columns: 1fr !important;
  }

  .hs-mega-sub-item,
  .hs-mega-sub-list li a {
    display: block !important;
    width: 100% !important;
    font-size: 13px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    letter-spacing: 0.5px;
  }

  .hs-mega-item.active > .hs-mega-sub {
    display: block !important;
  }

  .hs-mega-title {
    font-size: 14px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
}
