/* Mobile shop filters: sticky apply/clear above iOS Safari chrome */
@media (max-width: 991.98px) {
  /* #sidebar is rendered with `offcanvas-lg`, NOT `offcanvas`, so the
     `.offcanvas` selector never matched it and it fell back to Bootstrap's
     `height: 100%`. On iOS that resolves against the large viewport, pushing
     the sticky footer (apply / clear) behind Safari's toolbar where it can't
     be reached. Match both class names.
     Safe-area inset lives on .jkc-filter-footer only — adding it here too
     would double-count it. */
  #sidebar.offcanvas-lg,
  #sidebar.offcanvas,
  #sidebar-offcanvas-footer.offcanvas {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  #sidebar .offcanvas-body,
  #sidebar-offcanvas-footer .offcanvas-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }

  .jkc-filter-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e4e4e7;
    box-shadow: 0 -8px 24px rgba(28, 14, 51, 0.06);
  }

  .jkc-filter-apply {
    width: 100%;
    margin: 0 !important;
    border-radius: 999px;
    background-color: #85693f;
    color: #fff;
    border: 0;
    font-weight: 500;
    padding: 0.75rem 1rem;
  }

  .jkc-filter-apply:hover,
  .jkc-filter-apply:focus-visible {
    background-color: #85693f;
    color: #fff;
  }

  .jkc-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #85693f;
    font-size: 0.95rem;
    padding: 0.25rem;
  }

  .jkc-filter-clear[hidden] {
    display: none !important;
  }

  #sidebar .product-categories li.jkc-cat-pending::before,
  #sidebar-offcanvas-footer .product-categories li.jkc-cat-pending::before {
    border-color: #85693f;
  }

  #sidebar .product-categories li.jkc-cat-pending::after,
  #sidebar-offcanvas-footer .product-categories li.jkc-cat-pending::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    width: 5px;
    height: 9px;
    border: solid #85693f;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    pointer-events: none;
  }

  #sidebar .product-categories li.jkc-cat-deselected::before,
  #sidebar-offcanvas-footer .product-categories li.jkc-cat-deselected::before {
    border-color: #cfcfcf;
  }

  #sidebar .product-categories li.jkc-cat-deselected::after,
  #sidebar-offcanvas-footer .product-categories li.jkc-cat-deselected::after {
    display: none;
  }
}
