/* ============================================================
   Overlay під cat-menu
   ============================================================ */

.cat-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #00000066;
  z-index: 99; /* нижче за cat-menu (100) */
}

.cat-menu-overlay.is-visible {
  display: block;
}

/* На mobile overlay не потрібен (cat-menu — повноекранний) */
@media (max-width: 767px) {
  .cat-menu-overlay {
    display: none !important;
  }
}

/* ============================================================
   Categories Mega-Menu
   ============================================================ */

.cat-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Mobile: фіксований оверлей поверх mobile-menu (z-index 999) */
@media (max-width: 767px) {
  .cat-menu {
    position: fixed;
    top: 92px; /* promo 24px + header 68px */
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
  }
}

.cat-menu.is-open {
  display: block;
}

/* ============================================================
   Внутрішній контейнер
   ============================================================ */

.cat-menu__wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
  background: #ffffff;
  border-top: 1px solid #e3e3e3;
  border-radius: 0 0 8px 8px;
  display: flex;
  align-items: flex-start;
}

/* Tablet: менший відступ */
@media (max-width: 1199px) {
  .cat-menu__wrap {
    padding: 24px;
  }
}

/* Mobile: колонкою */
@media (max-width: 767px) {
  .cat-menu__wrap {
    flex-direction: column;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 92px);
  }
}

/* ============================================================
   Ліва панель: список категорій
   ============================================================ */

.cat-menu__left {
  width: 342px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

@media (max-width: 767px) {
  .cat-menu__left {
    width: 100%;
    border-radius: 0;
  }
}

.cat-menu__item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: #ffffff;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Fact', sans-serif;
  transition: background-color 0.15s ease;
}

.cat-menu__item:hover,
.cat-menu__item.is-active {
  background: #fff3ed;
}

.cat-menu__item.is-active .cat-menu__icon,
.cat-menu__item.is-active .cat-menu__arrow
{
    filter: brightness(0) saturate(100%) invert(55%) sepia(77%) saturate(600%) hue-rotate(336deg) brightness(104%);
}
.cat-menu__item.is-active .cat-menu__item-text {
    color: #f96332;
    font-weight: 700;
}

.cat-menu__icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  overflow: hidden;
}

.cat-menu__item-text {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  color: #221f1f;
  font-family: 'Fact', sans-serif;
  white-space: nowrap;
}

.cat-menu__arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

/* ============================================================
   Права панель: підкатегорії
   ============================================================ */

.cat-menu__right {
  flex: 1;
  min-width: 0;
  padding: 16px 0;
  min-height: 398px;
}

/* Mobile: прихована за замовчуванням */
@media (max-width: 767px) {
  .cat-menu__right {
    display: none;
    width: 100%;
    padding: 0;
    min-height: 0;
  }
}

/* Кнопка "Назад" (тільки mobile) */
.cat-menu__back {
  display: none;
}

@media (max-width: 767px) {
  .cat-menu__back {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #e3e3e3;
    cursor: pointer;
    font-family: 'Fact', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #221f1f;
    text-align: left;
  }
}

.cat-menu__back-arrow {
  width: 24px;
  height: 24px;
  transform: rotate(90deg); /* стрілка ліворуч (назад) */
  flex-shrink: 0;
}

/* Drill-down: показуємо підкатегорії, ховаємо список (mobile) */
@media (max-width: 767px) {
  .cat-menu.cat-menu--show-sub .cat-menu__left {
    display: none;
  }

  .cat-menu.cat-menu--show-sub .cat-menu__right {
    display: flex;
    flex-direction: column;
  }
}

/* ============================================================
   Sub-panels
   ============================================================ */

.cat-menu__sub {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.cat-menu__sub.is-active {
  display: flex;
}

.cat-menu__sub-cols {
  display: flex;
  align-items: flex-start;
}

@media (max-width: 767px) {
  .cat-menu__sub-cols {
    flex-direction: column;
  }
}

.cat-menu__sub-col {
  width: 260px;
  flex-shrink: 0;
}

.cat-menu__sub-col--wide {
  width: 315px;
}

@media (max-width: 767px) {
  .cat-menu__sub-col,
  .cat-menu__sub-col--wide {
    width: 100%;
  }
}

/* Заголовок групи */
.cat-menu__group-title {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #221f1f;
  font-family: 'Fact', sans-serif;
}

/* Список посилань у групі */
.cat-menu__group-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.cat-menu__link {
  display: block;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 400;
  color: #221f1f;
  font-family: 'Fact', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

@media (max-width: 767px) {
  .cat-menu__link {
    white-space: normal;
    line-height: 1.4;
    padding: 4px 16px;
  }
}

.cat-menu__link:hover {
  color: #f96332;
}

/* Жирні заголовки-посилання (права колонка) */
.cat-menu__heading-link {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #221f1f;
  font-family: 'Fact', sans-serif;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cat-menu__heading-link:hover {
  color: #f96332;
}

/* ============================================================
   Промо-баннери
   ============================================================ */

.cat-menu__banners {
  display: flex;
  gap: 16px;
  padding: 0 16px;
}

.cat-menu__banner {
  width: 87px;
  height: 44px;
  flex-shrink: 0;
  background-color: #f0e6e5;
  border-radius: 4px;
}
