/* Mobile listings UI overrides packaged as plugin for reuse across projects. */

body.product_list #productList .catalog-mobile-actions-row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-top: 1px solid #f0f1f3;
  border-bottom: 1px solid #f0f1f3;
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.product_list #productList .catalog-mobile-actions-row::-webkit-scrollbar {
  display: none;
}

body.product_list #productList .catalog-mobile-action-slot,
body.product_list #productList .listings_orderby_container {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto !important;
  max-width: max-content;
  border: 0 !important;
}

body.product_list #productList .catalog-mobile-action-slot::before,
body.product_list #productList .catalog-mobile-action-slot::after,
body.product_list #productList .listings_orderby_container::before,
body.product_list #productList .listings_orderby_container::after {
  display: none !important;
  content: none !important;
}

body.product_list #productList .listings_orderby_container .control {
  display: none !important;
}

body.product_list #productList .catalog-mobile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  max-width: max-content;
  min-height: 32px;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #f5f6f7;
  color: #222;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

body.product_list #productList .catalog-mobile-action-filter {
  color: #111;
  font-weight: 700;
  min-width: 98px;
}

body.product_list #productList .catalog-mobile-action-sort {
  min-width: 132px;
}

body.product_list #productList .catalog-mobile-action-text {
  display: inline-block;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

body.product_list #productList .catalog-mobile-action-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

body.product_list #productList .catalog-mobile-action-icon img {
  display: block;
  width: 13px;
  height: 13px;
}

body.product_list #productList .catalog-mobile-action-icon svg {
  display: block;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

body.product_list #productList .catalog-mobile-action-chevron {
  width: 7px;
  height: 7px;
  margin-top: -2px;
  border-right: 1.5px solid #777;
  border-bottom: 1.5px solid #777;
  transform: rotate(45deg);
}

body.product_list #productList .catalog-mobile-action.has-selection,
body.product_list #productList .catalog-mobile-action:active {
  background: #edf4ff;
  color: #1d63d8;
}

body.product_list #productList .catalog-mobile-action:focus-visible,
body.product_list #productList .catalog-active-filter-chip:focus-visible,
body.product_list #productList .catalog-active-filter-clear:focus-visible,
body.product_list #productList .filter-close-trigger:focus-visible,
body.product_list #productList .filter-footer-button:focus-visible,
body.product_list #productList .ml-filter-nav-button:focus-visible,
body.product_list #productList .ml-filter-options-toggle:focus-visible,
body.product_list #productList .sortSheet-option:focus-visible,
body.product_list #productList .sortSheet-back:focus-visible {
  outline: 2px solid #3483fa;
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  body.product_list #productList .catalog-mobile-actions-row {
    position: sticky;
    top: 0;
    z-index: 5;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    border-top: 0;
    overflow: visible;
  }

  body.product_list #productList .catalog-mobile-action-slot,
  body.product_list #productList .listings_orderby_container,
  body.product_list #productList .catalog-mobile-action {
    width: 100% !important;
    max-width: none;
  }

  body.product_list #productList .catalog-mobile-action-slot,
  body.product_list #productList .listings_orderby_container {
    min-width: 0;
  }

  body.product_list #productList .catalog-mobile-action {
    display: grid;
    grid-template-columns: minmax(16px, 1fr) auto minmax(16px, 1fr);
    justify-content: stretch;
    justify-items: center;
    min-height: 34px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body.product_list #productList .catalog-mobile-action-filter,
  body.product_list #productList .catalog-mobile-action-sort {
    min-width: 0;
  }

  body.product_list #productList .catalog-mobile-action-filter .catalog-mobile-action-icon {
    grid-column: 1;
  }

  body.product_list #productList .catalog-mobile-action-text {
    grid-column: 2;
    text-align: center;
  }

  body.product_list #productList .catalog-mobile-action-chevron {
    grid-column: 3;
  }

  body.product_list #productList .page-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f1f3;
    background: #fff;
    overflow-x: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.product_list #productList .page-filters::-webkit-scrollbar {
    display: none;
  }

  body.product_list #productList #activefilter {
    display: contents;
  }

  body.product_list #productList #activefilter:empty,
  body.product_list #productList #activefilter:empty + .catalog-active-filter-clear {
    display: none;
  }

  body.product_list #productList .catalog-active-filter-chip,
  body.product_list #productList .catalog-active-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 0 !important;
    border: 0;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.82rem;
    line-height: 1;
  }

  body.product_list #productList .catalog-active-filter-chip {
    gap: 7px;
    padding: 0 11px;
    background: #f5f6f7;
    color: #222;
    font-weight: 500;
  }

  body.product_list #productList .catalog-active-filter-chip-close {
    color: #777;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
  }

  body.product_list #productList .catalog-active-filter-clear {
    flex: 0 0 auto;
    padding: 0 4px;
    background: transparent;
    color: #3483fa;
    font-weight: 700;
    margin-left: 24px !important;
  }
}

body.product_list #productList .filterBox {
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10020 !important;
  display: flex;
  flex-direction: column;
  box-shadow: none !important;
  background: #fff;
  transform: translateX(102%) !important;
}

@media (max-width: 991.98px) {
  body.mobile-filter-drawer-open {
    overflow: hidden;
  }

  body.product_list #productList .filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(16, 25, 36, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.product_list #productList .filter-drawer-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  body.product_list #productList .filterBox {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(92vw, 430px) !important;
    max-width: 430px;
    border-radius: 0;
    box-shadow: -12px 0 28px rgba(0, 0, 0, 0.18) !important;
    transform: translateX(104%) !important;
    transition: transform 0.22s ease;
  }

  body.product_list #productList .filterBox .filter-footer {
    position: relative;
    bottom: auto;
    flex: 0 0 auto;
  }
}

body.product_list #productList .filterBox.is-active {
  transform: translateX(0) !important;
}

body.product_list #productList .filterBox .filter-header {
  flex: 0 0 50px;
  min-height: 50px !important;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
}

body.product_list #productList .filter-title {
  font-size: 0.94rem;
  font-weight: 700;
}

body.product_list #productList .filter-close-trigger {
  top: 7px !important;
  right: 8px !important;
  width: 36px;
  height: 36px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #fff;
}

body.product_list #productList .filter-close-trigger img {
  width: 14px;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-back {
  display: none !important;
}

body.product_list #productList .ml-filter-body {
  position: relative;
  display: grid;
  grid-template-columns: 30% 70%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

body.product_list #productList .filterBox.is-syncing .ml-filter-body {
  pointer-events: none;
}

body.product_list #productList .filterBox.is-syncing .ml-filter-body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(255, 255, 255, 0.72);
}

body.product_list #productList .filterBox.is-syncing .ml-filter-body::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 65%;
  z-index: 7;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border: 3px solid #d8e8ff;
  border-top-color: #3483fa;
  border-radius: 50%;
  animation: mobile-listings-spin 0.75s linear infinite;
}

body.product_list #productList .ml-filter-nav {
  overflow-y: auto;
  border-right: 1px solid #e1e4e8;
  background: #f7f7f8;
}

body.product_list #productList .ml-filter-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.product_list #productList .ml-filter-nav-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 9px 8px 9px 12px;
  border: 0;
  border-bottom: 1px solid #ddd;
  background: transparent;
  color: #242424;
  font-size: 0.76rem;
  line-height: 1.25;
  text-align: left;
}

body.product_list #productList .ml-filter-nav-button.is-active {
  background: #fff;
  color: #3483fa;
}

body.product_list #productList .ml-filter-nav-button.is-active::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #3483fa;
}

body.product_list #productList .ml-filter-nav-button.has-selection::after {
  content: "✓";
  margin-left: 6px;
  color: #3483fa;
  font-weight: 700;
}

body.product_list #productList .ml-filter-nav-count {
  min-width: 14px;
  margin-left: 4px;
  color: #3483fa;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

body.product_list #productList .ml-filter-content {
  min-width: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #fff;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filterList {
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .catalog-filter-section-row {
  display: none !important;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filterForm,
body.product_list #productList .filterBox.ml-filter-layout-ready .ml-filter-section {
  display: block !important;
  position: static !important;
  z-index: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 160px;
  padding: 18px 14px 22px;
  overflow: visible !important;
  background: #fff !important;
  scroll-margin-top: 8px;
}

body.product_list #productList .ml-filter-section-title {
  margin: 0 0 14px;
  color: #111;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .currentItems form {
  padding: 0 !important;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .currentItems input[type="text"] {
  height: 38px;
  margin-bottom: 14px !important;
  border: 1px solid #e1e3e6 !important;
  border-radius: 20px;
  background-color: #f7f8fa !important;
  font-size: 0.82rem;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto {
  border-bottom: 0 !important;
  padding: 0 !important;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 7px;
  margin: 0;
  padding: 0;
  border-top: 0 !important;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto li {
  display: inline-flex;
  margin: 0;
  border-bottom: 0 !important;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #d0d2d5;
  border-radius: 999px;
  background: #fff;
  color: #242424;
  font-size: 0.82rem;
  line-height: 1.1;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto li.selected label,
body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto input.selected + span,
body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto input:checked ~ span {
  color: #3483fa;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto li.selected label {
  border-color: #111;
  background: #fff;
  color: #111;
  box-shadow: inset 0 0 0 1px #111;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto li.is-disabled label {
  opacity: 0.48;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .filter-box-auto li.selected label::after {
  content: "✓";
  margin-left: 7px;
  color: #111;
  font-weight: 700;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .ml-filter-options-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 12px;
  padding: 7px 14px;
  border: 1px solid #d9e1ea;
  border-radius: 999px;
  background: #fff;
  color: #3483fa;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .ml-filter-options-toggle[hidden] {
  display: none;
}

body.product_list #productList .filterBox.ml-filter-layout-ready .count {
  margin-left: 4px;
  color: #777;
  font-size: 0.82rem;
}

body.product_list #productList .ml-filter-category-section .hlist,
body.product_list #productList .ml-filter-category-section ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

body.product_list #productList .ml-filter-category-section li,
body.product_list #productList .ml-filter-category-section a {
  color: #3483fa;
  font-size: 0.98rem;
  line-height: 1.7;
}

body.product_list #productList .filter-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #edf0f3;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -5px 16px rgba(0, 0, 0, 0.08);
}

body.product_list #productList .filter-footer-button {
  min-height: 38px;
  border-radius: 18px;
  font-size: 0.82rem;
  font-weight: 700;
}

body.product_list #productList .filter-footer-button-secondary {
  border: 0;
  background: #fff;
  color: #3483fa;
}

body.product_list #productList .filter-footer-button-primary {
  border: 0;
  background: #ff6f00;
  color: #fff;
}

body.product_list #productList .sortSheet-header {
  min-height: 60px;
  padding: 0 18px;
  border-bottom: 1px solid #edf2f7;
}

body.product_list #productList .sortSheet-back {
  width: 40px;
  height: 40px;
  border: 1px solid #d9e1ea;
  border-radius: 12px;
  background: #fff;
}

body.product_list #productList .sortSheet-back img {
  width: 14px;
}

body.product_list #productList .sortSheet-title {
  font-size: 1rem;
  color: #102a43;
}

body.product_list #productList .product-listings-results {
  position: relative;
  min-height: 180px;
}

body.product_list #productList .filterForm.is-active {
  position: absolute;
  top: 40px;
  z-index: 99999;
  overflow: auto;
  width: 96%;
  height: 100%;
  background: #fff;
}

body.product_list #productList .mobile-listings-loading {
  position: sticky;
  top: 12px;
  z-index: 12;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 28px);
  margin: 0 auto 12px;
  padding: 11px 14px;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 48, 96, 0.14);
  color: #0b376d;
  font-size: 0.9rem;
  font-weight: 700;
}

body.product_list #productList.is-loading .mobile-listings-loading {
  display: flex;
}

body.product_list #productList.is-loading #lisints_products,
body.product_list #productList.is-loading #listing_products {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.product_list #productList .mobile-listings-loading-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid #b9d2f1;
  border-top-color: #2f7cff;
  border-radius: 50%;
  animation: mobile-listings-spin 0.75s linear infinite;
}

body.product_list #productList .catalog-mobile-action:disabled,
body.product_list #productList .filter-footer-button:disabled {
  opacity: 0.55;
  pointer-events: none;
}

@keyframes mobile-listings-spin {
  to {
    transform: rotate(360deg);
  }
}
