/* =========================================================
   SEARCH (searchEmega.isml)
   Component-only styling
========================================================= */

/* wrapper support for search include */
.emega-header-zone--search .search,
.emega-header-zone--search .emega-header-search,
.emega-header-zone--search .site-search {
    width: 100% !important;
    overflow: visible !important;
}

/* site-search shell */
.emega-header-zone--search .site-search {
    position: static !important;
    width: 100% !important;
    overflow: visible !important;
}

/* form */
.emega-header-zone--search .site-search form {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    border: 2px solid var(--skin-primary-color-1, #e31c25);
    border-radius: 4px;
    overflow: visible !important;
    box-sizing: border-box;
}

/* focus */
.emega-header-zone--search .site-search form:focus-within {
    border-color: var(--skin-primary-color-1, #e31c25);
    box-shadow: 0 0 0 2px rgba(227, 28, 37, 0.25);
}

/* buttons */
.emega-header-zone--search .site-search form button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    flex-shrink: 0 !important;
}

/* input */
.emega-header-zone--search .site-search .search-field {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 2px 0 0 2px;
    font-size: 16px;
    line-height: 40px;
    color: #111;
    background: #fff;
    overflow: hidden !important;
    -webkit-appearance: none;
    appearance: none;
}

/* reset button */
.emega-header-zone--search .site-search .reset-button {
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #999 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.emega-header-zone--search .site-search .reset-button.d-none {
    display: none !important;
}

/* submit */
.emega-header-zone--search .site-search button[name="search-button"] {
    flex: 0 0 52px !important;
    width: 52px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 2px 2px 0;
    background: var(--skin-primary-color-1, #e31c25) !important;
    color: #fff !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 1 !important;
    transition: filter 0.15s ease;
}

.emega-header-zone--search .site-search button[name="search-button"]:hover {
    filter: brightness(0.9);
}

/* suggestions */
.emega-header-zone--search .site-search form .suggestions-wrapper {
    position: absolute !important;
    left: -2px !important;
    right: -2px !important;
    top: calc(100% + 2px) !important;
    z-index: 99999 !important;
    overflow: visible !important;
    width: auto !important;
}

.emega-header-zone--search .site-search form .suggestions-wrapper .suggestions {
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #d5d9d9 !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14) !important;
    overflow: hidden !important;
    margin-top: -2px !important;
}

/* Sticky state — triggered by JS class */
.emega-header-mobile--sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* =========================================================
   Mobile visual override for search component only
========================================================= */

@media (max-width: 768px) {
    .emega-header-zone--search .site-search form {
        height: 48px !important;
        padding: 0 10px 0 0 !important;
        background: #fff !important;
        border: 1.5px solid #8d8d8d !important;
        border-radius: 24px !important;
        overflow: visible !important;
        box-shadow: none !important;
    }

    .emega-header-zone--search .site-search form:focus-within {
        border-color: #8d8d8d !important;
        box-shadow: none !important;
    }

    .emega-header-zone--search .site-search .search-field {
        height: 44px !important;
        padding: 0 12px 0 14px !important;
        background: transparent !important;
        border-radius: 24px 0 0 24px !important;
        color: #111 !important;
        font-size: 16px !important;
        line-height: 44px !important;
    }

    .emega-header-zone--search .site-search .search-field::placeholder {
        color: #555 !important;
        opacity: 1 !important;
    }

    .emega-header-zone--search .site-search .reset-button,
    .emega-header-zone--search .site-search .reset-button.d-none {
        display: none !important;
    }

    .emega-header-zone--search .site-search button[name="search-button"],
    .emega-header-zone--search .site-search button[name="search-button"].fa,
    .emega-header-zone--search
        .site-search
        button[name="search-button"].fa-search {
        flex: 0 0 36px !important;
        width: 36px !important;
        height: 36px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        color: var(--skin-primary-color-1, #e31c25) !important;
        font-size: 20px !important;
        line-height: 1 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .emega-header-zone--search
        .site-search
        button[name="search-button"]::before,
    .emega-header-zone--search
        .site-search
        button[name="search-button"].fa::before,
    .emega-header-zone--search
        .site-search
        button[name="search-button"].fa-search::before {
        color: var(--skin-primary-color-1, #e31c25) !important;
    }

    .emega-header-zone--search .site-search button[name="search-button"]:hover,
    .emega-header-zone--search .site-search button[name="search-button"]:focus,
    .emega-header-zone--search
        .site-search
        button[name="search-button"]:hover::before,
    .emega-header-zone--search
        .site-search
        button[name="search-button"]:focus::before {
        color: var(--skin-primary-color-1, #e31c25) !important;
        background: transparent !important;
        box-shadow: none !important;
        filter: none !important;
    }

    .emega-header-zone--search .site-search form .suggestions-wrapper {
        left: 0 !important;
        right: 0 !important;
        top: calc(100% + 4px) !important;
    }

    /* Mobile-specific sticky tweak */
    .emega-header-mobile--sticky {
        padding: 8px 12px; /* slightly tighter on mobile */
    }
}
