/* Instant search: panel under the header search field (instant-search.js), holding the fragment of
   InstantSearchController::suggestAction. Laid out like nicoll.fr: products on the left, the other sections
   stacked on the right. The fragment reuses the cards of the results page; the rules below only make
   them compact, and only inside the panel.
   Colour: --instant-search-color, set to the active colour by the customizeWebsite snippet when the site
   has one; otherwise the Aliaxis blue (--default-website-color, #32aaff). */

.instant-search-panel {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 1000;
    width: calc(100% - 2rem);
    max-width: 90rem;
    max-height: calc(100vh - 9rem);
    margin: 0 auto;
    padding: 1.75rem 2.5rem;
    overflow-y: auto;
    background-color: #fff;
    box-shadow: 0 2px 20px 0 rgba(0, 0, 0, .15);
    color: #333;
    text-align: left;
}

.instant-search-panel[hidden] {
    display: none;
}

@media (max-width: 991px) {
    .instant-search-panel {
        width: 100%;
        padding: 1rem;
    }
}

/* The header colours its links (--text-header-color): not the ones of the panel. */
.instant-search-panel a {
    color: inherit;
}

.instant-search-panel a:hover {
    text-decoration: none;
}

.instant-search-panel a:focus {
    outline: 2px solid var(--instant-search-color, var(--default-website-color));
    outline-offset: 2px;
}

.instant-search-panel__close {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 0;
    background-color: var(--instant-search-color, var(--default-website-color));
    color: #fff;
    cursor: pointer;
}

.instant-search-panel__loader {
    display: none;
    width: 2rem;
    height: 2rem;
    margin: .5rem auto;
    border-width: .25rem;
}

.instant-search-panel.is-loading .instant-search-panel__loader {
    display: block;
}

/* Two columns: products (wider), then the other sections. */
.instant-search {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
}

@media (max-width: 991px) {
    .instant-search {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

.instant-search__section + .instant-search__section {
    margin-top: 1.75rem;
}

.instant-search__header h4 {
    display: flex;
    align-items: center;
    margin: 0 0 .75rem;
    font-size: 1.25rem;
}

/* The ring before each section title. Its width plus its margin (1.75rem) is the indent of the
   section content, aligned on the title. */
.instant-search__header h4::before {
    content: "";
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-right: .75rem;
    border: .1875rem solid var(--instant-search-color, var(--default-website-color));
    border-radius: 50%;
}

.instant-search__empty {
    margin: 0 0 .75rem 1.75rem;
}

.instant-search-panel .instant-search__all {
    display: inline-flex;
    align-items: center;
    margin: .75rem 0 0 1.75rem;
    font-weight: 600;
}

.instant-search__all .material-icons {
    margin-left: .5rem;
    color: var(--instant-search-color, var(--default-website-color));
}

/* Rows: image on the left, label and title on the right. */
.instant-search .row {
    display: grid;
    gap: .75rem 1.5rem;
    margin: 0 0 0 1.75rem;
}

.instant-search [data-instant-search-section="products"] .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 575px) {
    .instant-search [data-instant-search-section="products"] .row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.instant-search .row > div {
    max-width: none;
    margin: 0;
    padding: 0;
}

.instant-search .card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    height: auto;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: none;
}

.instant-search .card__header {
    flex: 0 0 4.5rem;
    margin: 0 1rem 0 0;
    padding: 0;
    border: 1px solid #e9ecef;
}

/* Hovered thumbnail: the colour of the panel, not the generic dark grey of the cards (style.css),
   whose selector is repeated to win without !important. */
.instant-search .card:not(.card--company):not(.card--people):not(.card--category-type-2):not(.card--borderless):hover .card__header:not(.card__header--download),
.instant-search .card:not(.card--company):not(.card--people):not(.card--category-type-2):not(.card--borderless):hover .card__header:not(.card__header--download)::after {
    border-color: var(--instant-search-color, var(--default-website-color));
}

.instant-search .card__body {
    padding: 0;
}

.instant-search .card__label {
    margin: 0 0 .125rem;
    font-size: .875rem;
    font-weight: 400;
    color: #333;
}

.instant-search .card__title,
.instant-search .card__link {
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.25;
}

/* A news shows its category and title, as a document does: not its teaser nor its date. The label
   carries Bootstrap's d-flex, which wins without !important. */
.instant-search [data-instant-search-section="news"] .text--sm,
.instant-search [data-instant-search-section="news"] .card__label.text--xs {
    display: none !important;
}

/* A download (_download_suggest_item): one link holding the thumbnail and the texts, laid out as a
   product card. */
.instant-search .instant-search__download .card__link {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

/* Pages: the title only. */
.instant-search .result {
    margin: 0 0 .5rem 1.75rem;
}

.instant-search .result > div {
    padding: 0;
}

.instant-search .result a {
    font-weight: 600;
}

.instant-search .result p,
.instant-search .result br,
.instant-search .result a ~ a,
.instant-search [data-instant-search-section="pages"] hr {
    display: none;
}

/* Centred search field of the top bar (secondary_navigation.html.twig), shown on desktop only: the bar
   itself is hidden under 992px (qw.css), where the header search icon remains. At rest a frosted glass pill:
   translucent white blurring what is behind it, a thin border in the header text colour (--text-header-color,
   as the bar's links), with a light sheen sweeping it now and then, readable on a white header as on a picture;
   white with a thin border in the site colour once focused or filled, no shadow. Centred with insets
   and auto margins, not a transform: a transform would make the fixed panel inside relative to it. */
.instant-search-centered {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: min(30rem, 44%);
    height: 2.25rem;
    margin: auto;
    transition: height .2s ease-in-out;
}

/* Same size once the page is scrolled: the top bar shrinks to 2rem (qw.css), the field slightly overflows it. */

/* The top bar (z-index 71) sits under the main header bar (75): its panel would open behind the main
   menu. The bar comes to the front while a panel is open (instant-search.js toggles the body class). */
body.instant-search-open .site-header__secondary-menu {
    z-index: 1001;
}

.instant-search-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    height: 100%;
    margin: 0;
    padding: 0 .25rem 0 1rem;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 12px rgba(0, 0, 0, .05);
    color: var(--text-header-color, #fff);
    cursor: text;
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    transition: background-color .35s, border-color .35s, color .35s, box-shadow .35s;
}

/* The sheen sweeping the pill at rest. */
.instant-search-pill::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .9) 48%, transparent 66%) -120% 0 / 60% 100% no-repeat;
    pointer-events: none;
    animation: instant-search-sheen 7s ease-in-out 1.2s infinite;
}

@keyframes instant-search-sheen {
    0%, 70% {
        background-position: -120% 0;
    }

    100% {
        background-position: 260% 0;
    }
}

.instant-search-pill:hover {
    border-color: color-mix(in srgb, currentColor 45%, transparent);
    background-color: rgba(255, 255, 255, .75);
}

.instant-search-pill:focus-within,
.instant-search-pill.has-value {
    border-color: var(--instant-search-color, var(--default-website-color));
    background-color: #fff;
    box-shadow: none;
    color: var(--text-website-color);
}

.instant-search-pill:focus-within::after,
.instant-search-pill.has-value::after {
    animation: none;
    opacity: 0;
}

/* Light header text (instant-search.js adds --light-header): the header bar is dark, a solid site colour or
   a picture (aliaxis.de). White text on a hint of white is too faint there: a plain white field at rest,
   as when focused. Dark header text (white bar, nicoll-be) keeps the glass above. */
.instant-search-pill--light-header:not(:focus-within):not(.has-value) {
    border-color: transparent;
    background-color: #fff;
    box-shadow: none;
    color: var(--text-website-color);
}

.instant-search-pill--light-header:not(:focus-within):not(.has-value)::after {
    opacity: 0;
}

.instant-search-pill--light-header:not(:focus-within):not(.has-value) .instant-search-pill__input::placeholder {
    color: var(--gray);
}

/* Over the picture, before scrolling (the bar then turns to a solid colour, --shrink): only a hint of white,
   the blur doing the rest, the sheen back and a soft shadow under the text for the brightest pictures. */
.site-header.bg--image-overlay .site-header__secondary-menu:not(.site-header__secondary-menu--shrink) .instant-search-pill--light-header:not(:focus-within):not(.has-value) {
    border-color: color-mix(in srgb, currentColor 22%, transparent);
    background-color: rgba(255, 255, 255, .16);
    color: var(--text-header-color, #fff);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.site-header.bg--image-overlay .site-header__secondary-menu:not(.site-header__secondary-menu--shrink) .instant-search-pill--light-header:not(:focus-within):not(.has-value):hover {
    background-color: rgba(255, 255, 255, .28);
}

.site-header.bg--image-overlay .site-header__secondary-menu:not(.site-header__secondary-menu--shrink) .instant-search-pill--light-header:not(:focus-within):not(.has-value)::after {
    opacity: 1;
}

.site-header.bg--image-overlay .site-header__secondary-menu:not(.site-header__secondary-menu--shrink) .instant-search-pill--light-header:not(:focus-within):not(.has-value) .instant-search-pill__input::placeholder {
    color: color-mix(in srgb, currentColor 75%, transparent);
}

/* The white field fits the 2rem bar once scrolled, instead of overflowing it. */
.site-header__secondary-menu--shrink .instant-search-centered:has(.instant-search-pill--light-header) {
    height: 1.625rem;
}

@media (prefers-reduced-motion: reduce) {
    .instant-search-pill::after {
        animation: none;
    }
}

/* In the site colour even at rest: the one touch of the site identity on the neutral pill. */
.instant-search-pill__icon {
    flex: none;
    color: var(--instant-search-color, var(--default-website-color));
    font-size: 1.25rem;
}

.instant-search-pill__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
}

.instant-search-pill__input::placeholder {
    color: color-mix(in srgb, currentColor 75%, transparent);
    font-weight: 400;
}

.instant-search-pill:focus-within .instant-search-pill__input::placeholder,
.instant-search-pill.has-value .instant-search-pill__input::placeholder {
    color: var(--gray);
}

/* The pill has its own clear button. */
.instant-search-pill__input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
}

.instant-search-pill__clear,
.instant-search-pill__submit {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
}

.instant-search-pill__clear {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-website-color);
}

.instant-search-pill__clear .material-icons {
    font-size: 1rem;
}

.instant-search-pill__submit {
    height: calc(100% - .5rem);
    padding: 0 1rem;
    border-radius: 999px;
    background-color: var(--instant-search-color, var(--default-website-color));
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
}

.instant-search-pill.has-value .instant-search-pill__clear,
.instant-search-pill:focus-within .instant-search-pill__submit,
.instant-search-pill.has-value .instant-search-pill__submit {
    display: inline-flex;
}

/* Shortcuts of the site under the centred field, while it is focused and empty (snippet "Instant Search
   Shortcuts", instant-search.js). A bit wider than the field so the chips breathe; same white box and
   shadow as the results panel. Colours only from the site variables: the active colour of the
   customizeWebsite snippet (Aliaxis blue by default) on the chips and rings, its text colour and greys
   for the rest. */
.instant-search-shortcuts {
    position: absolute;
    top: calc(100% + .5rem);
    left: 50%;
    z-index: 1000;
    width: max(100%, 34rem);
    padding: 1.25rem 1.5rem 1rem;
    background-color: #fff;
    box-shadow: 0 2px 20px 0 rgba(0, 0, 0, .15);
    color: var(--text-website-color);
    text-align: left;
    transform: translateX(-50%);
}

.instant-search-shortcuts[hidden] {
    display: none;
}

.instant-search-shortcuts__group + .instant-search-shortcuts__group {
    margin-top: 1.25rem;
}

.instant-search-shortcuts__title {
    margin: 0 0 .75rem;
    color: var(--gray);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.instant-search-shortcuts .instant-search-shortcuts__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.instant-search-shortcuts .instant-search-shortcuts__chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .9rem;
    border: 1px solid var(--instant-search-color, var(--default-website-color));
    border-radius: 999px;
    background-color: #fff;
    color: var(--text-website-color);
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background-color .2s, border-color .2s, color .2s;
}

.instant-search-shortcuts .instant-search-shortcuts__chip img {
    flex: none;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.instant-search-shortcuts .instant-search-shortcuts__chip:hover,
.instant-search-shortcuts .instant-search-shortcuts__chip:focus {
    border-color: var(--instant-search-color, var(--default-website-color));
    background-color: var(--instant-search-color, var(--default-website-color));
    color: #fff;
    text-decoration: none;
}

.instant-search-shortcuts .instant-search-shortcuts__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
}

.instant-search-shortcuts .instant-search-shortcuts__link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--gray2);
    color: var(--text-website-color);
    font-size: .95rem;
    font-weight: 600;
}

.instant-search-shortcuts .instant-search-shortcuts__link:hover,
.instant-search-shortcuts .instant-search-shortcuts__link:focus {
    color: var(--instant-search-color, var(--default-website-color));
    text-decoration: none;
}

.instant-search-shortcuts__ring {
    flex: none;
    width: .75rem;
    height: .75rem;
    border: 2.5px solid var(--instant-search-color, var(--default-website-color));
    border-radius: 50%;
}
