/* =============================================================
   Shared search form styles for the cars section.
   Loaded on: /cars, /cars/{brand}, /cars/{brand}/{model},
              /cars/{brand}/{model}/{generation} and versions.
   ============================================================= */

.search-form-section {
    background: #0b73fe;
}

.search-section {
    padding: 10px 20px;
    max-width: 1280px;
    margin: auto;
}

.search-form {
    display: flex;
    flex-flow: row wrap;
    gap: 3px;
    width: 100%;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
    position: relative;
}

/* Submit button: full text label on desktop, compact search icon on mobile */
.search-button .btn-icon {
    display: none;
}

@media (max-width: 768px) {
    /* Higher specificity (.search-form .form-input) so it overrides the
       base height:56px defined in cars-brand.css / cars-index.css, which
       load after this file. */
    .search-form .form-input {
        width: 100%;
        height: 40px;
    }
    .search-form .search-button {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        height: 40px;
    }
    .search-form .search-button .btn-text {
        display: none;
    }
    .search-form .search-button .btn-icon {
        display: block;
        width: 22px;
        height: 22px;
    }

    /* The narrow grid columns (~30%) squeeze the autocomplete dropdown, so on
       mobile anchor it to the whole form and let it span full width instead. */
    .search-form {
        position: relative;
    }
    .search-form .form-group {
        position: static;
    }
    .search-form .dropdown-list {
        left: 0;
        right: 0;
    }
    .search-form .dropdown-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
