/*
 * KINETIC MARKET — NATIVE GEODIRECTORY CATEGORY DRILLDOWN
 * CSS ONLY — COMPLETE REPLACEMENT
 */

.km-native-category {
    position: relative;
    width: 100%;
    min-width: 0;
    color: #171717;
}

.km-native-category > select.km-native-category-source {
    display: none !important;
}

.km-native-category button,
.km-category-dialog button {
    box-sizing: border-box;
    font: inherit;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.km-native-category__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 6px 38px 6px 18px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    text-align: left;
    line-height: 1.5;
    box-shadow: none;
}

.km-native-category__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.km-native-category__trigger svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.km-native-category.is-selected .km-native-category__trigger {
    padding-right: 64px;
}

.km-native-category__clear {
    position: absolute;
    top: 50%;
    right: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #706d66;
    font-size: 23px !important;
    line-height: 1;
}

.km-native-category__clear:hover {
    background: #f1efe9;
}

.km-native-category__trigger:focus-visible,
.km-native-category__clear:focus-visible,
.km-category-dialog button:focus-visible {
    outline: 2px solid #171717;
    outline-offset: -2px;
}

.km-category-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    color: #171717;
    font-family: inherit;
}

.km-category-overlay[hidden],
.km-category-overlay [hidden],
.km-native-category [hidden] {
    display: none !important;
}

.km-category-dialog,
.km-category-dialog * {
    box-sizing: border-box;
}

.km-category-dialog {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 390px;
    max-width: calc(100vw - 24px);
    padding: 20px;
    border: 1px solid #ddd9cf;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 20px 55px rgba(0,0,0,.15),
        0 4px 12px rgba(0,0,0,.06);
}

.km-category-dialog__header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.km-category-dialog__heading {
    min-width: 0;
}

.km-category-dialog__title {
    margin: 0;
    color: #171717;
    font: inherit;
    font-size: 21px;
    font-weight: 750;
    line-height: 1.25;
}

.km-category-dialog__back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #171717;
    font-size: 15px !important;
    font-weight: 650 !important;
}

.km-category-dialog__close {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -5px -5px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #171717;
    font-size: 28px !important;
    line-height: 1;
}

.km-category-dialog__close:hover {
    background: #f4f2ed;
}

.km-category-dialog__filter {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-height: 46px;
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid #ddd9cf;
    border-radius: 10px;
    background: #faf9f6;
    color: #171717;
    font: inherit;
    font-size: 16px;
}

.km-category-dialog__filter:focus {
    outline: 2px solid #171717;
    outline-offset: -2px;
    background: #fff;
}

.km-category-dialog__options {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.km-category-dialog__row {
    display: flex;
    align-items: stretch;
    min-height: 54px;
    border-bottom: 1px solid #efede7;
}

.km-category-dialog__row:last-child {
    border-bottom: 0;
}

.km-category-dialog__select,
.km-category-dialog__all {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 13px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #171717;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4;
    text-align: left;
}

.km-category-dialog__all {
    flex: none;
    width: 100%;
    border-bottom: 1px solid #ddd9cf;
    font-weight: 750 !important;
}

.km-category-dialog__drill {
    display: flex;
    flex: 0 0 50px;
    align-items: center;
    justify-content: center;
    width: 50px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #706d66;
}

.km-category-dialog__drill svg {
    width: 18px;
    height: 18px;
}

.km-category-dialog__select:hover,
.km-category-dialog__all:hover,
.km-category-dialog__drill:hover {
    background: #faf9f6;
    color: #171717;
}

.km-category-dialog__select[aria-pressed="true"] {
    font-weight: 750 !important;
    color: #005b46;
}

.km-category-dialog__empty {
    margin: 0;
    padding: 24px 8px;
    color: #706d66;
    text-align: center;
}

body.km-native-category-lock {
    overflow: hidden;
}

@media (max-width: 799px) {

    .km-category-overlay {
        background: rgba(15,15,15,.44);
    }

    .km-category-dialog {
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100%;
        max-width: none;
        max-height: 82vh !important;
        max-height: 82dvh !important;
        padding: 20px 18px max(22px,env(safe-area-inset-bottom));
        border: 0;
        border-radius: 22px 22px 0 0;
    }
}
