/* Header product search — see inc/header-search.php */

.jb-hsearch {
    --jb-hs-pink: #EF4E8D;
    --jb-hs-ink: #1C274C;
    --jb-hs-fill: #F3F4F6;
    --jb-hs-line: #E5E7EB;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.jb-hsearch svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Reset theme button/input styles inside the component */
.jb-hsearch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.jb-hsearch .jb-hs-input,
.jb-hsearch .jb-hs-input:focus {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 6px 0 20px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #181818;
    font-family: inherit;
    font-size: 15px;
    -webkit-appearance: none;
    appearance: none;
}
.jb-hsearch .jb-hs-input::placeholder {
    color: #8A8F98;
    opacity: 1;
}
.jb-hsearch .jb-hs-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* The bar */
.jb-hs-form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 5px 0 0;
    border: 1px solid var(--jb-hs-line);
    border-radius: 999px;
    background: var(--jb-hs-fill);
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.jb-hs-form:focus-within {
    border-color: var(--jb-hs-pink);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(239, 78, 141, .14);
}

.jb-hsearch .jb-hs-submit {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--jb-hs-pink);
    color: #fff;
    transition: background-color .2s, transform .2s;
}
.jb-hsearch .jb-hs-submit:hover,
.jb-hsearch .jb-hs-submit:focus-visible {
    background: #D93A78;
    color: #fff;
}
.jb-hsearch .jb-hs-submit svg {
    width: 18px;
    height: 18px;
}

.jb-hsearch .jb-hs-toggle,
.jb-hsearch .jb-hs-close {
    display: none;
}
.jb-hsearch button:focus-visible {
    outline: 2px solid var(--jb-hs-pink);
    outline-offset: 2px;
}

/* Phones and small tablets: a round button that stretches into a field */
@media (max-width: 1024px) {
    .jb-hsearch {
        width: auto;
    }
    .jb-hsearch .jb-hs-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: var(--jb-hs-fill);
        color: var(--jb-hs-ink);
    }
    .jb-hsearch .jb-hs-toggle:hover {
        background: #E9EBEF;
        color: var(--jb-hs-ink);
    }

    .jb-hs-form {
        position: absolute;
        top: 50%;
        right: 0;
        z-index: 50;
        width: 42px;
        height: 46px;
        padding: 0;
        border-color: transparent;
        background: #fff;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-50%);
        transition: width .3s ease, right .3s ease, opacity .15s ease, visibility 0s linear .3s, padding .3s ease;
    }
    .jb-hsearch.is-open .jb-hs-form {
        right: var(--jb-hs-open-right, 0);
        width: var(--jb-hs-open-w, calc(100vw - 32px));
        padding: 0 4px 0 0;
        border-color: var(--jb-hs-pink);
        box-shadow: 0 6px 24px rgba(28, 39, 76, .14);
        opacity: 1;
        visibility: visible;
        transition: width .3s ease, right .3s ease, opacity .15s ease, visibility 0s, padding .3s ease;
    }
    .jb-hsearch .jb-hs-input,
    .jb-hsearch .jb-hs-input:focus {
        padding-left: 18px;
        font-size: 16px; /* 16px stops iOS zooming in on focus */
    }
    .jb-hsearch .jb-hs-close {
        display: inline-flex;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: transparent;
        color: #6B7280;
    }
    .jb-hsearch .jb-hs-close:hover {
        background: var(--jb-hs-fill);
        color: var(--jb-hs-ink);
    }
    .jb-hsearch .jb-hs-submit {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jb-hs-form,
    .jb-hsearch.is-open .jb-hs-form,
    .jb-hsearch .jb-hs-submit {
        transition: none;
    }
}

/* Elementor widget wrapper in Header 4 */
@media (min-width: 1025px) {
    .elementor .e-con > .elementor-widget.jb-hsearch-widget {
        flex: 1 1 auto;
        width: auto;
        min-width: 260px;
        max-width: 480px;
        margin-left: auto;
    }
    /* Wishlist + cart icons: size to their content instead of a fixed 163px */
    .elementor .e-con > .elementor-widget.elementor-element-db29fae {
        width: auto !important;
    }
}
@media (max-width: 1024px) {
    .elementor-widget.jb-hsearch-widget {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }
}
