/* Пустой поиск в шапке: история, акции и персональная подборка. */
#search-overlay-global {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(20, 28, 38, 0.24);
}

#search-suggestions-results {
    display: none;
    position: fixed !important;
    top: 100px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: auto !important;
    max-height: calc(100vh - 100px) !important;
    padding: 0 0 18px !important;
    overflow-y: auto;
    box-sizing: border-box;
    border-top: 1px solid #edf0f4 !important;
    border-radius: 0 0 18px 18px !important;
    background: #fff !important;
    box-shadow: 0 18px 42px rgba(20, 28, 38, 0.18) !important;
    z-index: 1200 !important;
    text-align: left;
    -webkit-overflow-scrolling: touch;
}

body.admin-bar #search-suggestions-results {
    top: 132px !important;
    max-height: calc(100vh - 132px) !important;
}

.search-discovery-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 18px 22px;
}

.search-discovery-section {
    padding: 16px 0 20px;
    border-bottom: 1px solid #edf0f4;
}

.search-discovery-section[hidden] {
    display: none !important;
}

.search-discovery-section:last-child {
    border-bottom: 0;
}

.search-discovery-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
}

.search-discovery-heading h3 {
    margin: 0;
    color: #202a35;
    font-size: 19px;
    font-weight: 750;
    line-height: 1.25;
}

.search-discovery-subtitle {
    margin: 4px 0 0;
    color: #77818d;
    font-size: 13px;
}

.search-discovery-clear {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #798391;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.search-discovery-clear:hover {
    color: #e45e35;
}

.search-discovery-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-discovery-history-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 11px;
    border: 1px solid #e8ebef;
    border-radius: 999px;
    background: #f8f9fb;
}

.search-discovery-history-item a {
    overflow: hidden;
    color: #314154;
    font-size: 14px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-discovery-history-item button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #9099a4;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.search-discovery-products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    background: transparent;
}

.search-discovery-message {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7f8fa;
    color: #697583;
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 782px) {
    #search-suggestions-results {
        top: 96px !important;
        max-height: calc(100dvh - 104px) !important;
    }

    body.admin-bar #search-suggestions-results {
        top: 142px !important;
        max-height: calc(100dvh - 150px) !important;
    }
}

@media (max-width: 700px) {
    #search-suggestions-results {
        max-height: calc(100dvh - 104px) !important;
    }

    .search-discovery-content {
        padding: 4px 12px 16px;
    }

    .search-discovery-section {
        padding: 13px 0 16px;
    }

    .search-discovery-heading h3 {
        font-size: 17px;
    }

    .search-discovery-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
}
