/* Mobile filter overlay as a right-side drawer. Ported from betheme-child impact_filter_overlay_fix(). */
@media (max-width: 600px) {

  /* Dark backdrop matching BeTheme body_overlay */
  body > .wc-block-product-filters__overlay {
    background-color: rgba(0,0,0,0.68) !important;
  }

  /* Panel: right-side drawer matching #Side_slide */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-dialog {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 85% !important;
    max-width: 340px !important;
    height: 100% !important;
    border-radius: 0 !important;
    background-color: #f6f8fa !important;
    box-shadow: -4px 0 24px rgba(0,0,0,0.22) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: translateX(110%) !important;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1) !important;
  }
  body > .wc-block-product-filters__overlay.is-slide-open .wc-block-product-filters__overlay-dialog {
    transform: translateX(0) !important;
  }

  /* Hide site header behind overlay */
  body.filter-panel-open #Top_bar,
  body.filter-panel-open header {
    z-index: 0 !important;
  }

  /* ── HEADER (matches Side_slide .close-wrapper height:60px) ── */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 13px 0 20px !important;
    border-bottom: 1px solid rgba(58,71,82,0.12) !important;
    background: #f6f8fa !important;
    flex-shrink: 0 !important;
  }
  /* Hide WC native header heading — the content "Filters" block is moved here via JS */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header h1:not(.wp-block-heading),
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header h2:not(.wp-block-heading),
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header h3:not(.wp-block-heading),
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header h4:not(.wp-block-heading) {
    display: none !important;
  }

  /* "Filters" heading moved into header by JS */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-header .wp-block-heading {
    display: block !important;
    flex: 1 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    color: #c00000 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    font-family: "IBM Plex Sans", sans-serif !important;
  }

  /* Close button — matches Side_slide a.close (34×34, float right, margin 13px) */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__close-overlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #3a4752 !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: color 0.2s !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filters__close-overlay:hover {
    color: #c00000 !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filters__close-overlay span {
    display: none !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filters__close-overlay svg {
    width: 22px !important;
    height: 22px !important;
  }

  /* ── SCROLLABLE CONTENT ── */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 !important;
  }

  /* Each filter block — like menu list items with subtle separator */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-content > * {
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(58,71,82,0.08) !important;
  }

  /* Section headings */
  body > .wc-block-product-filters__overlay .wp-block-heading {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: #c00000 !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    font-family: "IBM Plex Sans", sans-serif !important;
  }

  /* Checkbox list items — like menu li */
  body > .wc-block-product-filters__overlay .wc-block-product-filter-checkbox-list__item {
    padding: 9px 0 !important;
    border-bottom: 1px solid rgba(58,71,82,0.04) !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filter-checkbox-list__item:last-child {
    border-bottom: none !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filter-checkbox-list__label {
    font-size: 14px !important;
    color: #3a4752 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    line-height: 19px !important;
    font-family: "IBM Plex Sans", sans-serif !important;
    transition: color 0.15s !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filter-checkbox-list__item:hover .wc-block-product-filter-checkbox-list__label {
    color: #c00000 !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filter-checkbox-list__input {
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;
    accent-color: #c00000 !important;
    cursor: pointer !important;
    margin: 0 !important;
  }

  /* Price slider */
  body > .wc-block-product-filters__overlay .wc-block-product-filter-price-slider__range-input-progress {
    background: #c00000 !important;
  }
  body > .wc-block-product-filters__overlay input[type=range]::-webkit-slider-thumb {
    background: #c00000 !important;
    border-color: #c00000 !important;
  }
  body > .wc-block-product-filters__overlay input[type=range]::-moz-range-thumb {
    background: #c00000 !important;
    border-color: #c00000 !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filter-price-slider__amount {
    border: 1px solid rgba(58,71,82,0.2) !important;
    border-radius: 2px !important;
    background: #ffffff !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
    color: #3a4752 !important;
    text-align: center !important;
  }

  /* ── FOOTER ── */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__overlay-footer {
    flex-shrink: 0 !important;
    padding: 14px 20px !important;
    background: #f6f8fa !important;
    border-top: 1px solid rgba(58,71,82,0.12) !important;
  }

  /* Apply button — matching Impact CTA style */
  body > .wc-block-product-filters__overlay .wc-block-product-filters__apply,
  body > .wc-block-product-filters__overlay .wc-block-components-button.wc-block-product-filters__apply {
    width: 100% !important;
    background-color: #c00000 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 13px 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    font-family: "IBM Plex Sans", sans-serif !important;
    transition: background-color 0.2s !important;
  }
  body > .wc-block-product-filters__overlay .wc-block-product-filters__apply:hover {
    background-color: #a50000 !important;
  }
}
