/* ==========================================================================
   WSF live search

   Every visual value is a --ws-* variable. The defaults below are the stock look;
   the Design > Search tab overrides them (inline CSS printed by WSF\Search), so
   this file never needs editing to restyle the search.
   ========================================================================== */

.wsf-search {
    --ws-bg: #ffffff;
    --ws-text: #1f2937;
    --ws-muted: #6b7280;
    --ws-accent: #2563eb;
    --ws-accent-text: #ffffff;
    --ws-border: #d9dce1;

    --ws-font: inherit;
    --ws-font-size: 15px;
    --ws-radius: 10px;
    --ws-button-radius: 7px;
    --ws-height: 44px;
    --ws-max-width: 600px;
    --ws-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    --ws-thumb: 44px;
    --ws-thumb-radius: 6px;

    position: relative;
    width: 100%;
    max-width: var(--ws-max-width);
    margin: 0 auto;
    color: var(--ws-text);
    font-family: var(--ws-font);
    font-size: var(--ws-font-size);
    line-height: 1.4;
    box-sizing: border-box;
}

.wsf-search *,
.wsf-search *::before,
.wsf-search *::after {
    box-sizing: border-box;
}

.wsf-search__form {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    padding: 0 6px 0 14px;
    margin: 0;
    transition: border-color .15s, box-shadow .15s;
}

.wsf-search.is-open .wsf-search__form,
.wsf-search__form:focus-within {
    border-color: var(--ws-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ws-accent) 18%, transparent);
}

.wsf-search__icon {
    display: flex;
    color: var(--ws-text);
    opacity: .55;
    margin-right: 8px;
}

.wsf-search .wsf-search__input {
    flex: 1;
    min-width: 0;
    height: var(--ws-height);
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ws-text);
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.wsf-search .wsf-search__input:focus,
.wsf-search .wsf-search__input:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

.wsf-search__input::placeholder {
    color: var(--ws-muted);
    opacity: 1;
}

.wsf-search__input::-webkit-search-cancel-button {
    display: none;
}

.wsf-search__clear {
    border: 0;
    background: transparent;
    color: var(--ws-text);
    opacity: .5;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.wsf-search__clear:hover {
    opacity: 1;
}

.wsf-search .wsf-search__submit {
    border: 0;
    border-radius: var(--ws-button-radius);
    background: var(--ws-accent);
    color: var(--ws-accent-text);
    font-family: inherit;
    font-weight: 600;
    font-size: .93em;
    height: calc(var(--ws-height) - 10px);
    padding: 0 16px;
    cursor: pointer;
    margin-left: 4px;
}

.wsf-search__submit:hover {
    filter: brightness(1.08);
}

.wsf-search__spinner {
    display: none;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border: 2px solid color-mix(in srgb, var(--ws-text) 18%, transparent);
    border-top-color: var(--ws-accent);
    border-radius: 50%;
    animation: wsf-spin .7s linear infinite;
}

.wsf-search.is-loading .wsf-search__spinner {
    display: block;
}

@keyframes wsf-spin {
    to { transform: rotate(360deg); }
}

.wsf-search__dropdown {
    position: absolute;
    z-index: 99999;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    box-shadow: var(--ws-shadow);
    padding: 6px;
}

.wsf-search__dropdown[hidden] {
    display: none;
}

.wsf-search__group {
    padding: 8px 10px 4px;
    font-size: .75em;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ws-muted);
}

.wsf-search a.wsf-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: calc(var(--ws-radius) * .7);
    color: var(--ws-text);
    text-decoration: none;
}

.wsf-search a.wsf-search__item:hover,
.wsf-search a.wsf-search__item.is-active {
    background: color-mix(in srgb, var(--ws-accent) 10%, transparent);
}

.wsf-search__thumb {
    width: var(--ws-thumb);
    height: var(--ws-thumb);
    object-fit: cover;
    border-radius: var(--ws-thumb-radius);
    flex: none;
    background: color-mix(in srgb, var(--ws-text) 8%, var(--ws-bg));
}

.wsf-search__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wsf-search__title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wsf-search__title mark {
    background: transparent;
    color: var(--ws-accent);
    font-weight: 700;
}

.wsf-search__sub {
    font-size: .8em;
    color: var(--ws-muted);
}

.wsf-search__stock.in { color: #15803d; }
.wsf-search__stock.out { color: #b91c1c; }

.wsf-search__price {
    flex: none;
    font-weight: 600;
    font-size: .93em;
    white-space: nowrap;
}

.wsf-search__price del {
    opacity: .5;
    font-weight: 400;
    margin-right: 4px;
}

.wsf-search__price ins {
    text-decoration: none;
}

.wsf-search__item--cat .wsf-search__meta {
    font-size: .8em;
    color: var(--ws-muted);
}

.wsf-search a.wsf-search__more {
    justify-content: center;
    margin-top: 4px;
    border-top: 1px solid var(--ws-border);
    border-radius: 0 0 7px 7px;
    color: var(--ws-accent);
    font-weight: 600;
    font-size: .93em;
}

.wsf-search__empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--ws-muted);
}

@media (max-width: 600px) {
    .wsf-search__submit { display: none; }
    .wsf-search__dropdown { max-height: 60vh; }
}
