/* ==========================================================================
   Ricerca header — Smartphone Italia (20261118-search)
   Pill bianca, icona a sinistra, pulsante verde integrato.
   ========================================================================== */

#_desktop_search .tvsearch-header-display-wrappper form,
#tvcms-mobile-view-header .tvsearch-header-display-wrappper form {
    display: flex !important;
    align-items: stretch !important;
    height: 50px !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e3e6ea !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04) !important;
    overflow: hidden !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#_desktop_search .tvsearch-header-display-wrappper form:focus-within,
#tvcms-mobile-view-header .tvsearch-header-display-wrappper form:focus-within {
    background: #ffffff !important;
    border-color: #0d8224 !important;
    box-shadow: 0 0 0 3px rgba(13, 130, 36, 0.12), 0 6px 18px rgba(17, 24, 39, 0.06) !important;
}

#_desktop_search .tvheader-top-search,
#tvcms-mobile-view-header .tvheader-top-search {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
}

#_desktop_search .tvheader-top-search-wrapper-info-box,
#tvcms-mobile-view-header .tvheader-top-search-wrapper-info-box {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    width: 100% !important;
    position: relative !important;
}

#_desktop_search .tvheader-top-search-wrapper-info-box::before,
#tvcms-mobile-view-header .tvheader-top-search-wrapper-info-box::before {
    content: 'search';
    font-family: 'Material Icons';
    font-size: 20px;
    line-height: 1;
    color: #8a8f98;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    transition: color 0.18s ease;
}

#_desktop_search .tvsearch-header-display-wrappper form:focus-within .tvheader-top-search-wrapper-info-box::before,
#tvcms-mobile-view-header .tvsearch-header-display-wrappper form:focus-within .tvheader-top-search-wrapper-info-box::before {
    color: #0d8224;
}

#_desktop_search #si-header-search-input,
#_desktop_search .tvcmssearch-words,
#tvcms-mobile-view-header #si-header-search-input,
#tvcms-mobile-view-header .tvcmssearch-words {
    height: 48px !important;
    line-height: 48px !important;
    padding: 0 16px 0 46px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #1d1d1f !important;
    font-family: var(--si-font, Inter, system-ui, sans-serif) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

#_desktop_search #si-header-search-input::placeholder,
#_desktop_search .tvcmssearch-words::placeholder,
#tvcms-mobile-view-header #si-header-search-input::placeholder,
#tvcms-mobile-view-header .tvcmssearch-words::placeholder {
    color: #8a8f98 !important;
    opacity: 1 !important;
}

#_desktop_search .tvheader-top-search-wrapper,
#tvcms-mobile-view-header .tvheader-top-search-wrapper {
    display: flex !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#_desktop_search .tvheader-search-btn,
#tvcms-mobile-view-header .tvheader-search-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-width: 104px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 0 999px 999px 0 !important;
    background: #0d8224 !important;
    color: #ffffff !important;
    font-family: var(--si-font, Inter, system-ui, sans-serif) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.16s ease;
    -webkit-appearance: none;
    appearance: none;
}

#_desktop_search .tvheader-search-btn:hover,
#tvcms-mobile-view-header .tvheader-search-btn:hover {
    background: #0a6b1d !important;
    color: #ffffff !important;
}

#_desktop_search .tvheader-search-btn:active,
#tvcms-mobile-view-header .tvheader-search-btn:active {
    background: #085a18 !important;
}

#_desktop_search .tvheader-search-btn svg,
#tvcms-mobile-view-header .tvheader-search-btn svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
}

#_desktop_search .tvheader-search-btn .tvserach-name,
#tvcms-mobile-view-header .tvheader-search-btn .tvserach-name {
    display: block !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

#_desktop_search .tvheader-search-btn:focus-visible,
#tvcms-mobile-view-header .tvheader-search-btn:focus-visible {
    outline: 3px solid rgba(13, 130, 36, 0.35) !important;
    outline-offset: 2px !important;
}

/* Compact desktop/tablet: pulsante icon-only per lasciare spazio al placeholder */
@media (min-width: 992px) and (max-width: 1199px) {
    #_desktop_search .tvheader-search-btn,
    #tvcms-mobile-view-header .tvheader-search-btn {
        min-width: 52px !important;
        width: 52px !important;
        padding: 0 !important;
    }

    #_desktop_search .tvheader-search-btn .tvserach-name,
    #tvcms-mobile-view-header .tvheader-search-btn .tvserach-name {
        display: none !important;
    }
}

@media (max-width: 991px) {
    #_desktop_search .tvsearch-header-display-wrappper form,
    #tvcms-mobile-view-header .tvsearch-header-display-wrappper form {
        height: 52px !important;
    }

    #_desktop_search .tvheader-search-btn,
    #tvcms-mobile-view-header .tvheader-search-btn {
        min-width: 52px !important;
        width: 52px !important;
        height: 50px !important;
        padding: 0 !important;
        border-radius: 0 999px 999px 0 !important;
    }

    #_desktop_search .tvheader-search-btn .tvserach-name,
    #tvcms-mobile-view-header .tvheader-search-btn .tvserach-name {
        display: none !important;
    }

    #_desktop_search #si-header-search-input,
    #_desktop_search .tvcmssearch-words,
    #tvcms-mobile-view-header #si-header-search-input,
    #tvcms-mobile-view-header .tvcmssearch-words {
        height: 50px !important;
        line-height: 50px !important;
        font-size: 14px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #_desktop_search .tvsearch-header-display-wrappper form,
    #tvcms-mobile-view-header .tvsearch-header-display-wrappper form,
    #_desktop_search .tvheader-search-btn,
    #tvcms-mobile-view-header .tvheader-search-btn {
        transition: none !important;
    }
}
