/*
 * DrugQuest header-search autocomplete popup — extracted from the legacy style.css
 * so the cover_form_result dropdown looks/behaves the same on the Tabler layout.
 * Colors are inlined (legacy CSS vars are not loaded here).
 *   pink = #ee645b   purple = #9c5984
 */

/* Anchor the dropdown to the search form row. */
.dq-tb-search-form { position: relative; }

/* Category-pills search bar (replaces the dropdown) */
.dq-tb-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 8px;
    padding: 5px 6px 5px 5px;
    min-height: 50px;
    flex-wrap: nowrap;          /* keep the whole bar on one line */
}
.dq-tb-search-ico { display: inline-flex; color: #9aa3b2; flex: 0 0 auto; margin-inline-start: 6px; }
.dq-tb-search-ico svg { width: 18px; height: 18px; }
/* Owner review 2026-08: all search-bar text at 16px */
.dq-tb-search-label { color: #57607a; font-size: 16px; white-space: nowrap; flex: 0 0 auto; cursor: default; user-select: none; }
/* Native category dropdown — hidden on desktop (pills are used instead) */
.dq-tb-sb-select { display: none; }
.dq-tb-cats-main { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: nowrap; }
.dq-tb-cats { display: none; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: nowrap; }
.dq-tb-cats.dq-cats-open { display: flex; }
.dq-tb-compact .dq-tb-cats-main { display: none !important; }
/* Separator between the category pills and the input */
.dq-tb-search-sep { width: 1px; height: 26px; background: #d7dae0; flex: 0 0 auto; margin: 0 4px; }
/* Pink search button living inside the field (left end) */
.dq-tb-search-go {
    flex: 0 0 auto;
    background: #ee645b;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 50px;
    /* Owner PDF 2026-08: font must match the legacy .btn (16px bold) so the
       search button and content buttons (e.g. gratitude "חזרה") are identical. */
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.dq-tb-search-go:hover { background: #e0504a; }
/* Phones: halve the button's side padding so it doesn't crowd the input */
@media (max-width: 575px) {
    .dq-tb-search-go { padding: 9px 25px; }
}
/* Clinical-field select swaps in for the input on the clinical category — fixed height so the bar doesn't grow */
.dq-tb-searchbar select.dq-tb-clinical {
    flex: 1 1 120px;
    min-width: 120px;
    height: 32px;
    align-self: center;
    border: 1px solid #d7dae0;
    border-radius: 6px;
    padding: 0 8px;
    font: inherit;
    color: #3a4256;
    background: #fff;
}
.dq-tb-cat {
    border: 1px solid #d7dae0;
    background: #fff;
    color: #3a4256;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: .15s;
}
.dq-tb-cat:hover { border-color: #9c5984; color: #9c5984; }
.dq-tb-cat.active { background: #9c5984; border-color: #9c5984; color: #fff; }
.dq-tb-cat-more { font-weight: 700; padding: 4px 11px; }
.dq-tb-search-input {
    border: 0; outline: 0;
    flex: 1 1 160px;
    min-width: 160px;       /* when the input would shrink below this, JS switches to compact */
    font: inherit;
    font-size: 16px;        /* owner review 2026-08: search-bar text at 16px */
    background: transparent;
    padding: 4px 6px;
}
.dq-tb-search-input::placeholder { color: #9aa3b2; }

.cover_form_result {
    width: 100%;
    position: absolute;
    top: 100%;
    margin-top: 8px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 300px);
    background-color: #fff;
    box-shadow: 0 5px 13px rgba(32, 119, 221, 0.3);
    border-radius: 6px;
    padding: 20px;
    overflow-y: auto;
    display: none;
    z-index: 10001;
    scrollbar-width: thin;
    text-align: start;
}
.cover_form_result.active { display: block; }

.cover_form_result p { margin-bottom: 5px; }

.cover_form_result a {
    margin-bottom: 5px;
    white-space: nowrap;
    display: block;
    color: #222;
    text-decoration: none;
    transition: .3s;
}
.cover_form_result a:hover { color: #9c5984; text-decoration: underline; }

.cover_form_result .title {
    margin-bottom: 10px;
    color: #ee645b;
    font-size: .9em;
}

.cover_form_line { width: 100%; height: 1px; background-color: #CDCED4; margin: 20px auto; }

.cover_form_result .all_results {
    color: #999CB2;
    font-size: .9em;
    transition: .3s;
    text-decoration: underline;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.cover_form_result .all_results:hover { color: #9c5984; }

.cover_form_result .close {
    position: absolute;
    top: 18px;
    inset-inline-end: 18px;
    transition: .3s;
    cursor: pointer;
}
.cover_form_result .close:hover svg { fill: #9c5984; }

/* Indication tree inside the results dropdown */
#header_search .searchResult .indication_group { margin: 0 0 18px 0; }
#header_search .searchResult .indication_parent {
    color: #222;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin: 0 0 8px 0;
}
#header_search .searchResult .indication_children { display: block; padding-inline-start: 12px; }
#header_search .searchResult .indication_children a {
    color: #323232;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    display: block;
    padding: 2px 0 12px 0;
}
#header_search .searchResult .all_indications_group {
    color: #81849A;
    font-size: 14px;
    text-decoration: underline;
    text-transform: uppercase;
    display: block;
    margin-top: 6px;
}

/* Pink search button to match the legacy cover search */
.dq-tb-search-btn { background-color: #ee645b; border-color: #ee645b; color: #fff; }
.dq-tb-search-btn:hover { background-color: #e0504a; border-color: #e0504a; color: #fff; }

/* ---- Compact mode — CSS below 1024px, JS class above 1024px ---- */
.dq-tb-compact .dq-tb-search-label,
.dq-tb-compact .dq-tb-search-sep { display: none !important; }
.dq-tb-compact .dq-tb-cats-main { display: none !important; }
.dq-tb-compact .dq-tb-sb-select {
    display: block;
    flex: 0 1 auto;
    width: auto;
    min-width: 84px;
    max-width: 210px;
    height: 34px;
    border: 1px solid #d7dae0;
    border-radius: 6px;
    padding: 0 8px;
    font: inherit;
    color: #3a4256;
    background: #fff;
}
.dq-tb-compact .dq-tb-search-input { flex: 1 1 80px; min-width: 64px; }
.dq-tb-compact select.dq-tb-clinical { min-width: 84px; }

@media (max-width: 1023px) {
    .dq-tb-cats-main { display: none !important; }
    .dq-tb-search-label { display: none !important; }
    .dq-tb-search-sep { display: none !important; }
    .dq-tb-sb-select {
        display: block !important;
        flex: 0 1 auto;
        width: auto;
        min-width: 84px;
        max-width: 210px;
        height: 34px;
        border: 1px solid #d7dae0;
        border-radius: 6px;
        padding: 0 8px;
        font: inherit;
        color: #3a4256;
        background: #fff;
    }
    .dq-tb-search-input { flex: 1 1 80px; min-width: 64px; }
}
