/* Ordely shared mobile filter dialog. Desktop catalogue layouts are untouched. */
.om-mf-trigger,
.om-mf-overlay {
  display: none;
}

html.om-mf-mobile .om-mf-trigger {
  position: fixed;
  z-index: 10020;
  left: 0;
  top: 50%;
  min-width: 54px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px 0 11px;
  border: 0;
  border-radius: 0 17px 17px 0;
  color: #fff;
  background: linear-gradient(145deg, #0877f6 0%, #08b8e5 55%, #11c9bd 100%);
  box-shadow: 0 14px 34px rgba(8, 119, 246, .32);
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html.om-mf-mobile .om-mf-trigger i {
  font-size: 21px;
  line-height: 1;
}

html.om-mf-mobile .om-mf-trigger__count {
  display: none;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #0877f6;
  background: #fff;
  font-size: 11px;
  font-weight: 1000;
}

html.om-mf-mobile .om-mf-trigger__count.is-visible {
  display: inline-flex;
}

html.om-mf-mobile .om-mf-overlay {
  position: fixed;
  z-index: 10040;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(5, 18, 48, .54);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

html.om-mf-mobile .om-mf-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.om-mf-dialog {
  width: min(100%, 600px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(8, 119, 246, .16);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(3, 20, 55, .34);
  transform: translateY(24px);
  transition: transform .22s ease;
}

.om-mf-overlay.is-open .om-mf-dialog {
  transform: translateY(0);
}

.om-mf-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid rgba(8, 119, 246, .12);
  background: linear-gradient(135deg, rgba(239, 249, 255, .98), rgba(239, 255, 249, .98));
}

.om-mf-head h2 {
  margin: 0;
  color: #07173f;
  font-size: 21px;
  font-weight: 1000;
  letter-spacing: -.03em;
}

.om-mf-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(8, 119, 246, .14);
  border-radius: 14px;
  color: #07173f;
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.om-mf-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.om-mf-body > .ocp-filters,
.om-mf-body > .osc-filters {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  display: block !important;
  grid-template-columns: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  background: #fff !important;
}

.om-mf-body .ocp-filter-head,
.om-mf-body .osc-filter-head {
  display: none !important;
}

.om-mf-body .ocp-filter-group,
.om-mf-body .osc-filter-group {
  border-right: 0 !important;
}

.om-mf-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(110px, .72fr) minmax(150px, 1.28fr);
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(8, 119, 246, .12);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -12px 32px rgba(10, 38, 84, .08);
}

.om-mf-reset,
.om-mf-apply {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 1000;
  cursor: pointer;
}

.om-mf-reset {
  border: 1px solid rgba(8, 119, 246, .20);
  color: #0877f6;
  background: #fff;
}

.om-mf-apply {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #0877f6 0%, #08b8e5 55%, #11c9bd 100%);
  box-shadow: 0 14px 28px rgba(8, 119, 246, .22);
}

body.om-mf-lock {
  overflow: hidden !important;
}

@media (max-width: 420px) {
  html.om-mf-mobile .om-mf-trigger {
    min-width: 50px;
    min-height: 50px;
    padding-inline: 10px 11px;
  }

  html.om-mf-mobile .om-mf-trigger__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .om-mf-dialog {
    border-radius: 22px;
  }
}

/* subcategory.php already has its own filter sheet; expose only its main
   trigger on mobile and keep the desktop chip row exactly as it was. */
@media (max-width: 767px) {
  .ordely-filterbar-wrap {
    position: static !important;
    z-index: auto !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .ordely-filterbar.js-filterbar {
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .ordely-filterbar.js-filterbar .fchip:not(.is-strong) {
    display: none !important;
  }

  .ordely-filterbar.js-filterbar .fchip.is-strong {
    position: fixed !important;
    z-index: 10020 !important;
    left: 0 !important;
    top: 50% !important;
    min-width: 58px !important;
    min-height: 52px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 14px 0 12px !important;
    border: 0 !important;
    border-radius: 0 17px 17px 0 !important;
    color: #fff !important;
    background: linear-gradient(145deg, #0877f6 0%, #08b8e5 55%, #11c9bd 100%) !important;
    box-shadow: 0 14px 34px rgba(8, 119, 246, .32) !important;
    transform: translateY(-50%) !important;
    font-size: 13px !important;
    font-weight: 950 !important;
  }

  .ordely-sheet.js-sheet {
    z-index: 10040 !important;
    padding: 12px !important;
    background: rgba(5, 18, 48, .54) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .ordely-sheet.js-sheet .sheet {
    --sheet-foot-offset: 0px;
    left: 12px !important;
    right: 12px !important;
    top: 12px !important;
    bottom: 12px !important;
    border-radius: 26px !important;
    border: 1px solid rgba(8, 119, 246, .16) !important;
    box-shadow: 0 28px 80px rgba(3, 20, 55, .34) !important;
  }

  .ordely-sheet.js-sheet .sheet-foot {
    bottom: 0 !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.om-mf-mobile .om-mf-overlay,
  .om-mf-dialog {
    transition: none;
  }
}
