/* map-filter-custom.css — Assalom Estate Map Filter
   Sized in rem so it scales with the project's :root font-size media queries. */

/* ============================ */
/* Container                    */
/* ============================ */
.map-filter {
    position: absolute;
    top: 7.8rem;
    left: 0.8rem;
    max-height: calc(100% - 8.6rem);
    width: 17rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.12);
    z-index: 4;
    display: flex;
    flex-direction: column;
    font-family: 'Euclid Circular B', sans-serif;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
}
.map-filter.collapsed {
    transform: translateX(calc(-100% - 1.6rem));
    opacity: 0;
    pointer-events: none;
}
/* Desktop: collapsed class is set in HTML to avoid mobile FOUC,
   but should have no visual effect on wider viewports. */
@media (min-width: 769px) {
    .map-filter.collapsed {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }
}

/* ============================ */
/* Header                       */
/* ============================ */
.map-filter__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f1f1;
    flex-shrink: 0;
    background: #fff;
}
.map-filter__logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a1a;
}
.map-filter__close {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.map-filter__close:hover {
    background: #FF7900;
    color: #fff;
}

/* ============================ */
/* Body (scrollable area)       */
/* ============================ */
.map-filter__body {
    /* Desktop: auto-size up to parent's max-height, scroll when capped */
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.8rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: #FFCFA0 transparent;
}
.map-filter__body::-webkit-scrollbar {
    width: 0.2rem;
}
.map-filter__body::-webkit-scrollbar-track {
    background: transparent;
}
.map-filter__body::-webkit-scrollbar-thumb {
    background: #FFCFA0;
    border-radius: 0.1rem;
}
.map-filter__body::-webkit-scrollbar-thumb:hover {
    background: #FF7900;
}

/* ============================ */
/* Slider Cards                 */
/* ============================ */
.map-filter__card {
    display: flex;
    gap: 0.6rem;
    padding: 0.7rem;
    background: linear-gradient(135deg, #fff8f2 0%, #fff 100%);
    border: 1px solid #fff0e0;
    border-radius: 0.7rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.map-filter__card:hover {
    border-color: #ffcfa0;
    box-shadow: 0 0.2rem 0.6rem rgba(255, 121, 0, 0.06);
}
.map-filter__card-icon {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.55rem;
    background: #FF7900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0.2rem 0.5rem rgba(255, 121, 0, 0.25);
}
.map-filter__card-icon svg {
    color: #fff;
    stroke: #fff;
    width: 0.9rem;
    height: 0.9rem;
}
.map-filter__card-content {
    flex: 1;
    min-width: 0;
}

/* ============================ */
/* Labels                       */
/* ============================ */
.map-filter__label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.015em;
}
.map-filter__label svg {
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
}
.map-filter__budget-value {
    margin-left: auto;
    font-size: 0.55rem;
    font-weight: 600;
    color: #FF7900;
    background: #fff5eb;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

/* ============================ */
/* Sections                     */
/* ============================ */
.map-filter__section {
    display: flex;
    flex-direction: column;
}

/* ============================ */
/* Pills                        */
/* ============================ */
.map-filter__pills {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.map-filter__pill {
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
}
.map-filter__pill input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}
.map-filter__pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.8rem;
    padding: 0 0.6rem;
    border-radius: 0.5rem;
    background: #f5f5f5;
    font-size: 0.65rem;
    font-weight: 500;
    color: #555;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1px solid transparent;
}
.map-filter__pill:hover span {
    background: #fff5eb;
    border-color: #ffcfa0;
    color: #FF7900;
}
.map-filter__pill input:checked ~ span {
    background: #FF7900;
    color: #fff;
    border-color: #FF7900;
    box-shadow: 0 0.2rem 0.6rem rgba(255, 121, 0, 0.3);
}

/* ============================ */
/* Custom Checkboxes (districts)*/
/* ============================ */
.map-filter__checks {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-height: 9rem;
    overflow-y: auto;
    padding-right: 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: #ffcfa0 transparent;
}
.map-filter__checks::-webkit-scrollbar {
    width: 0.15rem;
}
.map-filter__checks::-webkit-scrollbar-thumb {
    background: #ffcfa0;
    border-radius: 0.1rem;
}
.map-filter__check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.65rem;
    color: #444;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
    user-select: none;
}
.map-filter__check:hover {
    background: #fff8f2;
}
.map-filter__check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 0.9rem;
    height: 0.9rem;
    border: 1px solid #d4d4d4;
    border-radius: 0.25rem;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
    margin: 0;
}
.map-filter__check input[type="checkbox"]:hover {
    border-color: #FF7900;
}
.map-filter__check input[type="checkbox"]:checked {
    background: #FF7900;
    border-color: #FF7900;
}
.map-filter__check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 0.25rem;
    top: 0.05rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid #fff;
    border-width: 0 0.1rem 0.1rem 0;
    transform: rotate(45deg);
}
.map-filter__check span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================ */
/* ion.rangeSlider — orange     */
/* ============================ */
.map-filter__card .irs--flat .irs-line {
    background: #f0f0f0;
    border-radius: 0.2rem;
    height: 0.3rem;
}
.map-filter__card .irs--flat .irs-bar {
    background: #FF7900;
    height: 0.3rem;
    border-radius: 0.2rem;
}
.map-filter__card .irs--flat .irs-handle > i:first-child {
    background: #FF7900;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    top: -0.3rem;
    cursor: grab;
    box-shadow: 0 0.1rem 0.3rem rgba(255, 121, 0, 0.4);
}
.map-filter__card .irs--flat .irs-handle:hover > i:first-child {
    transform: scale(1.15);
}
.map-filter__card .irs--flat .irs-from,
.map-filter__card .irs--flat .irs-to,
.map-filter__card .irs--flat .irs-single {
    background: #FF7900;
    border-radius: 0.3rem;
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
}
.map-filter__card .irs--flat .irs-from:before,
.map-filter__card .irs--flat .irs-to:before,
.map-filter__card .irs--flat .irs-single:before {
    border-top-color: #FF7900;
}
.map-filter__card .irs--flat .irs-min,
.map-filter__card .irs--flat .irs-max {
    display: none;
}

/* ============================ */
/* Footer                       */
/* ============================ */
.map-filter__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid #f1f1f1;
    flex-shrink: 0;
    background: #fafafa;
}
.map-filter__count {
    font-size: 0.6rem;
    color: #777;
    line-height: 1.3;
}
.map-filter__count b {
    color: #FF7900;
    font-weight: 700;
    font-size: 0.8rem;
    display: block;
}
.map-filter__reset {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: #999;
    font-size: 0.6rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 0.4rem;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.map-filter__reset svg {
    width: 0.7rem;
    height: 0.7rem;
}
.map-filter__reset:hover {
    color: #FF7900;
    border-color: #FF7900;
    background: #fff5eb;
}

/* ============================ */
/* Toggle (mobile FAB button)   */
/* ============================ */
.map-filter-toggle {
    position: fixed;
    left: 0.8rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0));
    z-index: 6;
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: #FF7900;
    color: #fff;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 0.3rem 1rem rgba(255, 121, 0, 0.4), 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.map-filter-toggle:hover {
    transform: translateY(-0.1rem);
    box-shadow: 0 0.4rem 1.2rem rgba(255, 121, 0, 0.5), 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}
.map-filter-toggle:active {
    transform: translateY(0);
}
.map-filter-toggle svg {
    flex-shrink: 0;
    color: #fff;
    stroke: #fff;
    width: 0.9rem;
    height: 0.9rem;
}

/* ============================ */
/* Mobile drawer (≤768px)       */
/* ============================ */
@media (max-width: 768px) {
    .map-filter {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 85dvh;
        max-height: 85dvh;
        border-radius: 1.2rem 1.2rem 0 0;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 4;
        box-shadow: 0 -0.4rem 2rem rgba(0, 0, 0, 0.18);
    }
    .map-filter.collapsed {
        transform: translateY(100%);
        opacity: 1;
        pointer-events: none;
    }
    /* Drag handle visual at top of sheet */
    .map-filter::before {
        content: '';
        position: absolute;
        top: 0.4rem;
        left: 50%;
        transform: translateX(-50%);
        width: 2rem;
        height: 0.2rem;
        border-radius: 0.1rem;
        background: #d4d4d4;
        pointer-events: none;
        z-index: 1;
    }
    .map-filter__header {
        padding-top: 1rem;
    }
    .map-filter__body {
        flex: 1 1 0;
    }
    .map-filter__close {
        display: flex;
    }
    .map-filter__footer {
        flex-wrap: wrap;
    }
    .map-filter-toggle {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .map-filter {
        width: 100%;
        max-width: 100%;
        border-radius: 1.2rem 1.2rem 0 0;
    }
}
