/* PrimeNest - reusable search bar (tabs + main search row + collapsible filters) */

.search-bar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 42, 71, 0.18);
    padding: 1.25rem 1.5rem 1.5rem;
}

/* Row 1: Buy / Rent tabs */

.search-bar__tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: #f0f2f5;
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.search-bar__tabs input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.search-bar__tabs label {
    display: inline-block;
    padding: 0.45rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5a6a;
    cursor: pointer;
}

.search-bar__tabs input:checked + label {
    background: var(--color-blue-primary);
    color: #fff;
}

/* Row 2: property type + search input + submit */

.search-bar__main {
    display: flex;
    align-items: stretch;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    overflow: hidden;
}

.search-bar__type {
    flex-shrink: 0;
    border-right: 1px solid #d7dde3;
    background: #f8f9fb;
}

.search-bar__type select {
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5a6a;
    cursor: pointer;
}

.search-bar__input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem;
    min-width: 0;
}

.search-bar__input-wrap svg {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.search-bar__input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 0.85rem 0;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.search-bar__input-wrap input:focus {
    outline: none;
}

.search-bar__submit {
    flex-shrink: 0;
    background: var(--color-red-accent);
    color: #fff;
    border: none;
    padding: 0 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.search-bar__submit:hover {
    background: var(--color-red-primary);
}

/* More filters toggle */

.search-bar__more-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.search-bar__more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-blue-primary);
    cursor: pointer;
}

.search-bar__more-toggle svg {
    transition: transform 0.2s ease;
}

.search-bar__more-toggle-input:checked ~ .search-bar__more-toggle svg {
    transform: rotate(180deg);
}

/* Collapsible filter panel */

.search-bar__panel {
    display: none;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef1f4;
}

.search-bar__more-toggle-input:checked ~ .search-bar__panel {
    display: flex;
}

.search-bar__pill {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border: 1px solid #d7dde3;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    min-width: 140px;
}

.search-bar__pill label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.search-bar__optional {
    text-transform: none;
    font-weight: 400;
}

.search-bar__pill select,
.search-bar__pill input {
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: transparent;
}

.search-bar__pill select:disabled,
.search-bar__pill input:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.search-bar__pill--disabled {
    background: #f5f6f8;
}

.search-bar__pill--range {
    min-width: 200px;
}

.search-bar__price-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-bar__price-inputs input {
    width: 0;
    flex: 1;
}

@media (max-width: 640px) {
    .search-bar {
        padding: 1rem;
    }

    .search-bar__main {
        flex-wrap: wrap;
    }

    .search-bar__type {
        border-right: none;
        border-bottom: 1px solid #d7dde3;
        width: 100%;
    }

    .search-bar__type select {
        width: 100%;
        padding: 0.7rem 0.9rem;
    }

    .search-bar__input-wrap {
        width: 100%;
    }

    .search-bar__submit {
        width: 100%;
        padding: 0.85rem;
    }

    .search-bar__pill {
        flex: 1 1 calc(50% - 0.75rem);
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .search-bar__pill {
        flex: 1 1 100%;
    }
}
