/* ===========================
   Moazeni Filters – UI Styles
   =========================== */

/* ---------- Root / Theme Tokens ---------- */
.mf-sidebar {
  direction: rtl;
  width: 380px;
  max-width: 95vw;
  --txt: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --brand: #111827;
  --accent: #0ea5e9;
  --success: #10b981;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --radius: 14px;
  --radius-sm: 10px;
  --ring: 2px solid rgba(14,165,233,.35);
  --shadow: 0 6px 20px rgba(2, 6, 23, .06);
  font-size: 14px;
  color: var(--txt);
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Wider Astra drawer (off-canvas on small screens) */
.astra-off-canvas-sidebar .astra-off-canvas-sidebar-wrapper {
  width: 400px !important;
  max-width: 95vw !important;
}

/* ---------- Header ---------- */
.mf-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 10px;
  margin: 0 0 8px;
  background: var(--bg);
}
.mf-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.mf-reset-all {
  font-size: 13px; color: var(--accent); text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.mf-reset-all:hover { background: var(--bg-soft); }
.mf-reset-all:focus-visible { outline: var(--ring); }

/* Close button (don’t let Astra style it like a CTA) */
.mf-sidebar .mf-close {
  all: unset;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; line-height: 1; font-size: 22px;
  color: var(--muted); border-radius: 12px; cursor: pointer; background: transparent;
}
.mf-sidebar .mf-close:hover { background: var(--bg-soft); color: var(--txt); }
.mf-sidebar .mf-close:focus-visible { outline: var(--ring); }

/* ---------- Sections / Accordions ---------- */
.mf-accordion { border-top: 1px solid var(--line); padding: 10px 0; }
.mf-accordion:first-of-type { border-top: 0; }
.mf-accordion__summary {
  cursor: pointer; font-weight: 800; list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.mf-accordion__summary::-webkit-details-marker { display: none; }
.mf-accordion__summary:after {
  content: "▾"; margin-right: auto; color: var(--muted); transition: transform .2s ease;
}
.mf-accordion[open] .mf-accordion__summary:after { transform: rotate(180deg); }
.mf-accordion__summary:hover { background: var(--bg-soft); }
.mf-accordion__summary:focus-visible { outline: var(--ring); }

/* ---------- Body (scrollable in off-canvas only) ---------- */
.mf-body { max-height: calc(100vh - 140px); overflow: auto; padding-right: 4px; -webkit-overflow-scrolling: touch; }

/* ---------- Facet Lists ---------- */
.mf-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 240px; overflow: auto; overscroll-behavior: contain; padding-inline-end: 2px; }
.mf-list::-webkit-scrollbar { width: 8px; }
.mf-list::-webkit-scrollbar-thumb { background: #d7dde5; border-radius: 999px; }
.mf-list::-webkit-scrollbar-thumb:hover { background: #c7ced9; }

.mf-check { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 6px; border-radius: 10px; }
.mf-check:hover { background: var(--bg-soft); }
.mf-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Price Range ---------- */
.mf-price { margin-top: 8px; padding: 6px 0 4px; }
.mf-price__inputs { display: flex; flex-direction: column; gap: 12px; }
.mf-field { display: flex; align-items: center; gap: 8px; position: relative; }
.mf-field > span:first-child { white-space: nowrap; font-weight: 700; color: var(--txt); min-width: 10px; }
.mf-field input {
  height: 48px; width: 110px; max-width: 110px !important; font-size: 15px;
  border-radius: 10px !important; padding: 0px; padding-inline-start: 25px;
  border: 1px solid var(--line); background: var(--bg); color: var(--txt);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mf-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.mf-suffix { position: absolute; inset-inline-start: 135px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }

/* Dual slider visuals */
.mf-range { position: relative; height: 24px; margin-top: 6px; }
.mf-range::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; transform: translateY(-50%); background: var(--line); border-radius: 999px; }
.mf-range__fill { position: absolute; left: 0; right: 0; top: 50%; height: 8px; transform: translateY(-50%); background: linear-gradient(90deg, var(--brand), var(--brand)); border-radius: 999px; pointer-events: none; }
.mf-range__handle {
  position: absolute; top: 50%; width: 22px; height: 22px;
  background: var(--brand); border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--brand); transform: translate(-50%, -50%);
  cursor: pointer; transition: transform .08s ease;
}
.mf-range__handle:active { transform: translate(-50%, -50%) scale(1.04); }
.mf-range__handle:focus-visible { outline: var(--ring); }
.mf-range__labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 4px; margin-top: 8px; }

/* ---------- Buttons (local styles only) ---------- */
.mf-actions { display: flex; gap: 10px; margin-top: 10px; }
.mf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 15px; border: 1px solid var(--brand);
  border-radius: 12px; font-weight: 800; cursor: pointer; font-size: 14px;
  transition: filter .15s ease, transform .08s ease; text-decoration: none;
}
.mf-btn--primary { background: var(--brand); color: #fff; }
.mf-btn--ghost { background: transparent; color: var(--accent); font-size: 12px;
    padding: 7px 15px; }
.mf-btn:hover { filter: brightness(1.05); }
.mf-btn:active { transform: translateY(1px); }
.mf-btn:focus-visible { outline: var(--ring); }

/* Beat Astra/Woo button styles inside sidebar */
.mf-sidebar .button,
.mf-sidebar .button.alt,
.mf-sidebar .woocommerce a.button,
.mf-sidebar .woocommerce button.button { all: unset; }

/* ---------- Chips ---------- */
.mf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mf-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  color: var(--txt); background: var(--bg-soft);
  transition: background .15s ease, border-color .15s ease;
  max-width: 100%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.mf-chip:hover { background: #eef6fb; border-color: #d1ecfb; }
.mf-chip:focus-visible { outline: var(--ring); }

/* ---------- Footer (sticky CTA in off-canvas only) ---------- */
.mf-footer__cta { position: sticky; bottom: 0; background: var(--bg); padding-top: 12px; }

/* ---------- Responsive ---------- */
@media (min-width: 1025px) {
  .mf-sidebar { position: sticky; top: 24px; }
}
@media (max-width: 1024px) {
  .mf-sidebar { position: sticky; top: 0; z-index: 10; border-radius: 0; border-left: 0; border-right: 0; }
  .astra-off-canvas-sidebar .astra-off-canvas-sidebar-wrapper { width: 96vw !important; max-width: 96vw !important; }
  .mf-sidebar { width: 100%; }
}
@media (max-width: 480px) {
  .mf-field input { height: 48px; font-size: 16px; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .mf-accordion__summary:after, .mf-btn, .mf-range__handle { transition: none; }
}


/* ==========================================================
   DESKTOP: real right-hand sidebar, products on the left
   ========================================================== */
@media (min-width: 1200px) {
  /* 2-col grid: content left | sidebar right */
  .ast-woocommerce-container {
    display: grid;
    grid-template-columns: 245px 1fr;  /* content | sidebar */
    gap: 20px;
    align-items: start;
    grid-auto-flow: row dense;
  }
.ast-shop-toolbar-container {
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
}

ul.products.columns-3 {
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
    margin-top: 60px;
}
  /* Sidebar slot pinned top-right, span all rows */
  #mf-desktop-slot {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    align-self: start;
  }

  /* The filter box when mounted in-page */
  #moazeni-filters-drawer.mf-sidebar--desktop {
    position: sticky;
    top: 24px;
    width: 250px;
    max-width: 300px;
    height: fit-content;
padding:15px;
  }



  /* Hide off-canvas triggers on desktop */
  .ast-shop-filter-trigger,
  .ast-shop-filter,
  .ast-filter-wrap .astra-shop-filter-button,
  .ast-shop-toolbar-container .ast-shop-filter,
  .mf-trigger { display: none !important; }

  /* When in-page, remove inner scroll/sticky to avoid nested scrollbars */
  .mf-body { max-height: none; overflow: visible; }
  .mf-header, .mf-footer__cta { position: static; }
}
