/**
 * The header search (Header_Search_Widget) – Svartzonker's, in Ohyra's look: a white field with the red edge and the
 * red button beside it (as the header had it), suggestions in a white panel under it – picture on a light tile,
 * name with the words searched for marked, category, price – and "Visa alla N resultat". The kit's colours and fonts
 * with fallbacks; rules start at .gf-search to win over the kit's input and button styles.
 */

.gf-search {
    --gf-s-ink: var(--e-global-color-secondary, #1a1a1a);
    --gf-s-muted: var(--e-global-color-primary, #696969);
    --gf-s-brand: var(--e-global-color-d49ac81, #97040d);
    --gf-s-brand-strong: var(--e-global-color-332724a, #7f040c);
    --gf-s-tile: color-mix(in srgb, var(--e-global-color-cfa1f76, #f2d6d6) 38%, #fff);
    --gf-s-line: #ececec;
    --gf-s-font: var(--e-global-typography-text-font-family, "Poppins"), system-ui, sans-serif;
    --gf-s-height: 36px;

    position: relative;
    width: 100%;
    font-family: var(--gf-s-font);
}

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

.gf-search .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.gf-search .gf-search-form {
    position: relative;
    display: flex;
    margin: 0;
}

/* (the kit styles every input pink: input:not([type="button"]):not([type="submit"]) – outranked here) */
.gf-search .gf-search-form input.gf-search-input[data-gf-search-input],
.gf-search .gf-search-form input.gf-search-input[data-gf-search-input]:focus {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: var(--gf-s-height);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--gf-s-brand);
    border-right: 0;
    border-radius: 5px 0 0 5px;
    background: #fff;
    font-family: var(--gf-s-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: var(--gf-s-ink);
    box-shadow: none;
    appearance: none;
}

.gf-search .gf-search-form input.gf-search-input[data-gf-search-input]:focus {
    border-color: var(--gf-s-brand-strong);
    outline: none;
    box-shadow: inset 0 0 0 1px var(--gf-s-brand-strong);
}

.gf-search .gf-search-input::placeholder {
    color: #5c5c5c;
    opacity: 1;
}

.gf-search .gf-search-input::-webkit-search-cancel-button {
    appearance: none;
}

.gf-search .gf-search-form .gf-search-submit,
.gf-search .gf-search-form .gf-search-submit:is(:hover, :focus) {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: calc(var(--gf-s-height) + 4px);
    height: var(--gf-s-height);
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 5px 5px 0;
    background: var(--gf-s-brand);
    color: #fff;
    box-shadow: none;
    cursor: pointer;
}

.gf-search .gf-search-form .gf-search-submit:hover {
    background: var(--gf-s-brand-strong);
}

.gf-search .gf-search-submit:focus-visible {
    outline: 2px solid var(--gf-s-ink);
    outline-offset: 2px;
}

.gf-search-submit .gf-icon {
    width: 18px;
    height: 18px;
}

/* Looking it up: a ring around the magnifier */
.gf-search.is-loading .gf-search-submit::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: gf-search-spin 0.7s linear infinite;
}

@keyframes gf-search-spin {
    to {
        rotate: 1turn;
    }
}

/* The suggestions */
.gf-search .gf-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 2147483631; /* above CookieYes, the chat widget and Elementor's menus */
    display: flex;
    flex-direction: column;
    width: max(100%, min(520px, calc(100vw - 32px)));
    max-height: min(70vh, 620px);
    overflow: hidden;
    border: 1px solid var(--gf-s-line);
    border-radius: 8px;
    background: #fff;
    color: var(--gf-s-ink);
    box-shadow: 0 22px 50px -14px rgb(0 0 0 / 0.3), 0 2px 6px rgb(0 0 0 / 0.06);
}

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

.gf-search-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 0 0;
}

.gf-search .gf-search-option,
.gf-search .gf-search-option:is(:hover, :focus) {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    color: var(--gf-s-ink);
    text-decoration: none;
}

.gf-search .gf-search-option:not(:has(.gf-search-thumb)) {
    grid-template-columns: minmax(0, 1fr) auto;
}

.gf-search .gf-search-option:is(:hover, [aria-selected="true"]) {
    background: #f7f7f7;
}

.gf-search-thumb {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 5px;
    background: var(--gf-s-tile);
}

.gf-search .gf-search-thumb img {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 4px;
    border-radius: 0;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.gf-search-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.gf-search-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gf-search .gf-search-name mark,
.gf-search .gf-search-meta mark {
    padding: 0;
    background: color-mix(in srgb, var(--e-global-color-cfa1f76, #f2d6d6) 75%, #fff);
    color: inherit;
}

.gf-search-meta {
    overflow: hidden;
    font-size: 12px;
    font-weight: 300;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gf-s-muted);
}

.gf-search-price {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gf-search-price del {
    margin-right: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--gf-s-muted);
}

.gf-search-price ins {
    text-decoration: none;
}

.gf-search-price.is-sale,
.gf-search-price.is-sale ins {
    color: var(--gf-s-brand);
}

.gf-search-from {
    font-size: 12px;
    font-weight: 400;
}

.gf-search .gf-search-option.gf-search-all {
    display: block;
    margin-top: 6px;
    padding: 13px 16px;
    border-top: 1px solid var(--gf-s-line);
    background: #fafafa;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--gf-s-brand);
}

.gf-search .gf-search-option.gf-search-all:is(:hover, [aria-selected="true"]) {
    background: var(--gf-s-tile);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gf-search .gf-search-status {
    margin: 0;
    padding: 18px 20px;
    font-size: 14px;
    color: var(--gf-s-muted);
}

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

@media (max-width: 767px) {
    .gf-search {
        --gf-s-height: 40px;
    }

    /* (16px: no zoom when tapped) */
    .gf-search .gf-search-form input.gf-search-input[data-gf-search-input] {
        font-size: 16px;
    }

    .gf-search .gf-search-panel {
        position: fixed;
        top: auto;
        right: 12px;
        left: 12px;
        width: auto;
        margin-top: 8px;
        max-height: calc(100dvh - 160px);
    }
}
