/*
 * FASE 8.2 global refinement.
 * Keeps the split-link styles available on every route and prevents
 * legacy :focus-within from auto-opening the submenu after 8.2 takes
 * explicit control of disclosure state.
 */

/* Collections split navigation: text goes to landing, arrow opens submenu. */
@media (min-width: 1400px) {
  .bp81-nav > .bp81-collections {
    gap: 0 !important;
  }

  .bp81-nav > .bp81-collections > .bp82-collections-link {
    padding-right: 7px !important;
  }

  .bp81-nav > .bp81-collections > .bp82-collections-link::after {
    right: 0;
  }

  .bp81-nav > .bp81-collections > .bp82-collections-toggle {
    width: 30px;
    min-width: 30px;
    min-height: 44px;
    padding: 0 3px !important;
  }

  .bp81-nav > .bp81-collections > .bp82-collections-toggle::after {
    display: none !important;
  }

  .bp81-nav > .bp81-collections.current-menu-item > .bp82-collections-link,
  .bp81-nav > .bp81-collections.current-menu-ancestor > .bp82-collections-link {
    color: #171511 !important;
  }

  .bp81-nav .bp81-collections:not(.bp81-open):focus-within > .bp81-submenu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
  }

  .bp81-nav .bp81-collections:not(.bp81-open):focus-within > .bp82-collections-toggle .bp81-caret {
    margin-top: -3px !important;
    transform: rotate(45deg) !important;
  }

  .bp81-nav .bp81-collections.bp81-open > .bp81-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
}

@media (max-width: 1399px) {
  #book-mobile-menu .bp81-collections {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 54px;
    align-items: stretch;
  }

  #book-mobile-menu .bp81-collections > .bp82-collections-link {
    grid-column: 1;
    width: 100% !important;
    min-height: 52px !important;
    padding-right: 8px !important;
  }

  #book-mobile-menu .bp81-collections > .bp82-collections-toggle {
    grid-column: 2;
    width: 54px !important;
    min-width: 54px;
    min-height: 52px !important;
    justify-content: center !important;
    padding: 0 !important;
    border-left: 1px solid rgba(255,255,255,.08) !important;
  }

  #book-mobile-menu .bp81-collections > .bp82-collections-toggle .bp81-caret {
    margin-left: 0;
    margin-right: 0;
  }

  #book-mobile-menu .bp81-collections > .bp81-submenu {
    grid-column: 1 / -1;
  }
}
