.mpf-filter-panel {
  --mpf-bg: #f3f3f3;
  --mpf-border: #8a8a8a;
  --mpf-title: #12213f;
  --mpf-text: #1f2b3a;
  --mpf-accent: #ccb06a;
  --mpf-track: #d4d4d8;
  --mpf-track-fill: #ccb06a;

  background: var(--mpf-bg);
  border: none;
  border-radius: 16px;
  padding: 18px 16px 16px;
  color: var(--mpf-text);
  box-shadow: none;
}

.mpf-filter-panel-toggle {
  display: none !important;
}

.mpf-panel-section + .mpf-panel-section {
  margin-top: 22px;
}

.mpf-section-header {
  margin-bottom: 12px;
}

.mpf-section-header h4 {
  margin: 0;
  color: var(--mpf-title);
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
}

.mpf-search label {
  margin: 0 0 12px 0 !important;
  display: block !important;
  color: var(--mpf-title) !important;
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
}

.mpf-search-wrap {
  margin-top: 0;
}

.mpf-filter-panel input[type="search"],
.mpf-filter-panel select {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 6px !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #1f2b3a !important;
  padding: 8px 14px !important;
  font-size: 1rem !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

.mpf-filter-panel input[type="search"]:focus,
.mpf-filter-panel select:focus {
  outline: none;
  border-color: var(--mpf-accent);
  box-shadow: 0 0 0 2px rgba(204, 176, 106, 0.24);
}

.mpf-price-slider {
  --mpf-range-left: 0%;
  --mpf-range-right: 100%;
}

.mpf-price-tags {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mpf-price-tags span {
  display: inline-block;
  background: var(--mpf-track-fill);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0;
  padding: 6px 10px;
  line-height: 1;
}

.mpf-range-wrap {
  position: relative;
  height: 28px;
}

.mpf-range-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--mpf-track) 0%,
    var(--mpf-track) var(--mpf-range-left),
    var(--mpf-track-fill) var(--mpf-range-left),
    var(--mpf-track-fill) var(--mpf-range-right),
    var(--mpf-track) var(--mpf-range-right),
    var(--mpf-track) 100%
  );
}

.mpf-range-wrap input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 28px;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  z-index: 2;
  outline: none;
}

.mpf-range-wrap input[type="range"][data-role="price-max"] {
  z-index: 3;
}

.mpf-range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--mpf-track-fill);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: pointer;
  margin-top: -6.5px;
  position: relative;
}

.mpf-range-wrap input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 5px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.mpf-range-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--mpf-track-fill);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: pointer;
  margin-top: 0;
}

.mpf-range-wrap input[type="range"]::-moz-range-track {
  width: 100%;
  height: 5px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.mpf-term-list,
.mpf-term-children {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mpf-term-children {
  margin-left: 24px !important;
  display: none;
  padding-left: 0 !important;
}

.mpf-term-item.is-open > .mpf-term-children {
  display: block !important;
}

.mpf-term-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 2px 0;
  position: relative;
}

.mpf-term-row label {
  flex: 1;
  color: #000 !important;
  font-size: 1rem !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 400 !important;
  transition: color 0.2s ease !important;
}

.mpf-term-row label:hover {
  color: #ccb06a !important;
}

.mpf-count {
  color: #9ca3af !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  margin-left: 4px !important;
}

.mpf-filter-panel .mpf-term-row input[type="checkbox"],
input[type="checkbox"][data-role="category"],
.mpf-term-row > input[type="checkbox"],
.elementor input[type="checkbox"][data-role="category"],
body input[type="checkbox"][data-role="category"],
html input[type="checkbox"][data-role="category"] {
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  appearance: auto !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  clip: auto !important;
  clip-path: none !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #ccb06a !important;
  border: 1.5px solid #9ca3af !important;
  border-radius: 3px !important;
  background: #fff !important;
  background-color: #fff !important;
  flex: 0 0 16px !important;
  pointer-events: auto !important;
  z-index: 0 !important; /* was 999: flex items respect z-index even when static, painting checkboxes over the sticky site header */
  cursor: pointer !important;
  transform: none !important;
  vertical-align: middle !important;
  outline-offset: 2px !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  float: none !important;
  order: 0 !important;
  filter: none !important;
  content: normal !important;
}

.mpf-filter-panel .mpf-term-row input[type="checkbox"]:checked {
  accent-color: #ccb06a !important;
  background-color: #ccb06a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.5 2.5L6 10 2.5 6.5l1-1L6 8l6.5-6.5z'/%3E%3C/svg%3E") !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.mpf-filter-panel .mpf-term-row input[type="checkbox"]:focus {
  outline: 2px solid #ccb06a !important;
  outline-offset: 2px !important;
}

.mpf-toggle {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  border: 0 !important;
  background-image: url('../images/chevron-down.svg') !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  order: 10 !important;
  position: relative !important;
  visibility: visible !important;
  opacity: 0.7 !important;
  box-shadow: none !important;
  outline: none !important;
  transition: opacity 0.2s ease !important;
}

.mpf-toggle:hover {
  opacity: 1 !important;
}

.mpf-toggle span {
  display: none !important;
}

.mpf-term-item.is-open > .mpf-term-row .mpf-toggle {
  background-image: url('../images/chevron-up.svg') !important;
}

.mpf-term-item.depth-0 > .mpf-term-row {
  font-weight: 500;
}

.mpf-term-item.depth-1 > .mpf-term-row {
  padding-left: 0;
}

.mpf-term-item.depth-2 > .mpf-term-row,
.mpf-term-item.depth-3 > .mpf-term-row,
.mpf-term-item.depth-4 > .mpf-term-row {
  padding-left: 0;
}

.mpf-actions {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.mpf-actions button {
  border: none !important;
  background: #ccb06a !important;
  background-color: #ccb06a !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 10px 18px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
  transition: background-color 0.2s ease !important;
}

.mpf-actions button:hover {
  background: #b89d5a !important;
  background-color: #b89d5a !important;
  color: #fff !important;
  text-decoration: none !important;
}

.mpf-status {
  font-size: 14px;
  color: #6b7280;
  min-height: 18px;
}

.mpf-target-loading-wrap {
  position: relative;
}

.mpf-target-loading {
  display: none !important;
}

.mpf-filter-panel.is-loading {
  opacity: 0.82;
}

.mpf-products-grid {
  position: relative;
  width: 100%;
}

.mpf-products-inner {
  display: grid;
  grid-template-columns: repeat(var(--mpf-cols, 5), 1fr);
  gap: 20px;
  width: 100%;
}

/* Equal-height cards: stretch items to fill grid row, then flex
   the Elementor content to fill the item. This mirrors what
   Elementor's native loop grid does internally. */
.mpf-product-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mpf-product-item > .elementor {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mpf-product-item > .elementor > .e-con,
.mpf-product-item > .elementor > .elementor-inner {
  flex: 1;
}

/* Consistent price styling across all filtered product grids */
.mpf-products-grid .price {
  color: #6F4107;
  font-family: "Poppins", Sans-serif;
  font-size: 30px !important;
  font-weight: 500;
}

/* Prevent default anchor styles from overriding Elementor button styling */
.mpf-products-grid .mpf-product-item a.button,
.mpf-products-grid .mpf-product-item a.add_to_cart_button,
.mpf-products-grid .mpf-product-item a.elementor-button,
.mpf-products-grid .mpf-product-item a.elementor-button-link,
.mpf-products-grid .mpf-product-item .elementor-element a {
  text-decoration: none !important;
  font-weight: 700 !important;
}

.mpf-no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  font-size: 1.1rem;
  color: #6b7280;
}

.mpf-lazy-sentinel {
  width: 100%;
  margin-top: 30px;
  margin-bottom: 30px;
  pointer-events: none;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mpf-lazy-loader {
  display: none;
  align-items: center;
  justify-content: center;
}

.mpf-lazy-loader.is-visible {
  display: flex !important;
}

.mpf-products-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  display: none;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 16px;
  padding-top: 60px;
  z-index: 100;
}

.mpf-products-overlay.is-visible {
  display: flex !important;
}

.mpf-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(204, 176, 106, 0.2);
  border-top-color: #ccb06a;
  border-radius: 50%;
  animation: mpf-spin 0.8s linear infinite;
}

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

.mpf-loading-text {
  font-size: 1.1rem;
  color: #1f2b3a;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .mpf-filter-panel {
    padding: 16px;
    border-radius: 14px;
  }

  .mpf-section-header h4 {
    font-size: 1.75rem;
  }

  .mpf-filter-panel input[type="search"],
  .mpf-filter-panel select {
    font-size: 1rem;
  }

  .mpf-term-row label {
    font-size: 1rem;
  }

  .mpf-products-inner {
    grid-template-columns: repeat(var(--mpf-cols-tablet, 3), 1fr);
    gap: 16px;
  }

  .mpf-product-item img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 767px) {
  .mpf-filter-panel {
    position: relative !important;
    padding: 12px !important;
  }

  .mpf-filter-panel-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    background: var(--mpf-accent) !important;
    background-color: #ccb06a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    gap: 8px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
  }

  .mpf-filter-panel:not(.is-collapsed) .mpf-filter-panel-toggle {
    margin-bottom: 16px !important;
  }

  .mpf-filter-panel-toggle:hover {
    background: #b89d5a !important;
    background-color: #b89d5a !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15) !important;
  }

  .mpf-filter-panel-toggle::after {
    content: '' !important;
    width: 12px !important;
    height: 12px !important;
    background-image: url('../images/chevron-down.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1) !important;
    transition: transform 0.3s ease !important;
    margin-top: 3px !important;
  }

  .mpf-filter-panel.is-collapsed .mpf-filter-panel-toggle::after {
    transform: rotate(-180deg) !important;
  }

  .mpf-filter-panel-content {
    display: block !important;
    transition: max-height 0.3s ease, opacity 0.3s ease !important;
    max-height: 2000px !important;
    opacity: 1 !important;
    overflow: hidden !important;
  }

  .mpf-filter-panel.is-collapsed .mpf-filter-panel-content {
    max-height: 0 !important;
    opacity: 0 !important;
  }

  .mpf-products-inner {
    grid-template-columns: repeat(var(--mpf-cols-mobile, 2), 1fr) !important;
    gap: 12px !important;
  }

  .mpf-product-item {
    min-width: 0;
  }

  .mpf-product-item img {
    max-width: 100%;
    height: auto;
  }
}
