/* ==========================================
   KLO Search Overlay
   ========================================== */

.klo-search-overlay {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;

    z-index: 999999 !important;

    background: rgba(255, 255, 255, 0.98);

    overflow-x: hidden !important;
    overflow-y: scroll !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateX(100%);

    transition:
        transform 0.35s ease,
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.klo-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

body.klo-search-active {
    overflow: hidden;
}

/* ==========================================
   Search Field
   ========================================== */

.klo-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 16px auto 0;
}

.klo-search-icon {
    position: absolute;
    top: 50%;
    left: 22px;
    z-index: 2;

    transform: translateY(-50%);

    pointer-events: none;

    opacity: 0.55;
    font-size: 18px;
}

#klo-search-input {
    width: 100%;
    height: 64px;
    padding: 0 24px 0 58px;

    border: 1px solid #d8d8d8;
    border-radius: 999px;

    background: #ffffff;

    font-size: 18px;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

#klo-search-input:focus {
    border-color: rgba(0, 0, 0, 0.38);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}

/* ==========================================
   Search States
   ========================================== */

.klo-search-results,
.klo-search-no-results {
    display: none;
}

/* ==========================================
   Empty-State Buttons
   ========================================== */

.klo-search-empty .klo-search-button .elementor-button {
    padding: 10px 18px !important;

    border: 1px solid #cfd8d4 !important;
    border-radius: 999px !important;

    background: #ffffff !important;
    color: #173f35 !important;

    box-shadow: none !important;
    text-shadow: none !important;

    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease !important;
}

.klo-search-empty .klo-search-button .elementor-button:hover,
.klo-search-empty .klo-search-button .elementor-button:focus-visible {
    border-color: #173f35 !important;
    background: #173f35 !important;
    color: #ffffff !important;

    box-shadow: none !important;
    text-shadow: none !important;

    transform: translateY(-1px);
}

.klo-search-empty .klo-search-button .elementor-button-text {
    text-shadow: none !important;
}

/* ==========================================
   Results Surface
   ========================================== */

.klo-search-results {
    position: relative;
    z-index: 2;

    width: 100%;
    padding: 24px 20px 36px !important;

    background: #ffffff;
}

.klo-search-results-content {
    width: 100%;
    max-width: 900px !important;
    margin: 0 auto;
}

/* ==========================================
   Result Groups
   ========================================== */

.klo-search-results .klo-search-result-group {
    margin: 0 0 24px !important;
    padding: 0 !important;
}

.klo-search-results .klo-search-result-group:last-child {
    margin-bottom: 0 !important;
}

.klo-search-results .klo-search-result-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 0 !important;
    margin: 0 0 10px !important;
}

.klo-search-results .klo-search-result-group__title {
    margin: 0 !important;
    padding: 0 !important;

    font-size: 25px !important;
    line-height: 1.1 !important;
}

.klo-search-results .klo-search-result-group__count {
    font-size: 11px !important;
    line-height: 1 !important;
    opacity: 0.6;
}

.klo-search-results .klo-search-result-group__items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
}

/* ==========================================
   Result Cards
   ========================================== */

.klo-search-results .klo-search-result {
    display: block;

    min-height: 0 !important;
    height: auto !important;
    padding: 11px 13px !important;

    border: 1px solid #d5dde5;
    border-radius: 9px !important;

    background: #ffffff;
    color: inherit;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);

    text-decoration: none;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.klo-search-results .klo-search-result:hover {
    border-color: #173f35;

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);

    transform: translateY(-2px);
}

.klo-search-results .klo-search-result:focus-visible {
    outline: 3px solid rgba(23, 63, 53, 0.25);
    outline-offset: 3px;
}

.klo-search-results .klo-search-result__content {
    min-height: 0 !important;
}

.klo-search-results .klo-search-result__title {
    margin: 0 0 4px !important;
    padding: 0 !important;

    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.klo-search-results .klo-search-result__meta {
    margin: 0 !important;
    padding: 0 !important;

    font-size: 11px !important;
    line-height: 1.3 !important;

    opacity: 0.72;
}

.klo-search-results .klo-search-result__summary {
    margin: 5px 0 0 !important;
    padding: 0 !important;

    font-size: 12px !important;
    line-height: 1.4 !important;
}

/* ==========================================
   Loading and Error States
   ========================================== */

.klo-search-results .klo-search-loading,
.klo-search-results .klo-search-error {
    padding: 24px 0 !important;

    text-align: center;
    font-size: 14px !important;
}

/* ==========================================
   Grouped Entity Results
   ========================================== */

.klo-search-result--entity-group {
    display: block;
}

.klo-search-result__primary-link {
    color: inherit;
    text-decoration: none;
}

.klo-search-result__primary-link:hover {
    text-decoration: underline;
}

.klo-search-result__variants {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 10px;
}

.klo-search-result__variant {
    display: inline-flex;
    align-items: center;

    min-height: 28px;
    padding: 5px 10px;

    border: 1px solid #cfd8d4;
    border-radius: 999px;

    background: #f7f9f8;
    color: #173f35;

    box-shadow: none;
    text-shadow: none;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.klo-search-result__variant:hover,
.klo-search-result__variant:focus-visible {
    border-color: #173f35;

    background: #173f35;
    color: #ffffff;

    box-shadow: none;
    text-shadow: none;

    transform: translateY(-1px);
}

/* ==========================================
   Mobile
   ========================================== */

@media (max-width: 767px) {
    /* Tighten the Elementor container that holds the mobile search prompt/input. */
    .klo-search-overlay > .e-con:has(#klo-search-input) {
        width: 100% !important;
        max-width: 100% !important;

        padding: 92px 16px 0 !important;
    }

    /* Simplify the empty search screen on phones. */
    .klo-search-mobile-hide {
        display: none !important;
    }

    /* The two empty-state recommendation groups are hidden on mobile, so
       remove any leftover Elementor spacing from their parent state. */
    .klo-search-empty {
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .klo-search-wrapper {
        width: calc(100vw - 32px) !important;
        max-width: none !important;
        margin: 8px auto 0 !important;
        left: 50%;
        transform: translateX(-50%);
    }

    #klo-search-input {
        height: 50px;
        padding: 0 18px 0 46px;
        font-size: 15px;
    }

    .klo-search-icon {
        left: 17px;
        font-size: 16px;
    }

    .klo-search-empty .klo-search-button .elementor-button {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    .klo-search-results {
        padding: 20px 14px 32px !important;
    }

    .klo-search-results .klo-search-result-group {
        margin-bottom: 20px !important;
    }

    .klo-search-results .klo-search-result-group__title {
        font-size: 22px !important;
    }

    .klo-search-results .klo-search-result-group__items {
        grid-template-columns: 1fr !important;
    }

    .klo-search-results .klo-search-result {
        padding: 11px 12px !important;
    }

    .klo-search-results .klo-search-result__title {
        font-size: 15px !important;
    }

    .klo-search-results .klo-search-result__summary {
        font-size: 12px !important;
    }
	
}
