.ksb-bar {
    --ksb-text: #ffffff;
    --ksb-muted: rgba(255, 255, 255, 0.62);
    --ksb-line: rgba(255, 255, 255, 0.45);
    --ksb-button-bg: #0b0b0d;
    --ksb-button-text: #ffffff;
    align-items: flex-end;
    color: var(--ksb-text);
    display: flex;
    flex-wrap: wrap;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    gap: 32px;
    width: 100%;
}

.ksb-bar *,
.ksb-bar *::before,
.ksb-bar *::after {
    box-sizing: border-box;
}

/* Light background variant — [kropp_search_bar theme="light"] */
.ksb-bar--light {
    --ksb-text: #14171f;
    --ksb-muted: rgba(20, 23, 31, 0.55);
    --ksb-line: rgba(20, 23, 31, 0.28);
}

.ksb-bar__field {
    flex: 1 1 200px;
    min-width: 0;
}

.ksb-bar__label {
    color: var(--ksb-text);
    display: block;
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 22px;
}

.ksb-bar__control {
    align-items: center;
    border-bottom: 1px solid var(--ksb-line);
    display: flex;
    gap: 8px;
    padding-bottom: 12px;
    position: relative;
}

.ksb-bar__input,
.ksb-bar__select,
.ksb-bar__trigger {
    appearance: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--ksb-text);
    flex: 1 1 auto;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    min-height: 26px;
    min-width: 0;
    outline: 0;
    padding: 0;
    width: 100%;
}

.ksb-bar__input::placeholder {
    color: var(--ksb-muted);
}

.ksb-bar__select {
    cursor: pointer;
    padding-right: 28px;
    text-overflow: ellipsis;
}

.ksb-bar__select.is-empty {
    color: var(--ksb-muted);
}

.ksb-bar__select option {
    background: #ffffff;
    color: #14171f;
}

.ksb-bar__trigger {
    cursor: pointer;
    padding-right: 28px;
    text-align: left;
}

.ksb-bar__trigger-text {
    color: var(--ksb-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ksb-bar__trigger.is-filled .ksb-bar__trigger-text {
    color: var(--ksb-text);
}

.ksb-bar__input:focus-visible,
.ksb-bar__select:focus-visible,
.ksb-bar__trigger:focus-visible,
.ksb-bar__button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.ksb-bar__icon {
    align-items: center;
    color: var(--ksb-text);
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    pointer-events: none;
}

.ksb-bar__icon svg {
    display: block;
    height: 18px;
    width: 18px;
}

.ksb-bar__icon--pin svg {
    fill: currentColor;
}

.ksb-bar__icon--chevron {
    position: absolute;
    right: 0;
    top: 2px;
}

.ksb-bar__icon--chevron svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.ksb-bar__panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(10, 14, 24, 0.22);
    color: #14171f;
    display: grid;
    gap: 14px;
    left: 0;
    min-width: 260px;
    padding: 18px;
    position: absolute;
    top: calc(100% + 12px);
    z-index: 40;
}

.ksb-bar__panel[hidden] {
    display: none;
}

.ksb-bar__panel-row {
    display: grid;
    gap: 6px;
}

.ksb-bar__panel-row span {
    color: #5c6270;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ksb-bar__panel-row input {
    background: #f5f7fa;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    color: #14171f;
    font-family: inherit;
    font-size: 15px;
    min-height: 44px;
    padding: 0 12px;
    width: 100%;
}

.ksb-bar__panel-clear {
    background: none;
    border: 0;
    color: #5c6270;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    justify-self: start;
    padding: 0;
    text-decoration: underline;
}

.ksb-bar__submit {
    flex: 0 0 auto;
    padding-bottom: 4px;
}

.ksb-bar__button {
    background: var(--ksb-button-bg);
    border: 0;
    border-radius: 999px;
    color: var(--ksb-button-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    min-height: 62px;
    padding: 0 46px;
    transition: transform 0.18s ease, opacity 0.18s ease;
    white-space: nowrap;
}

.ksb-bar__button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .ksb-bar {
        gap: 24px;
    }

    .ksb-bar__field,
    .ksb-bar__submit {
        flex: 1 1 100%;
    }

    .ksb-bar__label {
        margin-bottom: 12px;
    }

    .ksb-bar__button {
        width: 100%;
    }

    .ksb-bar__panel {
        left: auto;
        right: 0;
    }
}

/* Google Places autocomplete (PlaceAutocompleteElement) on the Location field.
   The element renders its own input in a shadow root, so the visible styling is
   set through the documented gmp-* custom properties. */
.ksb-bar__places {
    --gmp-mat-color-surface: transparent;
    --gmp-mat-color-on-surface: var(--ksb-text);
    --gmp-mat-color-on-surface-variant: var(--ksb-muted);
    --gmp-mat-color-outline: transparent;
    --gmp-mat-font-family: inherit;
    --gmp-mat-font-size-body-medium: 16px;
    background: transparent;
    border: 0;
    color: var(--ksb-text);
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

/* The suggestion list is portalled to the body and .pac-container is a global
   Google class, shared with any other autocomplete on the page (the Routiz search
   bar uses one too). Only the z-index is set, and only enough to clear the hero
   overlay — restyling .pac-container here would change that other bar as well. */
.pac-container {
    z-index: 100000;
}

/* Scoped to this plugin's element, so it cannot affect other autocompletes. */
.ksb-bar__places::part(prediction-list) {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 20, 30, 0.18);
    color: #14171f;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
