.nav-dropdown:has(.brande-cat-menu[data-bcm]),
.brande-cat-menu[data-bcm] {
  --bcm-radius: 12px;
  box-shadow: 0 16px 40px 4px rgb(0 0 0 / 38%), 0 3px 10px rgb(0 0 0 / 26%) !important;
  border-radius: var(--bcm-radius);
  background-color: #F5F5F5;
}
.brande-cat-menu[data-bcm] {
  --menu-height: min(63vh, 570px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr)) minmax(0,.85fr);
  align-items: start;
  gap: clamp(8px,1.5vw,24px);
  width: min(1120px,calc(100vw - 32px));
  padding: clamp(12px,2vw,24px);
  padding-right: 0.5cm;
  color: #222;
}
.brande-cat-menu .bcm-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(330px,var(--menu-height));
  object-fit: contain;
  margin-inline: auto;
  border-radius: var(--bcm-radius);
}
.brande-cat-menu .bcm-preview img[hidden] { display: none; }
.brande-cat-menu .bcm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: var(--menu-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.brande-cat-menu .bcm-list > li {
  display: flex;
  align-items: stretch;
  margin: 0;
  border-bottom: 1px solid #d9d9d9;
}
.bcm-list > li > a, .bcm-list > li > button {
  display: block;
  padding: 10px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  color: inherit;
}
.bcm-list > li > a { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.bcm-list > li > button { margin: 0; background: transparent; border: none; box-shadow: none; font-size: 16px; }
.bcm-list > li.bcm-selected, .bcm-list > li:hover { background: #d8d8d8; color: #192d72; }
.bcm-list :focus-visible { outline: 2px solid #3154ee; outline-offset: -2px; }
@media (min-width: 850px) {
  .brande-cat-menu[data-bcm] {
    width: min(990px + 1cm, 100%, calc(100vw - 32px));
    grid-template-columns: minmax(0,198px) repeat(3,minmax(0,1fr));
    grid-template-areas: "photo root branch leaf";
    gap: 10px;
    padding: 12px 0.5cm 12px 12px;
    padding-left: calc(12px + 0.5cm);
  }
  .brande-cat-menu[data-bcm] > [data-level="0"] { grid-area: root; }
  .brande-cat-menu[data-bcm] > [data-level="1"] { grid-area: branch; }
  .brande-cat-menu[data-bcm] > [data-level="2"] { grid-area: leaf; }
  .brande-cat-menu[data-bcm] > .bcm-preview { grid-area: photo; }
  .nav-dropdown:has(.brande-cat-menu[data-bcm]) {
    box-sizing: border-box;
    width: min(990px + 1cm, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    padding: 0 !important;
  }
  :is(li:hover, li:focus-within, .current-dropdown, .has-dropdown.show) .nav-dropdown:has(.brande-cat-menu[data-bcm])[style*="--bcm-left"] {
    left: var(--bcm-left) !important;
    right: auto !important;
    margin-left: 0 !important;
    translate: none;
    transform: none !important;
  }
}
@media (max-width: 849px) {
  .brande-cat-menu[data-bcm] { width: 100%; grid-template-columns: minmax(75px,33%) minmax(0,1fr); max-height: 72vh; overflow-y: auto; }
  .bcm-preview { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 0; }
  .brande-cat-menu .bcm-preview img { max-height: 180px; }
  .brande-cat-menu .bcm-list { grid-column: 2; max-height: 28vh; }
  .bcm-list:empty { display: none; }
}

/* The dropdown casts the shadow when it wraps the menu. */
.nav-dropdown .brande-cat-menu[data-bcm] { box-shadow: none !important; }
