/* header-search.css — override theme conflicts & style header search */

/* ── Container ───────────────────────────────────────────── */
.header_middle_inner.header_middle_three .header_middle_search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
    margin: 0 auto;
    position: static;
}
.header_middle_inner.header_middle_three .header_middle_search .header-search__form {
    position: static !important;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.header-search {
    position: relative;
    width: 100%;
}

/* ── The pill-bar ────────────────────────────────────────── */
.header-search__bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15,23,42,.07);
    transition: border-color .15s, box-shadow .15s;
    height: 42px;
}
.header-search__bar:focus-within {
    border-color: #78a206;
    box-shadow: 0 0 0 3px rgba(120,162,6,.14);
}

/* ── Scope select ────────────────────────────────────────── */
.header-search__scope-wrap {
    flex: 0 0 auto;
    position: relative;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    min-width: 112px;
    max-width: 140px;
    height: 100%;
}
.header-search__scope,
.header-search__bar select.header-search__scope,
.header-search__form select.header-search__scope {
    display: block;
    width: 100% !important;
    min-width: 112px !important;
    max-width: 140px !important;
    height: 42px !important;
    line-height: 42px !important;
    border: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #374151 !important;
    -webkit-text-fill-color: #374151;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: inherit;
    padding: 0 28px 0 10px !important;
    margin: 0 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    text-indent: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.header-search__scope option {
    color: #111827 !important;
    background: #fff !important;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
}
.header-search__scope:focus {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937;
}
.header-search__scope-wrap::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -2px;
    border: 4px solid transparent;
    border-top-color: #6b7280;
    pointer-events: none;
    z-index: 2;
}

/* ── Text input — override all theme rules ───────────────── */
.header-search__bar input.header-search__input,
.header-search__bar input[type="text"].header-search__input,
.search_inner .header-search__bar input.header-search__input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    border-left: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 10px !important;
    font-size: 14px !important;
    color: #111827 !important;
    position: static !important;
}
.header-search__bar input.header-search__input::placeholder {
    color: #9ca3af !important;
}

/* ── Submit button — override theme absolute positioning ─── */
.header-search__bar button.header-search__submit,
.search_inner .header-search__bar button.header-search__submit,
.search_inner form button.header-search__submit {
    position: static !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    height: 100% !important;
    border: none !important;
    background: #78a206 !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 19px;
    padding: 0 !important;
    transition: background .15s;
}
.header-search__bar button.header-search__submit:hover {
    background: #6b9205 !important;
    color: #fff !important;
}
.header-search__bar button.header-search__submit i {
    line-height: 1;
}

/* ── Dropdown ────────────────────────────────────────────── */
.header-search__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15,23,42,.13);
    max-height: 400px;
    overflow-y: auto;
}
.header-search__dropdown.is-open { display: block; }

.header-search__dropdown .header-search__section {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}
.header-search__dropdown .header-search__section:last-child {
    border-bottom: none;
}

.header-search__dropdown .header-search__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 8px;
    font-family: inherit;
}

/* Keyword / category chips */
.header-search__dropdown .header-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.header-search__dropdown .header-search__chip {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 18px;
    background: #f3f4f6;
    color: #374151 !important;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background 0.12s ease, color 0.12s ease;
    max-width: 100%;
}
.header-search__dropdown .header-search__chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-search__dropdown .header-search__chip:hover {
    background: #e8f3c8;
    color: #4d6b04 !important;
}
.header-search__dropdown .header-search__chip i {
    flex-shrink: 0;
    font-size: 11px;
    color: #78a206;
}

/* Product suggestions list */
.header-search__dropdown .header-search__products {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-search__dropdown a.header-search__item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    color: #1f2937 !important;
    background: transparent;
    transition: background 0.12s ease;
    box-sizing: border-box;
}
.header-search__dropdown a.header-search__item:hover,
.header-search__dropdown a.header-search__item:focus {
    background: #f7fae8;
    color: #1f2937 !important;
}

.header-search__dropdown .header-search__item-media {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    line-height: 0;
}

.header-search__dropdown .header-search__item-thumb {
    display: block !important;
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.header-search__dropdown .header-search__item-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center;
    align-items: flex-start !important;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
    text-align: left !important;
}

.header-search__dropdown .header-search__item-title {
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    line-height: 1.35 !important;
    color: #111827 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-search__dropdown .header-search__item-meta {
    display: block !important;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.3;
    color: #78a206;
    margin: 0 !important;
    padding: 0 !important;
}

.header-search__empty,
.header-search__loading {
    padding: 16px 14px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 992px) {
    .header_middle_inner.header_middle_three .header_middle_search {
        max-width: 400px;
    }
    .header-search__scope-wrap {
        min-width: 96px;
        max-width: 118px;
    }
    .header-search__scope,
    .header-search__bar select.header-search__scope {
        min-width: 96px !important;
        max-width: 118px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 767px) {
    .header_middle_inner.header_middle_three .header_middle_search {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        margin: 6px 0;
    }
    .header-search__scope-wrap {
        min-width: 88px;
        max-width: 104px;
    }
    .header-search__scope,
    .header-search__bar select.header-search__scope {
        min-width: 88px !important;
        max-width: 104px !important;
        padding-left: 8px !important;
        font-size: 11px !important;
    }
    .header-search__bar input.header-search__input {
        font-size: 13px !important;
    }
}
