/*
 * Navigation and mobile filters
 *
 * This is the single authoritative home for off-canvas breakpoints and layer
 * ordering. Keep mobile/desktop sidebar behavior here so late app.css rules
 * cannot silently override it again.
 */

.sn-oc-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--sn-oc-z) - 1);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, .35);
  transition: opacity .22s ease, visibility 0s linear .22s;
}

body.sn-oc-open .sn-oc-backdrop {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .22s ease, visibility 0s;
}

/* Keep the primary dropdown above the elevated search composer, while leaving
   both the dropdown and composer below an open off-canvas menu/backdrop. */
#search-header nav[aria-label="Primary navigation"] {
  position: relative;
  z-index: calc(var(--sn-oc-z) - 10);
}

.sn-oc-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}

.sn-oc-title {
  color: #ecf0f1;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
}

.sn-oc-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #ecf0f1;
  background: transparent;
  cursor: pointer;
}

.sn-oc-close-btn:hover {
  color: #1abc9c;
  background: rgba(255, 255, 255, .06);
}

.sn-oc-close-btn:focus-visible {
  outline: 2px solid #52f2c4;
  outline-offset: 2px;
}

.sn-oc-close-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}

@media (max-width: 767.98px) {
  .custom-sidebar-menu {
    flex: 0 0 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .sn-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: var(--sn-oc-z) !important;
    width: var(--sn-oc-width);
    max-width: var(--sn-oc-maxw);
    height: var(--vh, 100vh) !important;
    height: 100dvh !important;
    max-height: none !important;
    transform: translateX(-100%) !important;
    transition: transform .22s ease-in-out;
    will-change: transform;
  }

  body.sn-oc-open .sn-sidebar {
    transform: translateX(0) !important;
  }

  body.sn-oc-open {
    overflow: hidden;
    touch-action: none;
  }
}

@media (min-width: 768px) {
  .sn-sidebar {
    position: sticky !important;
    top: 0;
    z-index: 1;
    align-self: flex-start;
    height: auto;
    max-height: none;
    overflow-y: auto;
  }

  .sn-oc-header {
    display: none;
  }
}

/* Progressive mobile filter panel. JavaScript adds these classes only when a
   legacy horizontal filter strip is present. Desktop retains the original row. */
.fs-mobile-filter-toggle {
  display: none;
}

@media (max-width: 767.98px) {
  .fs-mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 6px 0 3px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: 13px;
    font-weight: 600;
  }

  .fs-mobile-filter-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease;
  }

  .fs-mobile-filter-toggle[aria-expanded="true"]::after {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  .fs-filter-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    color: #15202b;
    background: #ffc107;
    text-align: center;
    font-size: 11px;
  }

  .scroll-container.fs-mobile-filter-panel {
    display: none;
    max-height: 50vh;
    margin: 4px 0 8px !important;
    padding: 10px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: rgba(10, 18, 28, .95);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
  }

  .scroll-container.fs-mobile-filter-panel.is-open {
    display: block;
  }

  .fs-mobile-filter-panel .scroll-button {
    display: none;
  }

  .fs-mobile-filter-panel .scroll-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    overflow: visible;
  }

  .fs-mobile-filter-panel .scroll-row > * {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .fs-mobile-filter-panel select,
  .fs-mobile-filter-panel input {
    width: 100%;
  }
}
