/* ============================================================ 
   FILTER MODEL: PREMIUM DESIGN & ANIMATION SYSTEM
   Standard classes with 'filter-model-' prefix. 
   No Bootstrap dependencies.
   ============================================================ */
   
   
/* ============================================================ 
   BOOTSTRAP MODAL ADAPTATION FOR DESKTOP FILTER MODAL
   Ensures exact same size (540px), rounded corners (24px),
   and premium styling while opening as a standard Bootstrap Modal.
   ============================================================ */
#globalFilterModal.modal {
    z-index: 1055;
    padding-right: 0 !important;
}

#globalFilterModal .modal-dialog {
    max-width: 540px;
    width: 100%;
    margin: 1.75rem auto;
}

/* Radio & Checkbox keyboard tab focus highlighting */
label.radio:focus-visible,
label.radio.keyboard-focused,
label.checkbox:not(
  .dropdown-container label,
  .dropdown-list label,
  .multiSelect label,
  .dropdown-menu label
):focus-visible {
  outline: 2px solid var(--color-surfie, #005050) !important;
  outline-offset: 3px !important;
  border-radius: 4px !important;
  background-color: rgba(0, 80, 80, 0.06) !important;
}

label.radio[tabindex="0"]:focus .label-text:before,
label.radio:focus .label-text:before,
label.radio:focus-visible .label-text:before,
label.radio.keyboard-focused .label-text:before,
label.radio:focus-within .label-text:before,
.radio input[type="radio"]:focus ~ .label-text:before,
.radio input[type="radio"]:focus-visible ~ .label-text:before {
  box-shadow: 0 0 0 3px rgba(0, 80, 80, 0.3) !important;
  border-color: var(--color-surfie, #005050) !important;
}


#globalFilterModal .modal-content {
    background-color: var(--color-white, #ffffff);
    border-radius: 24px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: visible;
    position: relative;
}

#globalFilterModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    border-bottom: 2px solid var(--color-selago, #F2F1F2);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

#globalFilterModal .modal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-tmf-gray, #262828);
    margin: 0;
    letter-spacing: -0.01em;
}

#globalFilterModal .modal-header .close,
#globalFilterModal .modal-header .filter-model-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-tmf-gray, #262828);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    margin: 0;
    opacity: 1;
    text-shadow: none;
    outline: none;
    float: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

#globalFilterModal .modal-header .close:hover,
#globalFilterModal .modal-header .filter-model-close:hover {
    color: var(--color-tmf-gray, #262828);
    opacity: 0.75;
}

#globalFilterModal .modal-body {
    padding: 16px 27px;
    overflow: visible;
    position: relative;
    padding-top: 1px;
}

#globalFilterModal .modal-footer {
    padding: 1px 17px 16px 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-top: none;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* Modal Overlay styling with hidden scrollbar */
.filter-model-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.filter-model-overlay::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.filter-model-overlay.show {
    display: flex;
    background-color: rgb(0 0 0 / 50%);
    backdrop-filter: blur(0px);
}

/* 2. CONTAINER (Dialog) */
.filter-model-container {
    background-color: var(--color-white);
    width: 100%;
    max-width: 540px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;

    /* Soft Transition: Fade + Subtle Scale + Slide */
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.filter-model-overlay.show .filter-model-container {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 3. CLOSING STATE */
.filter-model-overlay.closing {
    background-color: rgba(0, 0, 0, 0) !important;
    backdrop-filter: blur(0px) !important;
    pointer-events: none;
}

.filter-model-overlay.closing .filter-model-container {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 4. CONTENT STRUCTURE */
.filter-model-content {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.filter-model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px 14px 26px;
    border-bottom: 2px solid var(--color-selago);
}

.filter-model-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-tmf-gray);
    margin: 0;
    letter-spacing: -0.01em;
}


.filter-model-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-tmf-gray);
    /* Darker, cleaner */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.filter-model-close:hover {
    color: var(--color-tmf-gray);
    /* No change on hover */
}

.filter-model-body {
    padding: 16px 27px;
    overflow: visible;
    position: relative;
    padding-top: 1px;
}

@media screen and (max-width: 768px) {
    .filter-model-footer {
        padding: 11px 15px 1px 18px !important;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 16px;
    }
}

.filter-model-footer {
    padding: 1px 17px 16px 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

/* 5. BUTTONS */
.filter-model-btn {
    padding: 10px 24px;
    border-radius: 30px;
    /* Pill shaped as in reference */
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
}

.filter-model-footer>.filter-action-container>button {
    background-color: var(--color-surfie);
    padding: 16px 34px;
    color: var(--color-white);
    min-width: 100px;
    border-radius: 30px;
    min-width: 49px;
    border-radius: 30px;
    border: 1.5px solid var(--color-surfie);
}

.filter-model-btn-primary {
    background-color: var(--color-surfie);
    /* Slightly deeper teal */
    color: var(--color-white);
}

.filter-model-btn-primary:hover {
    background-color: var(--color-surfie);
    /* transform: translateY(-1px); */
}

.filter-model-btn-secondary {
    background-color: transparent;
    padding: 8px 12px;
    color: var(--color-surfie);
    border: 1.5px solid var(--color-surfie);
}

.filter-model-btn-secondary:hover {
    background-color: var(--color-turq-lite-2);
}

/* Checkmark Icon in Save button */
.filter-model-btn-primary svg {
    width: 18px;
    height: 18px;
}

/* 6. INTERNAL FORM ELEMENTS (Adapted from working filter styles) */
.filter-model-body .filter-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    /* Reduced gap */
}

.filter-model-body .filter,
.filter-model-body .grouping,
.filter-model-body .search {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.filter-model-body label {

    font-size: 15px;
    font-weight: 400;
    color: var(--color-tmf-gray);
    margin-top: 12px;
    display: block;
    letter-spacing: 0.01em;
}

.filter-model-body label[data-content-key] {
    display: inline-flex;
    align-items: center;
}

.filter-model-body label[data-content-key] .content-key-copy {
    margin-right: 6px;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

.filter-model-body .dropdown-list>span.value,
.filter-model-body .text-field input {
    height: 52px;
    background-color: var(--color-white);
    border: 2px solid var(--color-link-water);
    border-radius: 14px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--color-tmf-gray);

    /*   width: 100%;   */


    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-model-body .dropdown-list:hover>span.value,
.filter-model-body .text-field input:hover {
    border-color: var(--color-selago);
    background-color: var(--color-white);
}

.filter-model-body .dropdown-list.open>span.value,
.filter-model-body .text-field input:focus {
    border-color: var(--color-surfie);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.08);
    outline: none;
}

/* ── Dropdown overlay fix inside the filter modal ──────────────────
   The .dropdown-container is position:absolute. By default it is
   clipped by any ancestor with overflow:auto/hidden.
   We give it a very high z-index so it floats above the modal
   footer, and ensure the modal container creates the stacking
   context (position:relative is already set on .filter-model-container).
   ----------------------------------------------------------------- */
.filter-model-body .dropdown-container,
.filter-model-body .dropdown-list.open .dropdown-container {
    position: absolute !important;
    z-index: 99999 !important;
    /* above modal z-index (10000) */
    top: 100% !important;
    /* drop directly below the trigger */
    left: 0 !important;
    width: 100% !important;
    background: var(--color-white) !important;
    border: 1.5px solid var(--color-selago) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    margin-top: 4px !important;
}


/* Hide clutter */
.filter-model-body .help,
.filter-model-body .advanced-filter-submit {
    display: none !important;
}

/* SCROLL LOCK */
body.filter-model-open {
    overflow: hidden !important;
    padding-right: 0px;
    /* Prevent jump if possible */
}

/* SCROLLBAR */
.filter-model-body::-webkit-scrollbar {
    width: 6px;
}

.filter-model-body::-webkit-scrollbar-track {
    background: transparent;
}

.filter-model-body::-webkit-scrollbar-thumb {
    background: var(--color-selago);
    border-radius: 10px;
}

.filter-model-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-selago);
}

.modalFilterBody .dropdown-list>span.value.placeholder,
.modalFilterBody .text-field input::placeholder,
#filterModal .dropdown-list>span.value.placeholder,
#filterModal .text-field input::placeholder {
    color: var(--color-white);
    font-weight: 500;
}

.hasDatepicker {
    color: var(--color-white);
    /* font-weight: 500; */
}

/* ============================================================ */
/* MOBILE POPOVER CORE STYLES (no Bootstrap dependency) */
/* ============================================================ */
.mobile-button-popover {
    position: absolute;
    min-width: 280px;
    max-width: 90vw;
    width: auto;
    background: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    z-index: 1055;
    padding: 14px;
    display: block;
    color: #313131;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    animation: mobilePopoverFadeIn 0.2s ease-out;
}

.mobile-button-popover::before,
.mobile-button-popover::after {
    content: none !important;
    display: none !important;
}

.mobile-button-popover .d-flex {
    position: relative;
    align-items: center;
    justify-content: space-between;
}

.mobile-button-popover h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-tmf-gray);
    margin: 0;
}

.mobile-popover-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1065;
    flex-shrink: 0;
    position: relative;
}

.mobile-popover-close:hover {
    background-color: #F0F0F0;
    transform: scale(1.05);
}

.mobile-popover-close:active {
    background-color: #E8E8E8;
    transform: scale(0.98);
}

.mobile-popover-close:focus {
    outline: 2px solid var(--color-surfie);
    outline-offset: 2px;
}

.mobile-popover-close i {
    font-size: 16px;
    color: #666666;
    pointer-events: none;
    display: block;
}

.mobile-popover-content {
    margin-top: 12px;
    max-height: 75vh;
    display: flex;
    gap: 0px;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--color-tmf-slate);
    font-size: 14px;
    line-height: 1.5;
}

.mobile-popover-content .filter-body {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

.section-controls button[name].popover-active,
.title-wrapper .selected-plan-section.popover-active,
#planSelector.popover-active {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-color: #009999;
}

/* ============================================================ */
/* MOBILE FILTER BOTTOM SHEET (mfs- prefix)                     */
/* ============================================================ */

/* Scrim / backdrop */
.mfs-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mfs-scrim.mfs-open {
    opacity: 1;
    pointer-events: auto;
}

/* Sheet wrapper – slides up from bottom: ~half screen */
.mfs-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10101;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    min-height: 50vh;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    will-change: transform;
    overflow: hidden;
}

.mfs-sheet.mfs-open {
    transform: translateY(0);
}

.mfs-sheet.mfs-closing {
    transform: translateY(100%);
}

/* When the real filter-body is mounted inside the sheet body */
#mfsBody .filter-body {
    display: block !important;
    width: 100%;
    padding: 4px 0 8px;
}

#mfsBody .filter-body .row {
    margin: 0;
}

#mfsBody .filter-body .row>[class*="col-"] {
    padding: 6px 20px;
}

/* Ensure dropdowns open downward inside the sheet */
#mfsBody .dropdown-container {
    z-index: 10200;
}

/* Go buttons that live inside filter-body but were moved to the footer
   action container — no hidden rule here; the .mfs-body-go-btn clone
   in #mfsBody is intentionally visible. */

/* Inline datepicker row – opens below the tapped filter row */
.mfs-dp-inline-row {
    padding: 10px 20px 14px;
    border-bottom: 1px solid #F2F1F2;
    background: #FAFAFA;
    animation: mfsDpRowIn 0.18s ease;
}

@keyframes mfsDpRowIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mfs-dp-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.mfs-dp-text-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 38px 0 16px;
    border: 1.5px solid #D7D8D9;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #262828;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
}

.mfs-dp-text-input:focus {
    border-color: #007878;
    box-shadow: 0 0 0 4px rgba(0, 120, 120, 0.10);
}

.mfs-dp-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 14px;
    color: #B2B3B5;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    z-index: 5;
}

.mfs-dp-clear-btn:hover {
    background: #F2F1F2;
    color: #485662;
}

/* Go button rendered inside Sheet 1 body (clone with .mfs-body-go-btn) */
.mfs-body-go-btn {
    display: block !important;
    width: calc(100% - 40px);
    margin: 12px 20px;
    background: #007878;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: background 0.2s;
}

.mfs-body-go-btn:hover {
    background: #005050;
}


/* Background Scroll Lock when Filter Sheet or Modal is open */
html.mfs-active,
body.mfs-active,
html.filter-model-open,
body.filter-model-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* Drag handle pill */
.mfs-drag-handle {
    width: 44px;
    height: 5px;
    background: #C8CBD0;
    border-radius: 3px;
    margin: 10px auto 4px;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mfs-drag-handle:active {
    cursor: grabbing;
    background: #A0A5B0;
}

/*  Header  */
.mfs-header,
.mfs-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 12px;
    flex-shrink: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mfs-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mfs-title {
    font-size: 20px;
    font-weight: 700;
    color: #262828;
    margin: 0;
    font-family: inherit;
}

.mfs-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #007878;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 9px;
    min-width: 26px;
    line-height: 1.4;
    letter-spacing: 0;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mfs-badge-count.mfs-badge-visible {
    opacity: 1;
    transform: scale(1);
}

.mfs-clear-btn {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: #007878;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    transition: opacity 0.2s;
}

.mfs-clear-btn:hover {
    opacity: 0.7;
}

.mfs-close-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #485662;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
}

.mfs-close-btn:hover {
    background: #F2F1F2;
}

/* Divider */
.mfs-divider {
    height: 1px;
    background: #F2F1F2;
    flex-shrink: 0;
    margin: 0 16px;
}

/*  Body / Scrollable list  */
.mfs-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 4px 0;
}

.mfs-body::-webkit-scrollbar {
    width: 0;
}

/* Filter category row */
.mfs-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #F2F1F2;
    gap: 12px;
}

.mfs-filter-row:last-child {
    border-bottom: none;
}

.mfs-filter-row:active {
    background: #F2F1F2;
}

.mfs-filter-row-left {
    flex: 1;
    min-width: 0;
}

.mfs-filter-row-label {
    font-size: 15px;
    font-weight: 600;
    color: #262828;
    font-family: inherit;
    display: block;
    margin-bottom: 2px;
}

.mfs-filter-row-subtitle {
    font-size: 13px;
    color: #576C7C;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mfs-filter-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mfs-row-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #007878;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    line-height: 1;
}

.mfs-chevron {
    color: #B2B3B5;
    font-size: 16px;
    line-height: 1;
    margin-left: 2px;
    display: flex;
    align-items: center;
}

/* Chevron icon */
.mfs-chevron svg,
.mfs-chevron i {
    display: block;
}

.mfs-all-label {
    font-size: 13px;
    color: #B2B3B5;
    font-weight: 500;
}

/*  Footer  */
.mfs-footer {
    flex-shrink: 0;
    padding: 12px 20px 20px;
    border-top: 1px solid #F2F1F2;
}

.mfs-footer-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mfs-action-container,
#mfsActionContainer {
    flex: 1;
    width: 100%;
    display: flex;
}

.mfs-action-container:empty,
#mfsActionContainer:empty {
    display: none !important;
}

.mfs-btn-reset {
    background: none;
    border: 1.5px solid #007878;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #007878;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.mfs-btn-reset:hover {
    border-color: #005a5a;
    color: #005a5a;
    background-color: rgba(0, 120, 120, 0.05);
}

.mfs-btn-reset:disabled,
.mfs-btn-reset.disabled,
.mfs-btn-reset.mfs-btn-disabled,
.mfs-btn-reset[disabled] {
    border-color: #d1d5db !important;
    color: #9ca3af !important;
    background-color: transparent !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.55 !important;
}

.mfs-btn-apply {
    flex: 1 1 auto;
    width: 100%;
    background: #F2F1F2;
    border: none;
    border-radius: 50px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.mfs-btn-apply.mfs-btn-apply-active {
    background: #007878;
    color: #ffffff;
    cursor: pointer;
    pointer-events: auto;
}

.mfs-btn-apply:disabled,
.mfs-btn-apply.disabled,
.mfs-btn-apply.mfs-btn-disabled,
.mfs-btn-apply[disabled] {
    background: #F2F1F2 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.65 !important;
}

.mfs-btn-apply:active {
    opacity: 0.87;
}

/*  Sub-sheet (drill-down layer)  */
.mfs-sub-sheet {
    position: absolute;
    inset: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 2;
    overflow: hidden;
}

.mfs-sub-sheet.mfs-sub-open {
    transform: translateX(0);
}

.mfs-sub-sheet.mfs-sub-closing {
    transform: translateX(100%);
}

/* Sub-sheet back button area */
.mfs-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    flex-shrink: 0;
}

.mfs-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #007878;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.mfs-back-btn i.iconpark-left {
    font-size: 18px;
    color: #007878;
    font-weight: bold;
}

.mfs-back-btn:hover {
    opacity: 0.7;
}

.mfs-sub-clear-btn {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: #007878;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mfs-sub-clear-btn:hover {
    opacity: 0.7;
}

/* Select All checkbox wrapper in sub-header */
.mfs-select-all-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #007878;
    cursor: pointer;
    margin: 0;
    user-select: none;
    line-height: 1;
}

.mfs-select-all-wrapper .mfs-check-circle {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.mfs-select-all-wrapper.mfs-selected .mfs-check-circle {
    background: #007878;
    border-color: #007878;
}

.mfs-select-all-wrapper.mfs-selected .mfs-check-circle::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Sub-sheet search bar */
.mfs-search-bar {
    margin: 0 12px 10px;
    width: calc(100% - 24px);
    position: relative;
    flex-shrink: 0;
}

.mfs-search-bar input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px 11px 38px;
    border: 1.5px solid #F2F1F2;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    color: #262828;
    background: #F6F8F8;
    outline: none;
    transition: border-color 0.2s;
}

.mfs-search-bar input:focus {
    border-color: #007878;
    background: #fff;
}

.mfs-search-bar-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #B2B3B5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Sub-sheet checkbox list */
.mfs-options-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 4px 0;
}

.mfs-options-list::-webkit-scrollbar {
    width: 0;
}

.mfs-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid #FAFAFA;
    transition: background 0.12s;
    gap: 12px;
}

.mfs-option-item:last-child {
    border-bottom: none;
}

.mfs-option-item:active {
    background: #F2F1F2;
}

.mfs-option-item.mfs-selected {
    background: #E0F4F3;
}

.mfs-option-label {
    font-size: 15px;
    font-weight: 500;
    color: #262828;
    font-family: inherit;
    flex: 1;
}

/* Custom checkbox circle */
.mfs-check-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #D7D8D9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
    position: relative;
}

.mfs-option-item.mfs-selected .mfs-check-circle {
    background: #007878;
    border-color: #007878;
}

/* CSS-only tick mark for multi-select (replaces SVG/icon) */
.mfs-option-item.mfs-selected .mfs-check-circle.mfs-type-multi::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Radio dot for single-select / groupby options */
.mfs-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    display: none;
}

.mfs-option-item.mfs-selected .mfs-check-circle .mfs-radio-dot {
    display: block;
}

/* Sub-sheet CTA footer */
.mfs-sub-footer {
    flex-shrink: 0;
    padding: 12px 20px 20px;
    border-top: 1px solid #F2F1F2;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mfs-sub-footer .mfs-btn-sub-clear {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mfs-btn-sub-select {
    flex: 1;
    background: #007878;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    text-align: center;
}

.mfs-btn-sub-select:disabled,
.mfs-btn-sub-select.disabled,
.mfs-btn-sub-select.mfs-btn-disabled,
.mfs-btn-sub-select[disabled] {
    background: #F2F1F2 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.65 !important;
}

.mfs-btn-sub-select:not(:disabled):hover {
    background: #005050;
}

/* Group by row (radio-style) gets no count badge */
.mfs-filter-row[data-groupby="true"] .mfs-row-count {
    display: none;
}

/* Hide the old mobile-button-popover when the filter sheet is active */
body.mfs-active .mobile-button-popover {
    display: none !important;
}

/*  Sheet 1 Search Slot (#mfsSearchSlot)  */
#mfsSearchSlot {
    flex-shrink: 0;
    padding: 10px 16px 8px;
    background: #ffffff;
}

/* Hides the slot entirely when empty */
#mfsSearchSlot:empty {
    padding: 0;
}

/* Wrapper that holds the text-field + clear button */
.mfs-search-slot-inner {
    position: relative;
    display: flex;
    align-items: center;
}

/* Override text-field / label inside slot */
#mfsSearchSlot label {
    display: none !important;
}

/* Hide the original component cancel/clear icon — we use our own × button */
#mfsSearchSlot .ewm-cancel,
#mfsSearchSlot .cancel,
#mfsSearchSlot .clear,
#mfsSearchSlot .text-field-clear,
#mfsSearchSlot .input-clear,
#mfsSearchSlot [class*="cancel"],
#mfsSearchSlot [class*="clear-icon"],
#mfsSearchSlot [class*="close-icon"] {
    display: none !important;
}

#mfsSearchSlot .text-field {
    margin: 0 !important;
    width: 100% !important;
}

/* The actual <input> inside the moved textField_comp_text_filter */
#mfsSearchSlot input[type="text"],
#mfsSearchSlot input[type="search"],
#mfsSearchSlot input:not([type="hidden"]) {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 44px !important;
    padding: 0 40px 0 14px !important;
    border: 1.5px solid #E4E5E6 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: #262828 !important;
    background: #ffffff !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    box-shadow: none !important;
    display: block !important;
}

#mfsSearchSlot input[type="text"]:focus,
#mfsSearchSlot input[type="search"]:focus,
#mfsSearchSlot input:not([type="hidden"]):focus {
    border-color: #007878 !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 120, 0.10) !important;
}

#mfsSearchSlot input::placeholder {
    color: #B2B3B5 !important;
    font-weight: 400 !important;
}

/* Clear × button */
.mfs-search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 14px;
    color: #B2B3B5;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.mfs-search-clear-btn:hover {
    background: #F2F1F2;
    color: #485662;
}
.modal {
    z-index: 9999;
}

@media (max-width: 991px) {
    /*Core anti-zoom rule 
       iOS zooms the viewport when a focused input has
       font-size < 16px.  Setting font-size to 16px stops
       the zoom entirely.  We compensate visually with
       transform:scale so inputs don't appear oversized.
      */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;   /* prevents iOS auto-zoom */
    }

    /*  Date-picker inputs (jQuery UI / custom)
       These often inherit a smaller font from the component;
       override specifically so the datepicker doesn't zoom.*/
    .ui-datepicker-trigger,
    .datepicker-input,
    [data-provide="datepicker"],
    input.hasDatepicker {
        font-size: 16px !important;
    }

    body {
        touch-action: manipulation;
    }

    .modal-dialog,
    .filter-model-container,
    .mfs-sheet-panel,
    .mobile-side-drawer {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

}