/* Unified quick-search widget — replaces header-widget.css + hero-widget.css.
   Renders as either an always-visible row of pills ("inline" — the homepage
   hero treatment) or a single trigger button that reveals the same pills in
   a popover ("popover" — the header treatment), chosen by the
   qsw-style-inline / qsw-style-popover class the [metis_finder_quicksearch]
   shortcode sets on the root element. Multiple independent instances can
   coexist on one page. */

.qsw-widget {
    font-family: 'Roboto', sans-serif;
}

.qsw-hidden {
    display: none !important;
}

/* ---- Inline style: pills always visible in a row ---- */
.qsw-widget.qsw-style-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

@media (max-width: 640px) {
    .qsw-widget.qsw-style-inline {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---- Popover style: one trigger button reveals the same pills ---- */
.qsw-widget.qsw-style-popover {
    display: inline-block;
    position: relative;
}

.qsw-trigger {
    background: #fff;
    color: rgb(107, 51, 53);
    border: none;
    border-radius: 3px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.qsw-trigger:hover {
    background: #f4e9e9;
}

.qsw-panel-wrap {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 999;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 12px 32px rgba(20, 10, 10, 0.28);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 280px;
}

/* ---- Fields: shared by both styles ---- */
.qsw-field {
    position: relative;
}

.qsw-field-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 22px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.qsw-style-popover .qsw-field-trigger {
    box-shadow: none;
}

.qsw-field-trigger:hover {
    border-color: rgb(145, 69, 71);
}

/* Selection is communicated by the trigger text changing to the picked
   value — the pill itself deliberately keeps the same size and color
   whether or not it has a selection, so the bar doesn't shift or recolor
   as fields are picked. */
.qsw-field-trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qsw-caret {
    font-size: 11px;
    opacity: 0.7;
    flex-shrink: 0;
}

.qsw-field-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 8px;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
}

.qsw-style-popover .qsw-field-panel {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
}

.qsw-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
}

.qsw-option:hover {
    background: #f5f0f0;
}

.qsw-option.qsw-selected {
    color: rgb(145, 69, 71);
    font-weight: 700;
}

.qsw-panel-message {
    padding: 9px 12px;
    font-size: 13.5px;
    color: #888;
    font-style: italic;
}

/* ---- Submit ---- */
.qsw-submit {
    background: #009391;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 26px;
    height: 46px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.qsw-style-popover .qsw-submit {
    width: 100%;
    box-shadow: none;
}

.qsw-submit:hover {
    background: #007c7a;
}

@media (max-width: 640px) {
    .qsw-style-inline .qsw-submit {
        width: 100%;
        padding: 14px;
        height: auto;
    }
}
