/* ===== Home page service search (dark section, see #home-search-section) ===== */

.home-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 280px) auto;
    gap: 12px;
}

.home-search-field,
.home-search-category {
    position: relative;
    display: block;
    min-width: 0;
}

.home-search-input,
.home-search-select {
    width: 100%;
    height: 56px;
    border-radius: 500px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.home-search-input {
    padding-inline: 52px 24px;
}

.home-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.home-search-input::-webkit-search-cancel-button {
    filter: invert(1);
}

.home-search-select {
    padding-inline: 24px 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
}

/* Native option list is rendered by the OS on a light surface */
.home-search-select option {
    color: #000c21;
    background-color: #ffffff;
}

.home-search-input:focus,
.home-search-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(150, 110, 220, 0.35);
}

.home-search-field__icon {
    position: absolute;
    inset-inline-start: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.home-search-category__caret {
    position: absolute;
    inset-inline-end: 20px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.home-search-submit {
    height: 56px;
    padding-inline: 36px;
    border-radius: 500px;
    background-color: #ffffff;
    color: #000c21;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.home-search-submit:hover,
.home-search-submit:focus-visible {
    background-color: #542198;
    color: #fbfbfb;
    box-shadow: 0px 10px 30px 0px rgba(84, 33, 152, 0.35);
}

/* Results */
.home-search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-search-results[hidden],
.home-search-grid[hidden] {
    display: none;
}

.home-search-results__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 24px;
}

.home-search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* Skeleton cards sit on a dark background here */
.home-search-skeleton .listing-card-skeleton {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1280px) {
    .home-search-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* 3 columns: keep the row balanced by hiding the 4th card */
@media (min-width: 881px) and (max-width: 1280px) {
    .home-search-grid > :nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 880px) {
    .home-search-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .home-search-field {
        grid-column: 1 / -1;
    }

    .home-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 12px;
    }
}

@media (max-width: 576px) {
    .home-search-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .home-search-input,
    .home-search-select,
    .home-search-submit {
        height: 48px;
        font-size: 14px;
    }

    .home-search-results__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
