#nkd-job-search {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 12px;
    padding: 1rem;
    padding-bottom: calc(1rem - 12px);
}

#nkd-job-search .nkd-job-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;

    &.nkd-job-search__row--top {
        position: relative;
        margin-bottom: 24px;
    }

    &.nkd-job-search__row--top:after {
        content: '';
        position: absolute;
        bottom: -12px;
        height: 1px;
        width: 100%;
        background-color: #2D3F4D55;
    }
}

#nkd-job-search .nkd-job-search__field {
    flex: 1 1 200px;

    &.nkd-job-search__field--submit {
        max-width: 120px;
    }
}

#nkd-job-search .nkd-job-search__input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

#nkd-job-search .nkd-job-search__input:disabled {
    background-color: transparent;
    color: #999;
    cursor: not-allowed;
}

/* ── Input wrapper with inline icon ── */

#nkd-job-search .nkd-job-search__input-wrapper {
    position: relative;
    width: 100%;
}

#nkd-job-search .nkd-job-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #666;
    pointer-events: none;
}

#nkd-job-search .nkd-job-search__input-wrapper .nkd-job-search__input {
    padding-left: 40px;
}

#nkd-job-search .nkd-job-search__btn {
    width: 100%;
    padding: 9px 12px;
    background-color: #e2001a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#nkd-job-search .nkd-job-search__btn:hover {
    background-color: #c0001a;
}

/* Google Maps Autocomplete dropdown z-index fix
   !important needed: Google injects .pac-container with inline z-index */
.pac-container {
    z-index: 9999 !important;
}

/* Prevent flash of unstyled dropdown lists before Alpine initialises */
[x-cloak] { display: none !important; }

/* ── Custom dropdowns (replaces native <select>) ── */

#nkd-job-search .nkd-job-search__dropdown {
    position: relative;
    width: 100%;
}

#nkd-job-search .nkd-job-search__field {
    position: relative;
}

#nkd-job-search .nkd-job-search__field--keyword,
#nkd-job-search .nkd-job-search__field--country,
#nkd-job-search .nkd-job-search__field--distance {
    &:after {
        content: '';
        position: absolute;
        width: 1px;
        height: 100%;
        background-color: #2D3F4D55;
        right: -6px;
        top: 0;
        display: block;
    }
}

/* Medium screens: hide distance divider when Row 2 wraps into 2 columns */
@media (max-width: 820px) {
    #nkd-job-search .nkd-job-search__field--distance {
        &:after {
            display: none;
        }
    }
}

/* Mobile screens: hide all vertical dividers when fields stack */
@media (max-width: 480px) {
    #nkd-job-search .nkd-job-search__field--keyword,
    #nkd-job-search .nkd-job-search__field--country,
    #nkd-job-search .nkd-job-search__field--distance {
        &:after {
            display: none;
        }
    }

    #nkd-job-search .nkd-job-search__field.nkd-job-search__field--submit {
        max-width: none;
        flex: 1 1 100%;
    }

    #nkd-job-search .nkd-job-search__btn {
        font-size: 14px;
        line-height: 1.2;
        padding: 6px 12px;
    }

    /* Hide the top row-level divider so individual field dividers don't double up */
    #nkd-job-search .nkd-job-search__row--top:after {
        display: none;
    }

    #nkd-job-search .nkd-job-search__row.nkd-job-search__row--top {
        margin-bottom: 12px;
    }

    /* Reorder fields on mobile: Land -> PLZ/Ort -> Radius -> Submit */
    #nkd-job-search .nkd-job-search__field--country {
        order: 1;
    }
    #nkd-job-search .nkd-job-search__field--plz {
        order: 2;
    }
    #nkd-job-search .nkd-job-search__field--distance {
        order: 3;
    }
    #nkd-job-search .nkd-job-search__field--submit {
        order: 4;
    }

    /* Add bottom border to all fields except the last one (Radius) before the submit button */
    #nkd-job-search .nkd-job-search__field--keyword,
    #nkd-job-search .nkd-job-search__field--type,
    #nkd-job-search .nkd-job-search__field--country,
    #nkd-job-search .nkd-job-search__field--plz {
        border-bottom: 1px solid #2D3F4D55;
        padding-bottom: 12px;
    }

    #nkd-job-search .nkd-job-search__field--distance {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Make all form fields narrower/slimmer vertically, matching the submit button */
    #nkd-job-search .nkd-job-search__input {
        padding: 6px 12px;
        line-height: 1.2;
    }

    #nkd-job-search .nkd-job-search__input-wrapper .nkd-job-search__input {
        padding-left: 40px;
    }

    #nkd-job-search .nkd-job-search__dropdown-trigger {
        padding: 6px 12px;
        line-height: 1.2;
        height: auto !important;
        min-height: 0 !important;
    }
}

/* Trigger button — same visual dimensions as the old <select> */
#nkd-job-search .nkd-job-search__dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    color: inherit;
    height: auto !important;
    min-height: 0 !important;
}

#nkd-job-search .nkd-job-search__dropdown.is-open .nkd-job-search__dropdown-trigger {
    border-color: #999;
    border-bottom-color: #ccc;
    border-radius: 4px 4px 0 0;
}

/* CSS-only chevron — rotates when open */
#nkd-job-search .nkd-job-search__dropdown-chevron {
    display: inline-block;
    flex-shrink: 0;
    margin-left: 8px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

#nkd-job-search .nkd-job-search__dropdown.is-open .nkd-job-search__dropdown-chevron {
    transform: rotate(-135deg) translateY(2px);
}

/* Dropdown list */
#nkd-job-search .nkd-job-search__dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #999;
    border-top: none;
    border-radius: 0 0 4px 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

/* List items */
#nkd-job-search .nkd-job-search__dropdown-item {
    display: flex;
    align-items: baseline;
    gap: 0.35em;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

#nkd-job-search .nkd-job-search__dropdown-item:hover,
#nkd-job-search .nkd-job-search__dropdown-item:focus,
#nkd-job-search .nkd-job-search__dropdown-item.is-selected {
    background: #f5f5f5;
}

#nkd-job-search .nkd-job-search__dropdown-item.is-selected {
    font-weight: 600;
}

/* Hint text — e.g. "– Standard" on the 25 km option */
#nkd-job-search .nkd-job-search__dropdown-hint {
    font-size: 11px;
    color: #aaa;
    font-weight: normal;
}

/* Placeholder text color when no value is selected */
#nkd-job-search .nkd-job-search__dropdown-trigger .is-placeholder {
    color: #999;
}
