/* F4Y Bundle-Aware Search v1.2.0
 * Compact header/autocomplete UI. Deliberately specific/important so the
 * custom theme's global typography cannot enlarge the dropdown.
 */

form.f4y-product-search-form.woocommerce-product-search,
form.f4y-product-search-form {
    position: relative !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 290px !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .12) !important;
    font-family: inherit !important;
    line-height: 1.2 !important;
}

form.f4y-product-search-form .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

form.f4y-product-search-form input.f4y-product-search-field,
form.f4y-product-search-form input.search-field {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #555 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    outline: none !important;
}

form.f4y-product-search-form input.f4y-product-search-field:focus,
form.f4y-product-search-form input.search-field:focus {
    border-color: #cfcfcf !important;
    box-shadow: none !important;
}

form.f4y-product-search-form input.f4y-product-search-field::placeholder,
form.f4y-product-search-form input.search-field::placeholder {
    color: #8b8b8b !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

form.f4y-product-search-form button[type="submit"] {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 58px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    border: 1px solid #bcbcbc !important;
    border-radius: 0 !important;
    background: #f6f6f6 !important;
    color: #111 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 36px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

form.f4y-product-search-form button[type="submit"]:hover,
form.f4y-product-search-form button[type="submit"]:focus {
    background: #ececec !important;
    color: #111 !important;
}

form.f4y-product-search-form .f4y-search-suggestions {
    box-sizing: border-box !important;
    position: absolute !important;
    z-index: 9999999 !important;
    top: calc(100% + 4px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-height: 390px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff !important;
    border: 1px solid #dedede !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .14) !important;
    text-align: left !important;
    font-family: inherit !important;
}

form.f4y-product-search-form .f4y-search-suggestions[hidden] {
    display: none !important;
}

form.f4y-product-search-form a.f4y-search-item {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    min-height: 60px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #ededed !important;
    border-radius: 0 !important;
    color: #222 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

form.f4y-product-search-form a.f4y-search-item:hover,
form.f4y-product-search-form a.f4y-search-item:focus {
    background: #f7f7f7 !important;
    color: #222 !important;
    text-decoration: none !important;
}

form.f4y-product-search-form .f4y-search-thumb {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 0 !important;
}

form.f4y-product-search-form .f4y-search-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
}

form.f4y-product-search-form .f4y-search-copy {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-direction: column !important;
    gap: 2px !important;
    text-align: left !important;
}

form.f4y-product-search-form .f4y-search-title {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #222 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    overflow-wrap: anywhere !important;
}

form.f4y-product-search-form .f4y-search-meta {
    display: block !important;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    color: #6f6f6f !important;
    opacity: 1 !important;
    font-family: inherit !important;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    overflow-wrap: anywhere !important;
}

form.f4y-product-search-form .f4y-search-empty,
form.f4y-product-search-form a.f4y-search-view-all {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    background: #fff !important;
    color: #222 !important;
    border: 0 !important;
    text-decoration: none !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

form.f4y-product-search-form a.f4y-search-view-all {
    border-top: 1px solid #ededed !important;
    background: #fafafa !important;
}

form.f4y-product-search-form a.f4y-search-view-all:hover,
form.f4y-product-search-form a.f4y-search-view-all:focus {
    background: #f3f3f3 !important;
}

/* Keep the narrow scrollbar unobtrusive. */
form.f4y-product-search-form .f4y-search-suggestions {
    scrollbar-width: thin;
}

form.f4y-product-search-form .f4y-search-suggestions::-webkit-scrollbar {
    width: 6px;
}

form.f4y-product-search-form .f4y-search-suggestions::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 6px;
}

/* Mobile: use most of the viewport, but keep the same compact typography. */
@media (max-width: 767px) {
    form.f4y-product-search-form.woocommerce-product-search,
    form.f4y-product-search-form {
        width: min(320px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        padding: 8px !important;
        gap: 6px !important;
    }

    form.f4y-product-search-form input.f4y-product-search-field,
    form.f4y-product-search-form input.search-field {
        height: 36px !important;
        min-height: 36px !important;
        padding: 6px 9px !important;
        font-size: 13px !important;
        line-height: 22px !important;
    }

    form.f4y-product-search-form button[type="submit"] {
        min-width: 54px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 9px !important;
        font-size: 12px !important;
        line-height: 34px !important;
    }

    form.f4y-product-search-form .f4y-search-suggestions {
        left: 8px !important;
        right: 8px !important;
        max-height: min(360px, 62vh) !important;
    }

    form.f4y-product-search-form a.f4y-search-item {
        min-height: 56px !important;
        gap: 8px !important;
        padding: 7px 8px !important;
    }

    form.f4y-product-search-form .f4y-search-thumb {
        flex-basis: 38px !important;
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    form.f4y-product-search-form .f4y-search-thumb img {
        max-width: 38px !important;
        max-height: 38px !important;
    }

    form.f4y-product-search-form .f4y-search-title {
        font-size: 12.5px !important;
        line-height: 1.22 !important;
    }

    form.f4y-product-search-form .f4y-search-meta {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
}
