/* =========================================================
   Header category mega menu
   Submenu column on one side, picture tiles + brands on the other
   ========================================================= */
.header-bottom .bottom-inner .category-list,
.sticky-header .category-list {
  position: relative;
}

/* Panel opens under the hovered category; bnMegaMenu() nudges it left when
   it would spill past the container edge. */
.header-bottom .bottom-inner .category-list > li.has-mega,
.sticky-header .category-list > li.has-mega {
  position: relative;
}

.bn-mega {
  --bn-mega-accent: var(--bn-primary);
  --bn-mega-ink: var(--bn-text);
  --bn-mega-muted: var(--bn-muted);
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 220;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  width: min(980px, calc(100vw - 48px));
  background: #fff;
  border: 1px solid #eef1f4;
  border-top: 2px solid var(--bn-mega-accent);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  text-align: left;
  white-space: normal;
  cursor: default;
}

.bn-mega--no-brands {
  width: min(800px, calc(100vw - 48px));
}

.header-bottom .bottom-inner .category-list > li.has-mega:hover > .bn-mega,
.sticky-header .category-list > li.has-mega:hover > .bn-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Left: subcategory list ---------- */
.bn-mega__aside {
  display: flex;
  flex-direction: column;
  padding: 18px 0 16px;
  background: #f8fafc;
  border-right: 1px solid #eef1f4;
}

.bn-mega__aside-head {
  padding: 0 20px 10px;
  color: var(--bn-mega-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.bn-mega__sub-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 268px;
  overflow-y: auto;
}

.bn-mega__sub-list::-webkit-scrollbar {
  width: 4px;
}

.bn-mega__sub-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #cbd5e1;
}

.bn-mega__sub-list > li {
  display: block;
  float: none;
  padding: 0;
  border: 0;
}

.bn-mega__sub-list > li > a {
  display: block;
  padding: 8px 20px;
  border-left: 2px solid transparent;
  color: var(--bn-mega-ink) !important;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  opacity: 1;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bn-mega__sub-list > li > a:hover {
  background: #fff;
  border-left-color: var(--bn-mega-accent);
  color: var(--bn-mega-accent) !important;
}

.bn-mega__aside-all {
  margin: 12px 20px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--bn-mega-accent);
  background: #fff;
  color: var(--bn-mega-accent) !important;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.bn-mega__aside-all:hover {
  background: var(--bn-mega-accent);
  color: #fff !important;
}

.bn-mega__aside-all i {
  font-size: 10px;
}

/* ---------- Right: picture tiles + brands ---------- */
.bn-mega__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 22px 20px;
  min-width: 0;
}

.bn-mega__block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bn-mega__block-head span {
  color: var(--bn-mega-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bn-mega__block-head a {
  color: var(--bn-mega-accent) !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
}

.bn-mega__block-head a:hover {
  text-decoration: underline !important;
}

.bn-mega__tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bn-mega__tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #eef1f4;
  background: #fff;
  text-decoration: none !important;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.bn-mega__tile:hover {
  transform: translateY(-3px);
  border-color: var(--bn-primary-tint);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.bn-mega__tile-media {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #f1f5f9;
  aspect-ratio: 4 / 3;
}

.bn-mega__tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.bn-mega__tile:hover .bn-mega__tile-media img {
  transform: scale(1.06);
}

.bn-mega__tile-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--bn-mega-ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.bn-mega__tile:hover .bn-mega__tile-name {
  color: var(--bn-mega-accent);
}

.bn-mega__block--brands {
  padding-top: 14px;
  border-top: 1px dashed #e8edf1;
}

.bn-mega__brands {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.bn-mega__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  background: #fff;
  text-decoration: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bn-mega__brand:hover {
  border-color: var(--bn-primary-tint);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.bn-mega__brand-media {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #f8fafc;
}

.bn-mega__brand-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bn-mega__brand-initial {
  font-size: 16px;
  font-weight: 800;
  color: var(--bn-mega-accent);
}

.bn-mega__brand-name {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  color: var(--bn-mega-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.bn-mega__brand:hover .bn-mega__brand-name {
  color: var(--bn-mega-accent);
}

@media (max-width: 1399px) {
  .bn-mega {
    width: min(880px, calc(100vw - 40px));
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .bn-mega__brands {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bn-mega__brand:nth-child(6) {
    display: none;
  }
}

@media (max-width: 1199px) {
  .bn-mega,
  .bn-mega--no-brands {
    width: min(760px, calc(100vw - 40px));
  }

  .bn-mega__tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bn-mega__tile:nth-child(4) {
    display: none;
  }
}

.header-bottom .bottom-inner .category-list > li:hover > a p,
.sticky-header .category-list > li:hover > a p {
  color: var(--bn-secondary);
}

/* Mobile uses the off-canvas category drawer instead */
@media (max-width: 991px) {
  .bn-mega {
    display: none;
  }
}
