.search-history {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
    padding: 0.75rem;
    display: none;
    max-height: 14rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.search-history::-webkit-scrollbar {
    width: 0.4rem;
}

.search-history::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
}

.search-history::-webkit-scrollbar-track {
    background: transparent;
}

.search-history--visible {
    display: block;
}

.search-history[hidden] {
    display: none;
}

.search-history__empty {
    font-size: 0.8125rem;
    color: #6c757d;
    margin: 0;
}

.search-history__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background-color: rgba(15, 23, 42, 0.02);
    transition: background-color 0.2s ease;
}

.search-history__item:hover,
.search-history__item:focus-within {
    background-color: rgba(15, 23, 42, 0.06);
}

.search-history__keyword-button {
    flex: 1 1 auto;
    text-align: left;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #1f2937;
    padding: 0;
    cursor: pointer;
}

.search-history__keyword-button:focus-visible {
    outline: 2px solid #5a378c;
    outline-offset: 2px;
}

.search-history__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.search-history__action-button {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background-color: #ffffff;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.search-history__action-button:hover,
.search-history__action-button:focus-visible {
    background-color: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.2);
    outline: none;
}

.search-history__action-button--pin[aria-pressed="true"] {
    background-color: #5a378c;
    border-color: #5a378c;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .page-search__body .search-history {
        position: static;
        margin-top: 0.5rem;
        box-shadow: none;
        border-radius: 0.75rem;
    }

    .page-search__body .search-history--visible {
        display: block;
    }
}
