/* ======================================================================
   More Filters — Offcanvas (adv-collapse)
   Matches Settings / custom-offcanvas visual style
   ====================================================================== */

/* Fallback if blur isn't supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #adv-collapse.offcanvas {
    background: #0f274b;
  }
}

/* Shell ---------------------------------------------------------------- */
#adv-collapse.offcanvas {
  --bs-offcanvas-width: min(92vw, 420px);

  width: var(--bs-offcanvas-width) !important;

  background: rgba(16, 38, 79, 0.90);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);

  color: var(--text-strong);
  border-left: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: var(--elev-3);

  /* keep Bootstrap's scroll behaviour from `scrollable=True` */
}

@media (max-width: 576px) {
  #adv-collapse.offcanvas {
    border-radius: 0;
  }
}

/* Header --------------------------------------------------------------- */
#adv-collapse .offcanvas-header {
  border-bottom: 1px solid var(--divider-glass);
  padding: 0.85rem 1.25rem;
}

#adv-collapse .offcanvas-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  color: var(--text-strong);
}

#adv-collapse .btn-close {
  filter: invert(1) opacity(0.8);
}
#adv-collapse .btn-close:hover {
  opacity: 1;
}

/* Body layout ---------------------------------------------------------- */
#adv-collapse .offcanvas-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
}

/* Section labels (Product / Pack / Commercial) ------------------------ */
#adv-collapse h6.text-muted {
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

#adv-collapse hr {
  border-color: var(--divider-glass);
  opacity: 1;
  margin-top: 0.1rem;
  margin-bottom: 0.4rem;
}

/* Wrap around each group of filter chips ------------------------------ */
/* (targets your `d-flex flex-wrap gap-2 mb-3` containers) */
#adv-collapse .d-flex.flex-wrap.gap-2.mb-3 {
  background: var(--surface-glass-weak);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.75rem !important;
}

/* Filter “chips” ------------------------------------------------------- */
/* All buttons inside the drawer except the close button */
/* Chip styling inside More filters – exclude the pill funnel button */
#adv-collapse .btn:not(.btn-close):not(.pill-right) {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-strong);
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: none;
}


#adv-collapse .btn:not(.btn-close):hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-0.5px);
}

#adv-collapse .btn:not(.btn-close):active {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(0);
}

#adv-collapse .btn:not(.btn-close):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Optional: if your chips use icons, make them slightly softer */
#adv-collapse .btn:not(.btn-close) i,
#adv-collapse .btn:not(.btn-close) svg {
  opacity: 0.9;
}
/* Keep both halves of the pill the same height and remove any overlap */
.pill-control .pill-left,
.pill-control .pill-right {
  height: 32px;
  min-height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Make the join between white label and blue button perfectly straight */
.pill-control .pill-left {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.pill-control .pill-right {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
/* Inside the More filters drawer: hide the white lip under the blue half */
#adv-collapse .pill-control {
  overflow: hidden;                 /* nothing can stick out of the pill */
}

#adv-collapse .pill-control .pill-left {
  border-right-color: transparent;  /* no bright border under the join */
}

#adv-collapse .pill-control .pill-right {
  position: relative;
  z-index: 2;
  margin-left: -1px;                /* overlap the shared border by 1px */
}


/* In More filters drawer only, make the label background transparent */
#adv-collapse .pill-control .pill-left {
  background-color: transparent !important;
}
/* In the More filters drawer, clean up the pill join */
#adv-collapse .pill-control {
  overflow: hidden;                 /* anything sticking out is clipped */
}

/* Kill the bright border under the blue half */
#adv-collapse .pill-control .pill-left {
  border-right-color: transparent;  /* no white line on the join */
}

/* Pull the blue funnel half 1px over the label */
#adv-collapse .pill-control .pill-right {
  position: relative;
  z-index: 2;
  margin-left: -1px;                /* overlap the shared border */
}


#adv-collapse .pill-control .pill-left {
  background-color: transparent !important;
}

/* Inside the More filters drawer only */
#adv-collapse .pill-control {
  position: relative;
}

/* Pull the blue funnel button slightly over the white label edge */
#adv-collapse .pill-control .pill-right {
  margin-left: -4px;      /* try -3 / -4 / -5 until the white line vanishes */
  border-left: none;      /* avoid a double border line */
  position: relative;
  z-index: 2;             /* make sure it sits on top */
}

/* Label stays underneath */
#adv-collapse .pill-control .pill-left {
  position: relative;
  z-index: 1;
}
/* Mask anything under the funnel area */
#adv-collapse .pill-control {
  position: relative;
}

#adv-collapse .pill-control::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: 0;
  width: 32px;                 /* ≈ width of the funnel button – tweak if needed */
  background-color: var(--brand);  /* same blue as the button */
  border-radius: 0 var(--radius) var(--radius) 0;
  z-index: 1;                   /* above label, below the button */
}

/* keep real content above the mask */
#adv-collapse .pill-control .pill-left,
#adv-collapse .pill-control .pill-right {
  position: relative;
  z-index: 2;
}
/* 0) Kill the Bootstrap input-group background/border only inside More filters */
#adv-collapse .pill-control {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* 1) Remove the label's right border so it can't peek out under the blue button */
#adv-collapse .pill-control .pill-left {
  border-right: none !important;        /* override inline border */
}

/* 2) Make the blue funnel button overlap and mask the seam */
#adv-collapse .pill-control .pill-right {
  position: relative;
  margin-left: -1px;                    /* swallow any leftover 1px seam */
  z-index: 1;
}

/* 3) Belt‑and‑braces: draw a blue "patch" under the funnel that covers everything */
#adv-collapse .pill-control .pill-right::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;                           /* overlap the label a few px */
  right: 0;
  background-color: inherit;            /* same blue as the button */
  border-radius: inherit;               /* keep the rounded end */
  z-index: -1;                          /* behind the icon/text, in front of any white */
  pointer-events: none;
}
#adv-collapse .pill-control .pill-right::before {
  left: -6px; /* instead of -4px */
}
/* Drawer look */
.mf-drawer {
  background: rgba(16, 38, 79, 0.94);
  color: #f9fafb;
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px 0 0 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.mf-drawer .accordion-button {
  background: transparent;
  color: #f9fafb;
  box-shadow: none;
  padding: .55rem .9rem;
}
.mf-drawer .accordion-button:not(.collapsed) {
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
.mf-drawer .accordion-button::after {
  filter: invert(1) opacity(0.9);
}

/* Field card */
.mf-field {
  padding: .7rem .85rem .8rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(11,23,54,0.8);
}
.mf-field-label {
  font-weight: 600;
  font-size: .88rem;
  color: #e5e7eb;
}

/* Search row */
.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin: .4rem 0 .5rem;
}
.action-row .spacer { flex: 1 1 auto; }

.atc-search {
  height: 36px;
  padding-left: 0.75rem;
  background: rgba(3,17,47,0.96);
  color: #f9fafb;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: .9rem;
}
.atc-search::placeholder { color: #9ca3af; }

/* Select all / Clear chips */
.mf-chip-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.20);
  color: #f9fafb;
  font-size: 0.85rem;
  font-weight: 500;
  height: 36px;
  padding: 0.25rem 0.9rem;
  border-radius: 10px;
  white-space: nowrap;
}
.mf-chip-btn:hover {
  background: rgba(255,255,255,0.12);
}
.mf-chip-btn:active {
  background: rgba(255,255,255,0.18);
}

/* Scrollable list */
.atc-list {
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px;
  background: rgba(15,23,42,0.75);
}
/* Only affect the search inside the More filters drawer */
.mf-drawer .atc-search {
  padding-left: 0.9rem !important;
}
/* More filters – scroll area height */
.mf-drawer .atc-list {
  max-height: 260px;      /* ⬅️ was smaller before (e.g. 160–180px) */
  overflow-y: auto;
  padding: 0.35rem 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 30, 64, 0.85);
}
/* Make "Select all" and "Clear" square‑ish, like Search + Show all */
.mf-chip-btn {
  border-radius: 8px;          /* or 6px if you want sharper corners */
  padding: 0.25rem 0.9rem;
  height: 36px;                /* match your search input height */
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(49, 73, 122, 0.9);  /* or whatever you used before */
  box-shadow: none;
}
