/* The filter controls stay in the normal sidebar at desktop widths. */
.mobile-filter-header,
.mobile-filter-footer,
.mobile-filter-selected {
  display: none;
}

.catalog-spinner[aria-busy="true"] {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(19, 25, 33, .55);
  z-index: 2147483647;
}

.catalog-spinner[aria-busy="true"] .spinner-border {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, .35);
  border-top-color: #ffc600;
  border-radius: 50%;
  animation: mobile-filter-loading .7s linear infinite;
}

@keyframes mobile-filter-loading {
  to { transform: rotate(360deg); }
}

@media (min-width: 992px) {
  .sidebar-container.mobile-filter-panel {
    display: block;
    position: relative;
    top: auto;
    left: auto;
    width: 16.66666667%;
    z-index: auto;
  }
}

@media (max-width: 991px) {
  .sidebar-container.mobile-filter-panel {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: 0;
    background: rgba(19, 25, 33, .68);
    z-index: 2147483647;
    overscroll-behavior: none;
  }

  .sidebar-container.mobile-filter-panel.is-open {
    display: flex;
  }

  .mobile-filter-panel .sidebar {
    display: flex;
    flex-direction: column;
    float: none;
    width: calc(100% - 32px);
    max-width: 400px;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: #343434;
    border-radius: 0 16px 16px 0;
    box-shadow: 8px 0 32px rgba(0, 0, 0, .2);
    animation: mobile-filter-enter .2s ease-out;
  }

  .mobile-filter-panel .mobile-filter-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px 20px;
    border-bottom: 1px solid #e6e8eb;
    background: #131921;
    color: #fff;
  }

  .mobile-filter-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
  }

  .mobile-filter-panel .sidebar-close {
    display: inline-flex;
    position: static;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: inherit;
    font: inherit;
    font-size: 32px;
    cursor: pointer;
  }

  .mobile-filter-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 20px 20px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-filter-panel .sidebar .block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .mobile-filter-panel .faceted-search-facet {
    padding: 16px 0;
    border-bottom: 1px solid #e6e8eb;
  }

  .mobile-filter-panel .faceted-search-facet h3 {
    display: block;
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
  }

  .mobile-filter-panel .faceted-search-facet h3 + br {
    display: none;
  }

  .mobile-filter-panel .faceted-search-guided {
    margin-bottom: 0;
  }

  .mobile-filter-panel .faceted-search-category:not(.fsc-color) {
    align-items: center;
    min-height: 44px;
    height: auto;
    gap: 10px;
  }

  .mobile-filter-panel input.filter-checkbox {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: #131921;
  }

  .mobile-filter-panel .faceted-search-facet > input.filter-checkbox {
    margin-right: 10px;
    vertical-align: middle;
  }

  .mobile-filter-panel .mobile-filter-selected:not([hidden]) {
    display: block;
    flex: 0 0 auto;
    max-height: 25%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 20px;
    border-bottom: 1px solid #e6e8eb;
    background: #f4f6f8;
  }

  .mobile-filter-selected-title {
    margin-bottom: 8px;
    color: #59636e;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #cbd2d9;
    border-radius: 18px;
    background: #fff;
    color: #131921;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
  }

  .mobile-filter-chip span:last-child {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-filter-panel .fsc-color.is-selected .circle-container {
    outline: 3px solid #131921;
    outline-offset: 2px;
  }

  .mobile-filter-panel .facet-label a {
    white-space: normal;
  }

  /* Use one scroll area instead of small nested scroll boxes for each facet. */
  .mobile-filter-panel .faceted-search-facet .item-list {
    max-height: none;
    overflow: visible;
  }

  .mobile-filter-panel .faceted-search-facet--taxonomy--14 .item-list:not(.expanded) {
    max-height: 80px;
    overflow: hidden;
  }

  .mobile-filter-panel .faceted-search-facet li a {
    display: inline-block;
    padding: 10px 0;
    font-size: 16px;
  }

  .mobile-filter-panel .faceted-search-facet .fsc-color a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0;
  }

  .mobile-filter-panel .faceted-search-facet--taxonomy--14 ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    gap: 4px;
    padding: 0;
  }

  .mobile-filter-panel .circle-container {
    float: none;
    margin: 0;
  }

  .mobile-filter-panel .show-more-link {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .mobile-filter-panel .mobile-filter-footer {
    display: block;
    flex: 0 0 auto;
    padding: 16px 20px max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid #e6e8eb;
    background: #fff;
  }

  .mobile-filter-results {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: #ffc600;
    color: #131921;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-filter-panel button:focus-visible {
    outline: 3px solid #2684ff;
    outline-offset: 3px;
  }

  body.mobile-filters-open #chat-widget-container,
  body.mobile-filters-open #google-merchantwidget-iframe-wrapper,
  body.mobile-filters-open #cookiescript_badge {
    visibility: hidden !important;
  }
}

@keyframes mobile-filter-enter {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-filter-panel .sidebar { animation: none; }
}

/* Homepage desktop drawer: loaded with the shared filter styles. */
@media (min-width: 992px) {
  .front .sidebar-container.mobile-filter-panel {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: 0;
    background: rgba(19, 25, 33, .68);
    z-index: 2147483647;
    overscroll-behavior: none;
  }
  .front .sidebar-container.mobile-filter-panel.is-open {
    display: flex;
  }
  .front .mobile-filter-panel .sidebar {
    display: flex;
    flex-direction: column;
    float: none;
    width: 360px;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: #343434;
    border-radius: 0 16px 16px 0;
    box-shadow: 8px 0 32px rgba(0, 0, 0, .2);
  }
  .front .mobile-filter-panel .mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 12px 16px 12px 20px;
    background: #131921;
    color: #fff;
  }
  .front .mobile-filter-header h2 {
    margin: 0;
    font-size: 22px;
  }
  .front .mobile-filter-panel .sidebar-close {
    display: inline-flex;
    position: static;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: inherit;
    font-size: 32px;
    cursor: pointer;
  }
  .front .mobile-filter-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 8px 20px 20px;
  }
  .front .mobile-filter-panel .mobile-filter-selected:not([hidden]) {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid #e6e8eb;
  }
  .front .mobile-filter-chip {
    margin: 4px 4px 0 0;
    border: 1px solid #ccd4df;
    border-radius: 16px;
    background: #f5f8fb;
    padding: 4px 10px;
  }
  .front .mobile-filter-chip > span + span {
    margin-left: 8px;
  }
  .front .mobile-filter-panel .mobile-filter-footer {
    display: block;
    flex: 0 0 auto;
    padding: 16px 20px;
    border-top: 1px solid #e6e8eb;
    background: #fff;
  }
  .front .mobile-filter-results {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: #ffc600;
    color: #131921;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
}
