/* ==========================================================================
   Everklin Global Smart Search — STEP 1 (2026-08-08)

   Inline header Search Mode + header-attached autocomplete panel.
   Deliberately NOT a centered modal and NOT a full-page takeover: the search
   field lives inside the existing header row and the results open directly
   beneath the fixed header, so the current page stays visible behind them.
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---------- Search Mode inside the header row ---------- */

/* The search field is absolutely positioned inside the existing header row, so
   activating Search Mode cannot change header height or move the logo/CTA. */
.site-header .header-main { position: relative; }

/* Nav collapses to make room. Logo, header height and CTA stay put. */
body.ek-searchmode .desktop-nav { opacity: 0; visibility: hidden; pointer-events: none; }
/* Keep the header readable while searching (it is a light panel underneath). */
body.ek-searchmode .site-header { background: rgba(247, 245, 239, 0.98); }

.header-searchbar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(620px, calc(100% - 420px));
    padding: 9px 14px;
    border: 1px solid #d8e6a7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(31, 58, 38, 0.06);
}
.header-searchbar[hidden] { display: none; }

.header-searchbar__icon { display: inline-flex; color: #7e9d35; }
.header-searchbar__icon svg { width: 18px; height: 18px; }

.header-searchbar__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #1f3a26;
    font: inherit;
    font-size: .95rem;
    outline: none;
}
.header-searchbar__input::placeholder { color: #8b978a; }
.header-searchbar__input::-webkit-search-cancel-button { display: none; }

.header-searchbar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #6d7a68;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.header-searchbar__close:hover { background: #eef4dc; color: #1f3a26; }
.header-searchbar__close:focus-visible { outline: 3px solid rgba(157,180,74,.45); outline-offset: 2px; }

/* ---------- Autocomplete panel, anchored under the header ---------- */
.ek-searchpanel {
    position: fixed;
    top: 0;                 /* set at runtime to the header's bottom edge */
    left: 50%;
    transform: translateX(-50%);
    z-index: 11500;
    width: min(820px, calc(100% - 40px));
    max-height: 66vh;
    overflow-y: auto;
    padding: 8px 8px 10px;
    background: #fffdf8;
    border: 1px solid #dde7c8;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 22px 50px rgba(15, 59, 46, 0.16);
}
.ek-searchpanel[hidden] { display: none; }

.ek-sgroup {
    margin: 10px 10px 4px;
    color: #7d8a78;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Compact, scannable rows — closer to a search engine than a card grid. */
.ek-srow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #1f3a26 !important;
    text-decoration: none;
}
.ek-srow:hover,
.ek-srow.is-active,
.ek-srow:focus-visible { background: #eef4dc; outline: none; }

.ek-srow__main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ek-srow__main strong { font-size: .93rem; font-weight: 700; }
.ek-srow__main em { color: #7e9d35; font-style: normal; font-weight: 850; font-size: .8rem; }
.ek-srow__path {
    grid-column: 1 / 2;
    color: #7d8a78;
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ek-srow__state {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
    align-self: center;
    color: #8a6a3a;
    font-size: .64rem;
    font-weight: 850;
    text-transform: uppercase;
}

.ek-schips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 8px; }
.ek-schip {
    padding: 7px 13px;
    border: 1px solid #dde7c8;
    border-radius: 999px;
    background: #fff;
    color: #4f6a24 !important;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}
.ek-schip:hover { background: #eef4dc; border-color: #7e9d35; }
.ek-schip--cta { background: #7e9d35; border-color: #7e9d35; color: #fff !important; }

.ek-snomatch { margin: 12px 12px 6px; color: #5e6a60; font-size: .9rem; }
.ek-snomatch strong { color: #1f3a26; }

.ek-sall {
    display: block;
    margin-top: 6px;
    padding: 11px 12px;
    border-top: 1px solid #e6ecd8;
    color: #5f7a28 !important;
    font-size: .8rem;
    font-weight: 850;
    text-align: right;
    text-decoration: none;
}
.ek-sall:hover { background: #f8faf2; }

/* ---------- Mobile: full-width header search, results directly below ---------- */
@media (max-width: 991px) {
    .header-searchbar {
        left: 16px;
        right: 16px;
        width: auto;
        transform: translateY(-50%);
    }
    .header-searchbar__input { font-size: 16px; } /* prevents iOS zoom */
    .header-searchbar__close { width: 44px; height: 44px; }
    .ek-searchpanel {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        transform: none;
        max-height: calc(100vh - 70px);
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .ek-srow { padding: 12px; min-height: 52px; }
    .ek-schip { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---------- /search/ full results page (secondary experience) ---------- */
.ek-search-page { background: #fff; }
.ek-search-page__head { padding: 130px 0 26px; background: #f8faf2; border-bottom: 1px solid #e6ecd8; }
.ek-search-page__head h1 { margin: 12px 0 22px; color: #1f3a26; font-size: clamp(2rem, 4vw, 3.2rem); }

.ek-search-page__form { display: flex; gap: 10px; max-width: 720px; }
.ek-search-page__input {
    flex: 1;
    min-width: 0;
    min-height: 50px;
    padding: 12px 16px;
    border: 1px solid #d8e6a7;
    border-radius: 8px;
    background: #fff;
    color: #1f3a26;
    font: inherit;
    outline: none;
}
.ek-search-page__input:focus { border-color: #7e9d35; box-shadow: 0 0 0 4px rgba(126, 157, 53, 0.18); }

.ek-search-page__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ek-search-page__filter {
    padding: 9px 16px;
    border: 1px solid #dde7c8;
    border-radius: 999px;
    background: #fff;
    color: #1f3a26;
    font: inherit;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
}
.ek-search-page__filter:hover { background: #eef4dc; }
.ek-search-page__filter.is-active { background: #7e9d35; border-color: #7e9d35; color: #fff; }
.ek-search-page__filter:focus-visible { outline: 3px solid rgba(157,180,74,.45); outline-offset: 2px; }

.ek-search-page__count { margin: 18px 0 0; color: #5e6a60; font-size: .88rem; }
.ek-search-page__body { padding: 34px 0 90px; }
.ek-search-page__results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.ek-result { padding: 20px 22px; border: 1px solid #dde7c8; border-radius: 8px; background: #fff; }
.ek-result__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ek-result__badge {
    padding: 4px 9px;
    border-radius: 3px;
    background: #dde7c8;
    color: #4f6a24;
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ek-result__state { color: #8a6a3a; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.ek-result h3 { margin: 0 0 8px; font-size: 1.04rem; }
.ek-result h3 a { color: #1f3a26; text-decoration: none; }
.ek-result h3 a:hover { color: #5f7a28; }
.ek-result h3 em { color: #7e9d35; font-style: normal; }
.ek-result p { margin: 0 0 8px; color: #5e6a60; font-size: .89rem; line-height: 1.6; }
.ek-result__path { display: block; color: #7d8a78; font-size: .74rem; }
.ek-result--empty { grid-column: 1 / -1; }

@media (max-width: 820px) {
    .ek-search-page__results { grid-template-columns: 1fr; }
    .ek-search-page__head { padding-top: 108px; }
    .ek-search-page__form { flex-direction: column; }
    .ek-search-page__input { font-size: 16px; }
    .ek-search-page__filter { min-height: 44px; }
}
