/* ============================================================
   QUANTUM BENTO MULTI-SELECT v2 — Property Category Selector
   Brand: #1A1D20 (black) · #F58220 (orange) · #56C4F8 (blue)
   ============================================================ */

/* ── TRIGGER — compact, never truncates ── */
.search-proptype-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-right: 1.5px solid rgba(0, 0, 0, 0.07);
    padding: 0 14px 0 18px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: #2D3748;
    min-width: 13%;
    max-width: 28%;
    transition: all 0.25s ease;
    border-radius: 20px 0 0 20px;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

/* ── Mobile: compact label using icon + count summary ── */
@media (max-width: 480px) {
    .search-proptype-trigger {
        min-width: auto;
        max-width: none;
        padding: 0 12px 0 14px;
        flex-shrink: 0;
    }

        /* Hide the text label on very small screens — icon + badge is enough */
        .search-proptype-trigger .spt-label {
            display: none;
        }

        /* When only default (residential) — show icon only */
        .search-proptype-trigger:not(.has-selection) .spt-label {
            display: none;
        }
}

/* For screens 481–600px show a shortened label */
@media (min-width: 481px) and (max-width: 600px) {
    .search-proptype-trigger {
        max-width: 22%;
    }

        .search-proptype-trigger .spt-label {
            max-width: 60px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
}

.search-proptype-trigger:hover {
    background: rgba(245, 130, 32, 0.05);
    color: #F58220;
}

.search-proptype-trigger.has-selection {
    background: linear-gradient(to right, rgba(245, 130, 32, 0.07), transparent);
}

    .search-proptype-trigger.has-selection .spt-chevron {
        color: #F58220;
    }

.search-proptype-trigger .spt-label {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}

.search-proptype-trigger .spt-chevron {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    margin-left: auto;
    flex-shrink: 0;
}

.search-proptype-trigger.open .spt-chevron {
    transform: rotate(180deg);
}

/* ── Count badge — "+2" shown after primary label ── */
.spt-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F58220, #e07315);
    color: #fff;
    border-radius: 20px;
    padding: 1px 6px;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(245, 130, 32, 0.38);
    animation: badgePop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ════════════════════════════════════════════════════════════
   TAG STRIP — appears below the search bar when 2+ selected
   ════════════════════════════════════════════════════════════ */
.spt-tag-strip {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 18px 10px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    animation: stripReveal 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    /* Sits immediately below the composite bar */
    width: 100%;
    position: relative;
    z-index: 9;
}

    .spt-tag-strip.visible {
        display: flex;
    }

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

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

.spt-strip-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
    flex-shrink: 0;
    margin-right: 2px;
}

.spt-strip-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* Individual removable chip in the strip */
.spt-strip-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 130, 32, 0.09);
    border: 1px solid rgba(245, 130, 32, 0.30);
    border-radius: 20px;
    padding: 3px 8px 3px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1A1D20;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    line-height: 1;
    animation: chipIn 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipIn {
    0% {
        transform: scale(0.75);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.spt-strip-chip i:first-child {
    font-size: 0.72rem;
    color: #F58220;
}

.spt-chip-x {
    font-size: 0.6rem !important;
    color: #9ca3af !important;
    margin-left: 1px;
    transition: color 0.15s;
}

.spt-strip-chip:hover {
    background: rgba(245, 130, 32, 0.14);
    border-color: rgba(245, 130, 32, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(245, 130, 32, 0.18);
}

    .spt-strip-chip:hover .spt-chip-x {
        color: #ef4444 !important;
    }

/* "Reset" link at the end of the strip */
.spt-strip-clear-all {
    background: none;
    border: none;
    font-size: 0.71rem;
    font-weight: 700;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
    margin-left: auto;
}

    .spt-strip-clear-all:hover {
        color: #ef4444;
    }

/* ════════════════════════════════════════════════════════════
   BENTO DROPDOWN PANEL
   Desktop: position:fixed (set by JS via getBoundingClientRect)
   Mobile: position:fixed bottom sheet (CSS-driven)
   ════════════════════════════════════════════════════════════ */
.spt-dropdown {
    position: fixed; /* JS sets top/left on desktop; CSS overrides on mobile */
    width: 380px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(220%) blur(32px);
    -webkit-backdrop-filter: saturate(220%) blur(32px);
    border-radius: 22px;
    border: 1.5px solid rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1);
    z-index: 99000; /* above everything — fixed escapes all stacking contexts */
    overflow: hidden;
    display: none;
    padding: 0;
}

    .spt-dropdown.open {
        display: block;
        animation: bentoReveal 0.36s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
    }

@keyframes bentoReveal {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.94);
    }

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

/* Header */
.spt-bento-header {
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.055);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spt-bento-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.spt-bento-clear {
    font-size: 0.72rem;
    font-weight: 700;
    color: #F58220;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

    .spt-bento-clear.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .spt-bento-clear:hover {
        background: rgba(245, 130, 32, 0.1);
    }

/* 2-column grid */
.spt-bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px;
}

/* Bento item */
.spt-bento-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.24s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    background: rgba(248, 249, 252, 0.7);
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    /* Shimmer sweep on hover */
    .spt-bento-item::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 45%, transparent 100%);
        transform: translateX(-100%);
        transition: transform 0.45s ease;
        pointer-events: none;
        border-radius: inherit;
    }

    .spt-bento-item:hover::before {
        transform: translateX(150%);
    }

    .spt-bento-item:hover {
        border-color: rgba(86, 196, 248, 0.4);
        background: rgba(255, 255, 255, 0.92);
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(86, 196, 248, 0.14);
    }

    /* Selected state */
    .spt-bento-item.selected {
        background: linear-gradient(135deg, rgba(245, 130, 32, 0.10), rgba(86, 196, 248, 0.10));
        border-color: rgba(245, 130, 32, 0.55);
        box-shadow: 0 0 0 2.5px rgba(245, 130, 32, 0.18), 0 6px 18px rgba(245, 130, 32, 0.12);
        transform: translateY(-1px);
    }

        .spt-bento-item.selected .spt-item-icon {
            background: linear-gradient(135deg, #F58220, #56C4F8);
            color: #fff;
            box-shadow: 0 4px 12px rgba(245, 130, 32, 0.38);
            border-color: transparent;
        }

        .spt-bento-item.selected .spt-item-label {
            color: #1A1D20;
            font-weight: 800;
        }

/* Icon box */
.spt-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.96rem;
    color: #6b7280;
    flex-shrink: 0;
    transition: all 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Check ring */
.spt-check-ring {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
}

    .spt-check-ring i {
        font-size: 0.6rem;
        color: transparent;
        transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
        transform: scale(0);
    }

.spt-bento-item.selected .spt-check-ring {
    background: linear-gradient(135deg, #F58220, #E8711A);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(245, 130, 32, 0.5);
    transform: scale(1.1);
}

    .spt-bento-item.selected .spt-check-ring i {
        color: #fff;
        transform: scale(1);
    }

/* Label */
.spt-item-label {
    font-size: 0.80rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

/* Footer */
.spt-bento-footer {
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
    align-items: center;
}

.spt-bento-count {
    font-size: 0.74rem;
    color: #9ca3af;
    font-weight: 600;
    flex: 1;
}

    .spt-bento-count span {
        color: #F58220;
        font-weight: 800;
    }

.spt-bento-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #F58220, #e07315);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 14px rgba(245, 130, 32, 0.35);
}

    .spt-bento-done:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(245, 130, 32, 0.48);
    }

    .spt-bento-done:active {
        transform: scale(0.97);
    }

/* ════════════════════════════════════════════════════════════
   MOBILE — bottom sheet
   ════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .search-proptype-trigger {
        /* On mobile: minimal footprint, icon-first */
    }

    .spt-tag-strip {
        border-radius: 0 0 10px 10px;
        padding: 6px 14px 8px;
    }

    .spt-strip-label {
        display: none;
    }
    /* save horizontal space on mobile */

    .spt-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0;
        /* CRITICAL: must be above backdrop (98999) AND above ALL glass blur layers */
        z-index: 99500 !important;
        max-height: 80vh;
        overflow-y: auto;
    }

        .spt-dropdown.open {
            animation: sheetUp 0.38s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
        }

    @keyframes sheetUp {
        from {
            opacity: 0;
            transform: translateY(60px);
        }

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

    /* Drag handle */
    .spt-bento-header {
        position: relative;
        padding-top: 22px;
    }

        .spt-bento-header::before {
            content: '';
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 36px;
            height: 4px;
            background: rgba(0, 0, 0, 0.15);
            border-radius: 4px;
        }

    .spt-bento-grid {
        gap: 10px;
        padding: 12px 16px;
    }

    .spt-bento-item {
        padding: 15px 13px;
    }

    .spt-item-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .spt-item-label {
        font-size: 0.82rem;
    }
}

/* Mobile backdrop — sits below the sheet but above page content */
.spt-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 32, 0.45);
    backdrop-filter: blur(4px);
    z-index: 99400; /* below sheet (99500) but above everything else */
    animation: fadeInBackdrop 0.28s ease forwards;
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
