.storefront-search {
    position: relative;
    display: block;
    flex: 1;
    max-width: 448px;
}

.storefront-search.is-overlay-open {
    opacity: 0;
}

.storefront-search__button {
    position: absolute;
    left: 14px;
    top: 50%;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--ldm-outline);
    transform: translateY(-50%);
    padding: 0;
}

.storefront-search__button .material-symbols-outlined {
    font-size: 22px;
}

.storefront-search input {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: var(--ldm-surface-low);
    color: var(--ldm-on-surface);
    cursor: text;
    font-size: 14px;
    outline: 0;
    padding: 8px 16px 8px 44px;
}

.storefront-search input:focus {
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.18);
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.search-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.search-overlay__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.search-overlay__panel {
    position: fixed;
    top: var(--search-overlay-top, 72px);
    left: var(--search-overlay-left, 16px);
    width: var(--search-overlay-width, min(100vw - 32px, 448px));
    border: 1px solid rgba(195, 198, 214, 0.7);
    border-radius: 20px;
    background: var(--ldm-surface);
    box-shadow: 0 14px 26px rgba(25, 27, 35, 0.12);
    padding: 0 0 12px;
    transform: translateY(0);
    transition: transform 0.16s ease;
}

.search-overlay.is-open .search-overlay__panel {
    transform: translateY(0);
}

.search-overlay__form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-overlay__back {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--ldm-surface-low);
    color: var(--ldm-on-surface);
}

.search-overlay__input {
    display: flex;
    min-height: 40px;
    flex: 1;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--ldm-surface-low);
    color: var(--ldm-outline);
    margin: 0;
    padding: 0 14px;
}

.search-overlay__input input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--ldm-on-surface);
    outline: 0;
    height: 40px;
    padding: 8px 0;
}

.search-overlay__suggestions {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(195, 198, 214, 0.65);
    border-radius: 14px;
    background: var(--ldm-surface-lowest, #fff);
    margin: 12px;
}

.search-overlay__suggestions a {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    border-bottom: 1px solid rgba(195, 198, 214, 0.45);
    color: var(--ldm-on-surface);
    padding: 12px 14px;
    text-decoration: none;
}

.search-overlay__suggestions a:last-child {
    border-bottom: 0;
}

.search-overlay__suggestions span {
    grid-row: span 2;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 999px;
    background: rgba(0, 61, 155, 0.1);
    color: var(--ldm-primary);
}

.search-overlay__suggestions b {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-overlay__suggestions small {
    color: var(--ldm-outline);
    font-size: 12px;
}

@media (max-width: 767.98px) {
    .storefront-search {
        display: inline-grid !important;
        flex: 0 0 40px !important;
        width: 40px !important;
        max-width: 40px !important;
        height: 40px;
        place-items: center;
    }

    .storefront-search__button {
        inset: 0;
        position: absolute;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        background: var(--ldm-surface-low);
        transform: none;
    }

    .storefront-search input {
        position: absolute;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        padding: 0;
        border: 0;
    }

    .search-overlay__panel {
        width: min(100vw - 32px, 420px);
        border-radius: 18px;
        padding: 12px;
    }

    .search-overlay__back {
        display: grid;
    }

    .search-overlay__input {
        min-height: 46px;
        border: 1px solid rgba(195, 198, 214, 0.8);
        border-radius: 14px;
    }

    .search-overlay__input input {
        height: auto;
        padding: 10px 0;
    }

    .search-overlay__suggestions {
        margin: 14px 0 0;
    }
}
