/*
 * Widget: HawkSearch Search
 * Mirrors header-search.css for the expansion behaviour.
 */

/* --- Expansion trick --- */

/* Direct child of .open-search becomes the containing block for the fixed input. */
@media (min-width: 1024px) {
    .open-search > * {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
}

/* Release the form's own transform so the fixed input escapes to the widget bounds. */
.open-search .elementor-widget-hawksearch-search .search-form {
    -webkit-transform: none;
    transform: none;
}

/* Push the expanded input clear of the logo/nav. */
@media (min-width: 1024px) {
    .open-search .elementor-widget-hawksearch-search [type="search"] {
        left: 200px;
    }
}
@media (min-width: 1200px) {
    .open-search .elementor-widget-hawksearch-search [type="search"] {
        left: 350px;
    }
}

/* Extra right padding when open to keep text clear of the category + button. */
.open-search .elementor-widget-hawksearch-search [type="search"] {
    padding-right: 150px;
}

/* --- Base form styles --- */

.elementor-widget-hawksearch-search .search-form {
    position: relative;
    width: 100%;
    height: 36px;
    overflow: hidden;    /* clip category select to form bounds on all browsers */
    -webkit-transform: translate(0, 0);
    transform: translate(0, 0);
}

/* Input: fixed so it can expand across the full header width on open. */
.elementor-widget-hawksearch-search [type="search"] {
    height: 34px;
    padding: 8px 50px 8px 24px;
    background: #fff;
    border-radius: 5px;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #8b8b8b;
    position: fixed;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    left: 0;
    right: 0;
    width: auto;
    -webkit-transition: 0s;
    transition: 0s;
    box-sizing: border-box;
}

.elementor-widget-hawksearch-search [type="search"]::placeholder {
    color: #8b8b8b;
}

/* --- Search button ---
   Named .hs-search-btn (not .btn) to avoid the global
   .elementor .btn / .elementor .btn:hover rules in style.css which
   override background shorthand and cause the icon to shift on hover. */
.elementor-widget-hawksearch-search .hs-search-btn {
    position: absolute;
    width: 40px;
    height: 36px;
    top: 0;
    right: 0;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    background-image: url("../images/search-gray.svg");
    background-size: 16px;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    font-size: 0;
    border-radius: 0;
    -webkit-transition: none;
    transition: none;
}

.elementor-widget-hawksearch-search .hs-search-btn:hover {
    background-color: transparent;
    background-image: url("../images/search.svg");
    background-size: 16px;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}

/* --- Category dropdown ---
   Hidden until the bar is open. Sits to the left of the search button,
   inside the right edge of the expanded input. */
.elementor-widget-hawksearch-search .hs-category {
    display: none;
    position: absolute;
    top: 1px;            /* 1px inset so it doesn't overflow the 35px form */
    bottom: 1px;
    right: 40px;         /* flush against the left edge of .hs-search-btn */
    width: auto;
    max-width: 130px;
    padding: 0 22px 0 10px;
    border: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b8b8b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px 5px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    z-index: 99999;      /* above the position:fixed input */
}

/* Show the category selector when the bar is expanded. */
.open-search .elementor-widget-hawksearch-search .hs-category {
    display: block;
}

/* --- Autocomplete dropdown --- */

.hs-autocomplete {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    overflow: hidden;
    /* top / left / right set by JS */
}

.hs-autocomplete.is-visible {
    display: block;
}

.hs-autocomplete__list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.hs-autocomplete__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    -webkit-transition: background 0.1s;
    transition: background 0.1s;
}

.hs-autocomplete__list li:hover,
.hs-autocomplete__list li.is-active {
    background: #f5f5f5;
}

.hs-autocomplete__list svg {
    flex-shrink: 0;
    color: #999;
}

.hs-autocomplete__match {
    font-weight: 600;
}
