/*
 * Header Search — persistent Suvenirche product search.
 *
 * The desktop Header uses a custom visible product-search form rendered through
 * Blocksy's HTML slot. Keep all styling for that one search component here.
 */

.suvenirche-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    overflow: visible;
}

.suvenirche-header-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: clamp(230px, 17vw, 290px);
    max-width: 100%;
    margin: 0;
    color: var(--suvi-navy);
}

.suvenirche-header-search-input {
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 16px 0 44px !important;
    border: 1px solid var(--suvi-border-soft) !important;
    border-radius: 999px !important;
    background: var(--suvi-surface) !important;
    color: var(--suvi-navy) !important;
    font: inherit !important;
    font-size: 14px !important;
    line-height: 1 !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.suvenirche-header-search-input::placeholder {
    color: rgba(83, 98, 122, 0.78);
    opacity: 1;
}

.suvenirche-header-search-input:focus {
    border-color: rgba(46, 204, 182, 0.72) !important;
    box-shadow: 0 0 0 3px rgba(46, 204, 182, 0.12) !important;
}

/* Draw the search glyph on the form so theme button styles cannot override it. */
.suvenirche-header-search-form::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 15px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    transform: translateY(-58%);
    pointer-events: none;
}

.suvenirche-header-search-form::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 27px;
    top: calc(50% + 5px);
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
    pointer-events: none;
}

.suvenirche-header-search-form:focus-within {
    color: var(--suvi-pink);
}

/* Invisible submit hit area over the glyph; Enter in the field submits too. */
.suvenirche-header-search-button {
    position: absolute !important;
    z-index: 3;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: transparent !important;
    box-shadow: none !important;
    font-size: 0 !important;
    appearance: none !important;
    cursor: pointer;
}

.suvenirche-header-search-button::before,
.suvenirche-header-search-button::after {
    content: none !important;
    display: none !important;
}

.suvenirche-header-search-button:focus-visible {
    outline: 2px solid rgba(46, 204, 182, 0.72) !important;
    outline-offset: -3px;
}

/* Compact WPML selector directly after the persistent desktop search. */
.suvenirche-header-language-switcher {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    position: relative;
    overflow: visible !important;
}

.suvenirche-header-language-switcher .wpml-ls,
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown,
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown > ul,
.suvenirche-header-language-switcher .wpml-ls-current-language {
    width: 44px !important;
    max-width: 44px !important;
    overflow: visible !important;
}

.suvenirche-header-language-switcher .wpml-ls-current-language {
    position: relative;
}

.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown a {
    min-height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 7px;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

/* The flag itself is the dropdown control; no separate arrow is shown. */
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown a.wpml-ls-item-toggle {
    justify-content: center;
    padding: 0 7px !important;
}

.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown a.wpml-ls-item-toggle::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
}

.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown a:hover,
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown a:focus-visible {
    background: rgba(11, 45, 107, 0.05) !important;
}

/* Start the submenu exactly at the bottom edge of the current item. The top
 * padding creates visual separation while remaining part of the hover target,
 * so the menu cannot disappear while the pointer moves to the next flag. */
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown .wpml-ls-sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    z-index: 9999 !important;
    width: 44px !important;
    min-width: 44px !important;
    margin: 0 !important;
    padding: 4px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.suvenirche-header-language-switcher .wpml-ls-current-language:focus-within > .wpml-ls-sub-menu,
.suvenirche-header-language-switcher .wpml-ls-current-language:hover > .wpml-ls-sub-menu {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown .wpml-ls-sub-menu a {
    min-height: 42px;
    justify-content: center;
    padding: 0 7px !important;
    border-radius: 999px !important;
    background: var(--suvi-surface) !important;
    box-shadow: 0 8px 20px rgba(11, 45, 107, 0.12) !important;
}

.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown .wpml-ls-sub-menu a:hover,
.suvenirche-header-language-switcher .wpml-ls-legacy-dropdown .wpml-ls-sub-menu a:focus-visible {
    background: var(--suvi-surface-soft) !important;
}

@media (max-width: 1180px) {
    .suvenirche-header-search-form {
        width: 220px;
    }
}

/* Mobile Blocksy search modal — keep live results visible above the keyboard. */
@media (max-width: 689px) {
    #search-modal .ct-panel-content {
        justify-content: flex-start !important;
        padding-top: clamp(30px, 5vh, 45px) !important;
    }
}