/* Toggle button */
.jims-header-search-toggle {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 0;
    transition: transform 0.2s ease;
}

.jims-header-search-toggle:hover {
    transform: scale(1.08);
}

.jims-header-search-menu-item {
    display: inline-flex;
    align-items: center;
    list-style: none;
}

/* Expandable search bar — reveals by clipping, never slides over the header */
.jims-header-search-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100001; /* was 99990 — now ABOVE the overlay */
    background: transparent; /* moved to inner */
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    will-change: clip-path;
}

.jims-header-search-wrapper.is-open {
    clip-path: inset(0 0 0 0);
    pointer-events: auto;
}

.jims-header-search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;

    /* Visuals live here now, not on the wrapper */
    background: #ffffff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.jims-header-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.jims-header-search-input {
    flex: 1;
    padding: 10px 16px; /* was 12px 16px */
    font-size: 20px !important; /* keeps iOS from zooming on focus */
    border: 1px solid #dddddd;
    border-radius: 30px;
    outline: none;
    background: #ffffff;
    color: #111111;
}

.jims-header-search-input:focus {
    border-color: #333333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.jims-header-search-submit,
.jims-header-search-close {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    border-radius: 50%;
    line-height: 0;
    transition: background 0.2s ease;
}

.jims-header-search-submit:hover,
.jims-header-search-close:hover {
    background: #f0f0f0;
}

/* Dimmed overlay */
.jims-header-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overscroll-behavior: contain;
    touch-action: none;
}

.jims-header-search-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hide Jetpack's default search trigger */
.jetpack-search-filter__link:not(.jims-header-search-toggle),
.jetpack-instant-search__search-form {
    display: none !important;
}
