/************************************************** 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 RESULTS DROPDOWN ========== */
/* ============================================= */

.tvsearch-result {
    position: absolute;
    min-width: 720px;
    z-index: 20;
    top: 100%;
    margin-top: 4px;
    right: 0;
}

.tvsearch-header-display-wrappper {
    position: relative;
}

/* Dropdown container */
.tvcmssearch-dropdown {
    padding: 16px;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #4a7c59;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: tvsearch-slideDown 0.2s ease-out;
    max-height: 480px;
    overflow-y: auto;
}

@keyframes tvsearch-slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Total results header */
.tvsearch-dropdown-total-wrapper {
    text-align: left;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.tvsearch-dropdown-total {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Results grid */
.tvsearch-all-dropdown-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -6px;
    overflow: hidden;
}

/* Product card */
.tvsearch-dropdown-wrapper {
    width: 50%;
    margin-bottom: 8px;
    padding: 0 6px;
}

.tvsearch-dropdown-wrapper a {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    background-color: #fafafa;
}

.tvsearch-dropdown-wrapper a:hover {
    background-color: #f0f7f2;
    border-color: #4a7c59;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
}

/* Product image */
.tvsearch-dropdown-img-block {
    width: 64px;
    min-width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 6px;
    background-color: #ffffff;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvsearch-dropdown-img-block img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product info */
.tvsearch-dropdown-content-box {
    text-align: left;
    flex: 1;
    padding-left: 12px;
    min-width: 0;
}

.tvsearch-dropdown-title {
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.3;
}

.tvsearch-dropdown-wrapper a:hover .tvsearch-dropdown-title {
    color: #4a7c59;
}

/* Product reference/SKU */
.tvsearch-dropdown-ref {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 3px;
    font-family: monospace;
    letter-spacing: 0.02em;
}

/* Category suggestions */
.tvsearch-categories-wrapper {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.tvsearch-categories-title {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.tvsearch-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tvsearch-category-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background-color: #f3f4f6;
    border-radius: 20px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.tvsearch-category-item:hover {
    background-color: #f0f7f2;
    border-color: #4a7c59;
    color: #4a7c59;
}

.tvsearch-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background-color: #e5e7eb;
    color: #6b7280;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.tvsearch-category-item:hover .tvsearch-category-count {
    background-color: #4a7c59;
    color: #ffffff;
}

/* Old/regular price (strikethrough) */
.tvsearch-result .product-price-and-shipping .regular-price {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 6px;
}

/* Price */
.tvsearch-result .product-price-and-shipping {
    display: block;
    overflow: hidden;
    vertical-align: top;
    margin: 0;
}

.tvsearch-result .product-price-and-shipping .price {
    font-size: 14px;
    font-weight: 700;
    color: #4a7c59;
}

.tvsearch-dropdown-price .tvsearch-dropdown-new-price {
    float: left;
    margin-right: 8px;
    font-weight: 700;
    color: #4a7c59;
}

.tvsearch-dropdown-price .tvsearch-dropdown-old-price {
    float: left;
    margin-right: 8px;
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 12px;
}

/* Close button */
.tvsearch-dropdown-close-wrapper {
    margin-bottom: 0;
}

.tvsearch-dropdown-close {
    border: none;
    text-align: center;
    padding: 0;
    margin: 0;
    background: none;
    cursor: pointer;
}

.tvsearch-dropdown-close i {
    font-size: 20px;
    color: #9ca3af;
    transition: color 0.15s;
}

.tvsearch-dropdown-close:hover i {
    color: #1f2937;
}

.tvsearch-dropdown-close-wrapper {
    position: absolute;
    right: 6px;
    top: 6px;
    z-index: 2;
}

/* "More results" button */
.tvsearch-more-search-wrapper {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.tvsearch-more-search {
    border: none;
    text-align: center;
    padding: 10px 20px;
    cursor: pointer;
    background-color: #4a7c59;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tvsearch-more-search:hover {
    background-color: #3d6a4b;
}

.tvsearch-more-search.tvall-inner-btn {
    margin-bottom: 0;
    width: 100%;
}

.tvheader-top-search {
    width: 100%;
}

/* No results message */
.tvsearch-no-results {
    text-align: center;
    padding: 24px 16px;
    color: #6b7280;
    font-size: 14px;
}

.tvsearch-no-results strong {
    display: block;
    margin-bottom: 4px;
    color: #374151;
    font-size: 15px;
}

/* Loading spinner */
.tvsearch-loading {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
}

.tvsearch-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #4a7c59;
    border-radius: 50%;
    animation: tvsearch-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes tvsearch-spin {
    to { transform: rotate(360deg); }
}

/************* mobile search css ************/

@media(max-width: 991px) {
    .tvsearch-result {
        min-width: 0;
        width: 100%;
        right: auto;
        left: 0;
    }
    .tvsearch-dropdown-wrapper {
        width: 100%;
    }
}

@media(max-width: 575px) {
    .tvcmssearch-wrapper {
        position: inherit;
    }
    .search-widget form input[type=text] {
        min-width: auto;
    }
    .tvcmssearch-dropdown {
        max-height: 360px;
        padding: 12px;
    }
    .tvsearch-dropdown-img-block {
        width: 52px;
        min-width: 52px;
        height: 52px;
    }
}

/************************ 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;
}
