/* =====================================================================
   Historical dimension filters – Offcanvas
   Match the Settings drawer look & feel
   Targets:
     atc / laegemiddel / subgroup / firma / varenummer / pakkeinformation
     / active_substance / styrke_format_1 / format
   ===================================================================== */

/* 1) SHELL – same navy glass as Settings drawer
   ------------------------------------------------------------------ */

#atc-offcanvas.offcanvas,
#active_substance-offcanvas.offcanvas,
#laegemiddel-offcanvas.offcanvas,
#subgroup-offcanvas.offcanvas,
#firma-offcanvas.offcanvas,
#varenummer-offcanvas.offcanvas,
#pakkeinformation-offcanvas.offcanvas,
#styrke_format_1-offcanvas.offcanvas,
#format-offcanvas.offcanvas {
  --bs-offcanvas-width: min(96vw, 520px);
  width: var(--bs-offcanvas-width) !important;

  background: rgba(16, 38, 79, 0.90) !important;
  -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) !important;
  box-shadow: var(--elev-3) !important;

  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

@media (max-width: 576px) {
  #atc-offcanvas.offcanvas,
  #active_substance-offcanvas.offcanvas,
  #laegemiddel-offcanvas.offcanvas,
  #subgroup-offcanvas.offcanvas,
  #firma-offcanvas.offcanvas,
  #varenummer-offcanvas.offcanvas,
  #pakkeinformation-offcanvas.offcanvas,
  #styrke_format_1-offcanvas.offcanvas,
  #format-offcanvas.offcanvas {
    border-radius: 0 !important;
  }
}

/* Header ------------------------------------------------------------ */

#atc-offcanvas .offcanvas-header,
#active_substance-offcanvas .offcanvas-header,
#laegemiddel-offcanvas .offcanvas-header,
#subgroup-offcanvas .offcanvas-header,
#firma-offcanvas .offcanvas-header,
#varenummer-offcanvas .offcanvas-header,
#pakkeinformation-offcanvas .offcanvas-header,
#styrke_format_1-offcanvas .offcanvas-header,
#format-offcanvas .offcanvas-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--divider-glass);
}

#atc-offcanvas .offcanvas-title,
#active_substance-offcanvas .offcanvas-title,
#laegemiddel-offcanvas .offcanvas-title,
#subgroup-offcanvas .offcanvas-title,
#firma-offcanvas .offcanvas-title,
#varenummer-offcanvas .offcanvas-title,
#pakkeinformation-offcanvas .offcanvas-title,
#styrke_format_1-offcanvas .offcanvas-title,
#format-offcanvas .offcanvas-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.15px;
}

#atc-offcanvas .btn-close,
#active_substance-offcanvas .btn-close,
#laegemiddel-offcanvas .btn-close,
#subgroup-offcanvas .btn-close,
#firma-offcanvas .btn-close,
#varenummer-offcanvas .btn-close,
#pakkeinformation-offcanvas .btn-close,
#styrke_format_1-offcanvas .btn-close,
#format-offcanvas .btn-close {
  filter: invert(1) opacity(0.75);
}
#atc-offcanvas .btn-close:hover,
#active_substance-offcanvas .btn-close:hover,
#laegemiddel-offcanvas .btn-close:hover,
#subgroup-offcanvas .btn-close:hover,
#firma-offcanvas .btn-close:hover,
#varenummer-offcanvas .btn-close:hover,
#pakkeinformation-offcanvas .btn-close:hover,
#styrke_format_1-offcanvas .btn-close:hover,
#format-offcanvas .btn-close:hover {
  opacity: 1;
}

/* Body layout ------------------------------------------------------- */

#atc-offcanvas .offcanvas-body,
#active_substance-offcanvas .offcanvas-body,
#laegemiddel-offcanvas .offcanvas-body,
#subgroup-offcanvas .offcanvas-body,
#firma-offcanvas .offcanvas-body,
#varenummer-offcanvas .offcanvas-body,
#pakkeinformation-offcanvas .offcanvas-body,
#styrke_format_1-offcanvas .offcanvas-body,
#format-offcanvas .offcanvas-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden !important;   /* only list scrolls */
}

/* =====================================================================
   2) TOP CONTROLS – Search + Select all + Clear (aligned row)
   ===================================================================== */

/* Glass panel holding search + buttons */
#atc-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#active_substance-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#laegemiddel-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#subgroup-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#firma-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#varenummer-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#pakkeinformation-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#styrke_format_1-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0,
#format-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 {
  background: var(--surface-glass-weak) !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 0.9rem;

  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; /* wrap buttons under search on very narrow screens */
}

/* Kill default .mb-3 margin so it doesn't nudge things vertically */
#atc-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#active_substance-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#laegemiddel-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#subgroup-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#firma-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#varenummer-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#pakkeinformation-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#styrke_format_1-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3,
#format-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3 {
  margin: 0 !important;
}

/* Search wrapper – flexes to fill */
#atc-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#active_substance-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#laegemiddel-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#subgroup-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#firma-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#varenummer-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#pakkeinformation-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#styrke_format_1-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child,
#format-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child {
  flex: 1 1 0;
  min-width: 0;
}

/* Cancel Bootstrap's width:100% on the input-group so it can share the row */
#atc-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#active_substance-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#laegemiddel-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#subgroup-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#firma-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#varenummer-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#pakkeinformation-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#styrke_format_1-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3,
#format-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 .input-group.mb-3 {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  margin-bottom: 0 !important;
}

/* Buttons container – sits to the right of search */
#atc-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#active_substance-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#laegemiddel-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#subgroup-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#firma-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#varenummer-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#pakkeinformation-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#styrke_format_1-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child),
#format-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Search input (same height as buttons) */
#atc-offcanvas input[id$="-search-input"],
#active_substance-offcanvas input[id$="-search-input"],
#laegemiddel-offcanvas input[id$="-search-input"],
#subgroup-offcanvas input[id$="-search-input"],
#firma-offcanvas input[id$="-search-input"],
#varenummer-offcanvas input[id$="-search-input"],
#pakkeinformation-offcanvas input[id$="-search-input"],
#styrke_format_1-offcanvas input[id$="-search-input"],
#format-offcanvas input[id$="-search-input"] {
  height: 40px;
  padding: 0 0.9rem !important;
  border-radius: 10px !important;
  font-size: 0.9rem;

  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong) !important;
  width: 100% !important;
}

#atc-offcanvas input[id$="-search-input"]::placeholder,
#active_substance-offcanvas input[id$="-search-input"]::placeholder,
#laegemiddel-offcanvas input[id$="-search-input"]::placeholder,
#subgroup-offcanvas input[id$="-search-input"]::placeholder,
#firma-offcanvas input[id$="-search-input"]::placeholder,
#varenummer-offcanvas input[id$="-search-input"]::placeholder,
#pakkeinformation-offcanvas input[id$="-search-input"]::placeholder,
#styrke_format_1-offcanvas input[id$="-search-input"]::placeholder,
#format-offcanvas input[id$="-search-input"]::placeholder {
  color: var(--text-muted);
}

/* --- Select All + Clear filters: fully normalized ghost buttons ------ */

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-select-all"],
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-clear-all"] {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 40px !important;
  padding: 0 0.9rem !important;
  margin: 0 !important;

  border-radius: 10px !important;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1 !important;

  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong) !important;

  white-space: nowrap;
  min-width: max-content;
  box-shadow: none !important;
}

/* Hover + focus, same as ghost buttons in settings.css */
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-select-all"]:hover,
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-clear-all"]:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-select-all"]:focus-visible,
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-clear-all"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =====================================================================
   3) LIST AREA – square checkboxes + subtle list panel
   ===================================================================== */

#atc-offcanvas #atc-options-container,
#active_substance-offcanvas #active_substance-options-container,
#laegemiddel-offcanvas #laegemiddel-options-container,
#subgroup-offcanvas #subgroup-options-container,
#firma-offcanvas #firma-options-container,
#varenummer-offcanvas #varenummer-options-container,
#pakkeinformation-offcanvas #pakkeinformation-options-container,
#styrke_format_1-offcanvas #styrke_format_1-options-container,
#format-offcanvas #format-options-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto !important;

  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Row spacing & labels */
#atc-offcanvas .form-check,
#active_substance-offcanvas .form-check,
#laegemiddel-offcanvas .form-check,
#subgroup-offcanvas .form-check,
#firma-offcanvas .form-check,
#varenummer-offcanvas .form-check,
#pakkeinformation-offcanvas .form-check,
#styrke_format_1-offcanvas .form-check,
#format-offcanvas .form-check {
  margin-bottom: 0.35rem;
}

#atc-offcanvas .form-check-label,
#active_substance-offcanvas .form-check-label,
#laegemiddel-offcanvas .form-check-label,
#subgroup-offcanvas .form-check-label,
#firma-offcanvas .form-check-label,
#varenummer-offcanvas .form-check-label,
#pakkeinformation-offcanvas .form-check-label,
#styrke_format_1-offcanvas .form-check-label,
#format-offcanvas .form-check-label {
  color: var(--text-strong);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Square-ish checkbox bullets */
#atc-offcanvas .form-check-input,
#active_substance-offcanvas .form-check-input,
#laegemiddel-offcanvas .form-check-input,
#subgroup-offcanvas .form-check-input,
#firma-offcanvas .form-check-input,
#varenummer-offcanvas .form-check-input,
#pakkeinformation-offcanvas .form-check-input,
#styrke_format_1-offcanvas .form-check-input,
#format-offcanvas .form-check-input {
  width: 16px;
  height: 16px;
  border-radius: 4px !important;
  margin-top: 0.25rem;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  box-shadow: none;
}

#atc-offcanvas .form-check-input:checked,
#active_substance-offcanvas .form-check-input:checked,
#laegemiddel-offcanvas .form-check-input:checked,
#subgroup-offcanvas .form-check-input:checked,
#firma-offcanvas .form-check-input:checked,
#varenummer-offcanvas .form-check-input:checked,
#pakkeinformation-offcanvas .form-check-input:checked,
#styrke_format_1-offcanvas .form-check-input:checked,
#format-offcanvas .form-check-input:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

#atc-offcanvas .form-check-input:focus,
#active_substance-offcanvas .form-check-input:focus,
#laegemiddel-offcanvas .form-check-input:focus,
#subgroup-offcanvas .form-check-input:focus,
#firma-offcanvas .form-check-input:focus,
#varenummer-offcanvas .form-check-input:focus,
#pakkeinformation-offcanvas .form-check-input:focus,
#styrke_format_1-offcanvas .form-check-input:focus,
#format-offcanvas .form-check-input:focus {
  box-shadow: var(--focus-ring);
}

/* "Show all" button at bottom of list */
#atc-offcanvas button[id$="-load-more"],
#active_substance-offcanvas button[id$="-load-more"],
#laegemiddel-offcanvas button[id$="-load-more"],
#subgroup-offcanvas button[id$="-load-more"],
#firma-offcanvas button[id$="-load-more"],
#varenummer-offcanvas button[id$="-load-more"],
#pakkeinformation-offcanvas button[id$="-load-more"],
#styrke_format_1-offcanvas button[id$="-load-more"],
#format-offcanvas button[id$="-load-more"] {
  margin-top: 0.5rem;
  height: 32px;
  border-radius: 8px !important;
}

/* =====================================================================
   4) APPLY BUTTON – footer CTA (like “Save changes”
   ===================================================================== */

#atc-offcanvas .offcanvas-body > .p-3:last-child,
#active_substance-offcanvas .offcanvas-body > .p-3:last-child,
#laegemiddel-offcanvas .offcanvas-body > .p-3:last-child,
#subgroup-offcanvas .offcanvas-body > .p-3:last-child,
#firma-offcanvas .offcanvas-body > .p-3:last-child,
#varenummer-offcanvas .offcanvas-body > .p-3:last-child,
#pakkeinformation-offcanvas .offcanvas-body > .p-3:last-child,
#styrke_format_1-offcanvas .offcanvas-body > .p-3:last-child,
#format-offcanvas .offcanvas-body > .p-3:last-child {
  padding: 0.75rem 0;
  border-top: 1px solid var(--divider-glass);
}

/* Full‑width Apply CTA */
#atc-offcanvas button[id$="-apply"],
#active_substance-offcanvas button[id$="-apply"],
#laegemiddel-offcanvas button[id$="-apply"],
#subgroup-offcanvas button[id$="-apply"],
#firma-offcanvas button[id$="-apply"],
#varenummer-offcanvas button[id$="-apply"],
#pakkeinformation-offcanvas button[id$="-apply"],
#styrke_format_1-offcanvas button[id$="-apply"],
#format-offcanvas button[id$="-apply"] {
  width: 100% !important;
  height: 40px;
  border-radius: 10px !important;
  font-size: 0.95rem;
  font-weight: 600;

  background-color: var(--brand-accent) !important;
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* "Show all" button at bottom of list */
#atc-offcanvas button[id$="-load-more"],
#active_substance-offcanvas button[id$="-load-more"],
#laegemiddel-offcanvas button[id$="-load-more"],
#subgroup-offcanvas button[id$="-load-more"],
#firma-offcanvas button[id$="-load-more"],
#varenummer-offcanvas button[id$="-load-more"],
#pakkeinformation-offcanvas button[id$="-load-more"],
#styrke_format_1-offcanvas button[id$="-load-more"],
#format-offcanvas button[id$="-load-more"] {
  display: block;
  width: 100% !important;          /* span the list width */
  margin-top: 0.75rem;
  height: 32px;
  border-radius: 10px !important;

  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;

  background-color: rgba(6, 22, 55, 0.8);      /* dark glassy chip */
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  box-shadow: none;
}

/* Hover + focus to match the rest of the drawer CTAs */
#atc-offcanvas button[id$="-load-more"]:hover,
#active_substance-offcanvas button[id$="-load-more"]:hover,
#laegemiddel-offcanvas button[id$="-load-more"]:hover,
#subgroup-offcanvas button[id$="-load-more"]:hover,
#firma-offcanvas button[id$="-load-more"]:hover,
#varenummer-offcanvas button[id$="-load-more"]:hover,
#pakkeinformation-offcanvas button[id$="-load-more"]:hover,
#styrke_format_1-offcanvas button[id$="-load-more"]:hover,
#format-offcanvas button[id$="-load-more"]:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
}

#atc-offcanvas button[id$="-load-more"]:focus-visible,
#active_substance-offcanvas button[id$="-load-more"]:focus-visible,
#laegemiddel-offcanvas button[id$="-load-more"]:focus-visible,
#subgroup-offcanvas button[id$="-load-more"]:focus-visible,
#firma-offcanvas button[id$="-load-more"]:focus-visible,
#varenummer-offcanvas button[id$="-load-more"]:focus-visible,
#pakkeinformation-offcanvas button[id$="-load-more"]:focus-visible,
#styrke_format_1-offcanvas button[id$="-load-more"]:focus-visible,
#format-offcanvas button[id$="-load-more"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
/* "Show All" — match ghost buttons (Select / Clear) */
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-load-more"] {

  display: block;
  width: 100% !important;
  margin: 0.75rem 0 0;

  height: 40px;
  border-radius: 10px !important;

  padding: 0 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;

  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong);
  box-shadow: none;
}

/* Hover + focus (same as ghost buttons) */
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-load-more"]:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  button[id$="-load-more"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
/* Unified glass scrollbars for all filter lists */
:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  [id$="-options-container"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  [id$="-options-container"]::-webkit-scrollbar {
  width: 10px;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  [id$="-options-container"]::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  [id$="-options-container"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

:is(#atc-offcanvas,
    #active_substance-offcanvas,
    #laegemiddel-offcanvas,
    #subgroup-offcanvas,
    #firma-offcanvas,
    #varenummer-offcanvas,
    #pakkeinformation-offcanvas,
    #styrke_format_1-offcanvas,
    #format-offcanvas)
  [id$="-options-container"]::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}
/* ==========================================================
   More filters drawer: opt out of Settings' flex layout
   ========================================================== */

/* Offcanvas body: simple scrolling column, not full-height flex */
.mf-drawer .offcanvas-body {
  display: block !important;
  padding: 16px;
  overflow-y: auto !important;
  overflow-x: visible !important;
  gap: 0 !important;
}

/* Accordion + items: just normal stacked blocks */
.mf-drawer .accordion,
.mf-drawer .accordion-item {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
}

/* Open panel should also be block, not flex */
.mf-drawer .accordion-collapse.collapse.show {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* While opening / closing (the .collapsing state) */
.mf-drawer .accordion .collapsing {
  display: block !important;
  height: auto !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* Inner accordion body: stack its children */
.mf-drawer .accordion-body {
  display: block !important;
  flex: 0 0 auto !important;
  min-height: auto !important;
}

/* Each field box keeps natural height; only the list scrolls */
.mf-drawer .mf-field {
  margin-bottom: 0.75rem;
}

.mf-drawer .atc-list {
  max-height: 160px;
  overflow-y: auto !important;
  flex: 0 0 auto !important;
}
/* Root accordion: reserve space so content can't scroll behind the chin */
.mf-drawer .mf-root-accordion {
  display: block;
  flex: 0 0 auto;
  min-height: auto;

  /* 👇 Space for the sticky footer (chin) */
  padding-bottom: calc(var(--settings-footer-h, 76px) + 12px);
}
/* Price source offcanvas – make radios look like square checkboxes */
[id$="-source-offcanvas"] .form-check-input {
  border-radius: 6px;                /* ← square corners instead of round */
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  box-shadow: none;
  background-image: none;            /* remove default radio dot */
}

[id$="-source-offcanvas"] .form-check-input:focus {
  box-shadow: var(--focus-ring);
  border-color: rgba(72, 168, 255, 0.75);
}

[id$="-source-offcanvas"] .form-check-input:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}
/* Remove any 'chin' styling if it's still around */
.mf-drawer .offcanvas-footer {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Inline footer container – no extra bar */
.mf-drawer .mf-footer-inline {
  border-top: none;
  margin-top: 1rem;
  padding-top: 0;
}

/* 🔲 Make the Cancel / Apply buttons square‑ish */
.mf-drawer .mf-footer-inline .btn {
  border-radius: 6px !important;   /* <- kills the big pill radius */
  padding: 0.4rem 1.1rem;
}

/* Cancel style in dark drawer */
.mf-drawer .btn-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #f9fafb;
}
/* ────────────────────────────────────────────── */
/* More‑filters footer: remove chin + square btns */
/* ────────────────────────────────────────────── */

/* Kill the dark "chin" bar */
.mf-drawer .offcanvas-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.16);
  background: transparent !important;   /* ← no dark strip */
  box-shadow: none !important;
}

/* Make the bottom Cancel / Apply buttons square‑ish */
.mf-drawer #more-filters-cancel,
.mf-drawer #more-filters-apply {
  border-radius: 6px !important;        /* ← key bit: not round */
  padding: 0.35rem 1.1rem;
  font-size: 0.9rem;
}

/* Ghost Cancel button */
.mf-drawer #more-filters-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.26);
  color: #f9fafb;
}

.mf-drawer #more-filters-cancel:hover {
  background: rgba(255,255,255,0.08);
}

/* Primary Apply button */
.mf-drawer #more-filters-apply {
  background: #0a58ca;          /* or your brand color */
  border-color: #0a58ca;
  color: #fff;
}

.mf-drawer #more-filters-apply:hover {
  background: #1b7bff;
}
/* Make all “Show all” buttons square‑ish instead of pills */
.show-all-button {
  border-radius: 6px !important;   /* or 8px if you want slightly rounder */
}
/* ===========================
   More filters footer (final)
   =========================== */

/* No dark chin bar */
.mf-drawer .offcanvas-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.16);
  background: transparent !important;
  box-shadow: none !important;
}

/* Shared footer button shape */
.mf-drawer .offcanvas-footer .mf-footer-btn {
  border-radius: 6px;
  padding-inline: 1.2rem;
  padding-block: 0.45rem;
  font-weight: 600;
}

/* Cancel = ghost */
.mf-drawer .offcanvas-footer .mf-cancel-btn {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.26) !important;
  color: #f9fafb !important;
}

/* Apply filters = same blue as “Save view” */
.mf-drawer .offcanvas-footer .mf-apply-btn {
  background-color: var(--brand) !important;   /* same brand blue */
  border-color: var(--brand) !important;
  color: #fff !important;
}
/* ────────────────────────────────────────────── */
/* More‑filters footer: align Cancel + Apply     */
/* ────────────────────────────────────────────── */

/* Footer row: flex, vertically centered */
.mf-drawer .offcanvas-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;           /* ⬅ vertical alignment */
  gap: 0.5rem;

  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.16);
  background: transparent !important;
  box-shadow: none !important;
}

/* Base style for both footer buttons */
.mf-drawer #more-filters-cancel,
.mf-drawer #more-filters-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;                     /* ⬅ kill any stray margins */
  border-radius: 6px !important;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;             /* same for both */
}

/* Cancel = ghost */
.mf-drawer #more-filters-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.26);
  color: #f9fafb;
}

/* Apply filters = same blue as “Save view” */
.mf-drawer #more-filters-apply {
  background-color: #0a58ca;     /* or var(--brand) if you prefer */
  border-color: #0a58ca;
  color: #fff;
}
/* Apply filters – exactly same blue as other primary buttons */
.mf-drawer .offcanvas-footer #more-filters-apply {
  background-color: var(--brand) !important;   /* same as “Save changes / Save view” */
  border-color: var(--brand) !important;
  color: #fff;
}

/* Force More‑filters “Apply filters” to #0a58ca */
.mf-drawer #more-filters-apply {
  background-color: #0a58ca !important;
  border-color: #0a58ca !important;
  color: #fff !important;
}

/* Keep the same colour on hover / focus so it matches the other CTA */
.mf-drawer #more-filters-apply:hover,
.mf-drawer #more-filters-apply:focus {
  background-color: #0a58ca !important;
  border-color: #0a58ca !important;
  color: #fff !important;
}
/* =====================================================================
   Extend historical dimension offcanvas styling to Pharmacy pill
   ===================================================================== */

/* Shell -------------------------------------------------------------- */

#pharmacy-offcanvas.offcanvas {
  --bs-offcanvas-width: min(96vw, 520px);
  width: var(--bs-offcanvas-width) !important;

  background: rgba(16, 38, 79, 0.90) !important;
  -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) !important;
  box-shadow: var(--elev-3) !important;

  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

@media (max-width: 576px) {
  #pharmacy-offcanvas.offcanvas {
    border-radius: 0 !important;
  }
}

/* Header ------------------------------------------------------------- */

#pharmacy-offcanvas .offcanvas-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--divider-glass);
}

#pharmacy-offcanvas .offcanvas-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.15px;
}

#pharmacy-offcanvas .btn-close {
  filter: invert(1) opacity(0.75);
}

#pharmacy-offcanvas .btn-close:hover {
  opacity: 1;
}

/* Body layout -------------------------------------------------------- */

#pharmacy-offcanvas .offcanvas-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden !important;   /* only list scrolls */
}

/* =====================================================================
   Top controls – search + Select all + Clear
   ===================================================================== */

#pharmacy-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 {
  background: var(--surface-glass-weak) !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 0.9rem;

  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; /* wrap buttons under search on very narrow screens */
}

/* kill default .mb-3 vertical spacing */
#pharmacy-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3 {
  margin: 0 !important;
}

/* search wrapper flexes */
#pharmacy-offcanvas .offcanvas-body > .p-3.border-bottom.flex-shrink-0 > .mb-3:first-child {
  flex: 1 1 0;
  min-width: 0;
}

/* input-group inside search */
#pharmacy-offcanvas
  .offcanvas-body > .p-3.border-bottom.flex-shrink-0
  .input-group.mb-3 {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  margin-bottom: 0 !important;
}

/* buttons container (Select / Clear) */
#pharmacy-offcanvas
  .offcanvas-body > .p-3.border-bottom.flex-shrink-0
  > .mb-3:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Search input ------------------------------------------------------- */

#pharmacy-offcanvas input[id$="-search-input"] {
  height: 40px;
  padding: 0 0.9rem !important;
  border-radius: 10px !important;
  font-size: 0.9rem;

  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong) !important;
  width: 100% !important;
}

#pharmacy-offcanvas input[id$="-search-input"]::placeholder {
  color: var(--text-muted);
}

/* Ghost buttons: Select all / Clear --------------------------------- */

#pharmacy-offcanvas button[id$="-select-all"],
#pharmacy-offcanvas button[id$="-clear-all"] {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 40px !important;
  padding: 0 0.9rem !important;
  margin: 0 !important;

  border-radius: 10px !important;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1 !important;

  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong) !important;

  white-space: nowrap;
  min-width: max-content;
  box-shadow: none !important;
}

#pharmacy-offcanvas button[id$="-select-all"]:hover,
#pharmacy-offcanvas button[id$="-clear-all"]:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

#pharmacy-offcanvas button[id$="-select-all"]:focus-visible,
#pharmacy-offcanvas button[id$="-clear-all"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =====================================================================
   List area – checklist box + Show all
   ===================================================================== */

#pharmacy-offcanvas #pharmacy-options-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto !important;

  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

/* row spacing & labels */
#pharmacy-offcanvas .form-check {
  margin-bottom: 0.35rem;
}

#pharmacy-offcanvas .form-check-label {
  color: var(--text-strong);
  font-weight: 500;
  font-size: 0.95rem;
}

/* square-ish checkboxes */
#pharmacy-offcanvas .form-check-input {
  width: 16px;
  height: 16px;
  border-radius: 4px !important;
  margin-top: 0.25rem;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  box-shadow: none;
}

#pharmacy-offcanvas .form-check-input:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

#pharmacy-offcanvas .form-check-input:focus {
  box-shadow: var(--focus-ring);
}

/* "Show all" – match ghost buttons ---------------------------------- */

#pharmacy-offcanvas button[id$="-load-more"] {
  display: block;
  width: 100% !important;
  margin: 0.75rem 0 0;

  height: 40px;
  border-radius: 10px !important;

  padding: 0 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;

  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-strong);
  box-shadow: none;
}

#pharmacy-offcanvas button[id$="-load-more"]:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

#pharmacy-offcanvas button[id$="-load-more"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =====================================================================
   Apply button – footer CTA
   ===================================================================== */

#pharmacy-offcanvas .offcanvas-body > .p-3:last-child {
  padding: 0.75rem 0;
  border-top: 1px solid var(--divider-glass);
}

/* full-width Apply */
#pharmacy-offcanvas button[id$="-apply"] {
  width: 100% !important;
  height: 40px;
  border-radius: 10px !important;
  font-size: 0.95rem;
  font-weight: 600;

  background-color: var(--brand-accent) !important;
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* =====================================================================
   Scrollbars in pharmacy list
   ===================================================================== */

#pharmacy-offcanvas [id$="-options-container"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

#pharmacy-offcanvas [id$="-options-container"]::-webkit-scrollbar {
  width: 10px;
}

#pharmacy-offcanvas [id$="-options-container"]::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

#pharmacy-offcanvas [id$="-options-container"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pharmacy-offcanvas [id$="-options-container"]::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}
