/************************************************** desktop search ***************************/
#header .header-top .search-widget {
    float: left;
    min-width: auto;
}
.tvcmsheader-search.search-widget form input[type=text] {
    border: none;
}
.tvcmsheader-search .tvcms-select-category {
    display: none;
}

.lang-rtl #header .tvsearch-header-display-wrappper {
    right: auto;
    left: 0;
}
#pagenotfound .page-not-found .search-widget .tvsearch-header-display-wrappper {
    position: inherit;
    opacity: 1;
    visibility: visible;
    transform: none;
}
.tvsearch-top-wrapper.open .tvsearch-header-display-wrappper {
    display: block;
}
.tvsearch-top-wrapper .tvsearch-close i {
    /*display: none;*/
}
.tvsearch-top-wrapper .tvsearch-close {
    display: none;
}
.tvsearch-top-wrapper.open .tvheader-search-display-icon {
    display: none;
}
.tvsearch-header-display-wrappper form {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    z-index: 10;
    border: 1px solid #eee;
    background-color: #ffffff;
}
.tvheader-top-search-wrapper {
    background-color: #ffffff;
}
.search-widget form button[type=submit] {
    cursor: pointer;
}
.tvcmsheader-search.search-widget form button[type=submit] {
    padding: 0;
    background-color: transparent;
    border: none;
    top: 0;
    position: inherit;
}
.tvcmssearch-wrapper {
    /*float: left;*/
    position: relative;
    cursor: pointer;
}

#_desktop_search .tvcmsheader-search .tvserach-name {
    display: none;
}
.tvcmsheader-search form input::placeholder {
    opacity: 1;
}
/* search result */
.tvsearch-dropdown-total-wrapper {
    /*text-align: center;*/
    margin: 0 0 5px 0;
    /*line-height: 40px;*/
    /*border: 1px solid #eeeeee;*/
    /*padding: 0 15px;*/
}
.tvsearch-result {
    position: absolute;
    width: 100%;
    z-index: 20;
    top: 100%;
    margin-top: 10px;
}
.tvsearch-header-display-wrappper {
    position: relative;
}
.tvsearch-result .product-price-and-shipping {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    margin: 0;
}
.tvcmssearch-dropdown {
    padding: 15px;
    /*border: 1px solid #eeeeee;*/
    border-bottom: 4px solid #d90244;
}
.tvsearch-all-dropdown-wrapper {
    overflow: hidden;
}
.tvsearch-dropdown-wrapper {
    width: 50%;
    /*margin-bottom: 15px;*/
    padding: 0 7.5px;
}
.tvsearch-dropdown-wrapper a {
    display: flex;
    /*flex-wrap: wrap;*/
    padding: 8px;
    border: 1px solid #eeeeee;
}
.tvsearch-dropdown-img-block {
    /*float: left;*/
    height: auto;
    width: 30%;
    /*border: 1px solid #eeeeee;*/
    overflow: hidden;
	display: flex;          /* Opzionale: centra l'immagine dentro se stessa */
    align-items: center;    /* Opzionale: centra l'immagine */
}
.tvsearch-dropdown-content-box {
    /*margin-left: 85px;*/
    text-align: left;
    width: 70%;
    padding-left: 5px;
}
.tvsearch-dropdown-title {
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 10px;
}
.tvsearch-dropdown-price .tvsearch-dropdown-new-price,
.tvsearch-dropdown-price .tvsearch-dropdown-old-price {
    float: left;
    margin-right: 10px;
}
.tvsearch-dropodwn-close-wrapper {
    margin-bottom: 35px;
}
.tvheader-top-search {
    width: 100%;
}
.tvsearch-dropdown-close {
    border: 1px solid #eeeeee;
    text-align: center;
    padding: 10px 15px;
    margin-bottom: 15px;
}
.tvsearch-more-search {
    border: 1px solid #eeeeee;
    text-align: center;
    padding: 10px 15px;
    cursor: pointer;
    /*display: inline-block;*/
}
.tvsearch-all-dropdown-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -7.5px;
}
.tvsearch-more-search.tvall-inner-btn {
    margin-bottom: 0;
    width: 100%;
}

/************* mobile search css ************/

@media(max-width: 575px) {
    .tvcmssearch-wrapper {
        position: inherit;
    }
    .search-widget form input[type=text] {
        min-width: auto;
    }
}
/************************ rtl **************/
.lang-rtl .tvsearch-dropdown-total {
    direction: ltr;
}
.lang-rtl .tvsearch-dropdown-img-block {
    /*float: right;*/
}
.lang-rtl .tvsearch-dropdown-content-box {
    padding-right: 10px;
    padding-left: 0;
    text-align: right;
}
.lang-rtl .tvsearch-dropdown-price .tvsearch-dropdown-new-price,
.lang-rtl .tvsearch-dropdown-price .tvsearch-dropdown-old-price {
    float: right;
    margin-left: 5px;
}

/* =========================================================
    1. SEARCH RESULTS - CARD E RISULTATI (CLS SAFE)
   ========================================================= */

/* Contenitore Immagine - AGGIORNATO A 100px */
.tvsearch-dropdown-img-block {
    flex: 0 0 100px; /* Aumentato da 80px a 100px */
    width: 100px;    /* Aumentato da 80px a 100px */
    height: 100px;   /* Aumentato da 80px a 100px */
    margin-right: 10px; /* Leggermente più spazio dal testo */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.tvsearch-dropdown-img-block img {
    max-width: 100%;
    max-height: 100%; /* Assicura che non esca dal box */
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* Stato base della card - STABILIZZATO */
.tvsearch-dropdown-wrapper a {
    display: flex;
    align-items: center;
    padding: 8px;
    text-decoration: none !important;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    
    /* FIX: Bordo già presente (trasparente) per evitare scatti dei testi */
    border: 1px solid #eef2f7; 
    border-left: 4px solid transparent !important; 
    
    border-radius: 8px; 
    margin: 4px 8px;
    background-color: #fff;
    min-height: 120px; /* Aumentata leggermente per ospitare l'immagine da 100px */
}

/* Effetto Hover - FLUIDO E FERMO */
.tvsearch-dropdown-wrapper a:hover {
    background-color: #f8faff;
    border-left-color: #355e9e !important;
    border-top-color: #eef2f7;
    border-right-color: #eef2f7;
    border-bottom-color: #eef2f7;
    box-shadow: 2px 2px 10px rgba(0, 123, 255, 0.08);
}

/* Forziamo il testo a non avere decorazioni e restare leggibile */
.tvsearch-dropdown-content-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =========================================================
    2. BOX NESSUN RISULTATO E ASSISTENZA
   ========================================================= */

.tvsearch-no-results-helper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 20px !important;
    text-align: center !important;
}

.no-results-main {
    color: #d9534f;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 12px;
}

.tvsearch-help-box {
    width: 100% !important;
    max-width: 600px !important;
    margin: 20px auto !important;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.help-text {
    font-size: 13px;
    margin-bottom: 12px;
    color: #333;
    font-weight: 700;
}

.faq_ask_a_question_search {
    display: flex !important;
    justify-content: center !important;
    gap: 15px !important;
    padding: 10px;
}

.search-btn-help {
    flex: 1 !important;
    max-width: 250px !important;
    min-width: 180px !important;
    background: #ffc107;
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
}

.search-btn-help.search-btn-wa {
    background: #25d366;
    color: #fff !important;
}

/* =========================================================
    3. RESPONSIVE MOBILE
   ========================================================= */

@media (max-width: 767px) {
    .tvsearch-dropdown-wrapper a {
        border-left: 4px solid #355e9e !important;
        margin-bottom: 10px !important;
    }

    .tvsearch-dropdown-wrapper a:active {
        background-color: #f8faff !important;
        transform: scale(0.98);
    }
    
    .tvcmssearch-words {
        padding-right: 0 !important; 
    }
}

@media (max-width: 575px) {
    /* Su mobile piccolo riduciamo l'immagine a 80px per non stringere troppo il testo */
    .tvsearch-dropdown-img-block {
        flex: 0 0 80px;
        width: 80px;
        height: 80px;
    }
    
    .faq_ask_a_question_search {
        flex-direction: column !important;
        align-items: center !important;
    }

    .search-btn-help {
        width: 100% !important;
        max-width: 280px !important;
        min-width: 0 !important;
    }
}

.tvsearch-pagination-info { display: none !important; }
.tvsearch-suggestion { margin-bottom: 15px; color: #004a99; font-size: 13px; font-style: italic; }

/* =========================================================
    4. INPUT SEARCH: SPINNER E TASTO X
   ========================================================= */

.tvheader-top-search-wrapper-info-box {
    position: relative !important;
    display: flex;
    align-items: center;
}

.tvcmssearch-words {
    padding-right: 0px !important; 
}

.tv-loading-spinner {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 50 50'%3E%3Cpath fill='%23ffc107' d='M25,5A20,20,0,1,0,45,25A20,20,0,0,0,25,5ZM25,41A16,16,0,1,1,41,25A16,16,0,0,1,25,41Z' opacity='.2'/%3E%3Cpath fill='%23ffc107' d='M25,5A20,20,0,0,1,45,25h-4A16,16,0,0,0,25,9V5Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 40px center !important; 
    background-size: 18px !important;
    transition: opacity 0.2s ease-in-out !important; 
}

.tv-search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    padding: 5px;
    font-weight: bold;
    display: none;
}

.tv-search-clear-btn:hover {
    color: #ffc107;
}

.tv-search-loading-wrapper {
    padding: 60px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.tv-spinner-circle {
    width: 35px;
    height: 35px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffc107;
    border-radius: 50%;
    animation: tv-spin 0.8s linear infinite;
}

@keyframes tv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}





