.thm-header-search {
    position: relative;
    max-width: 100%;
    z-index: 2;
}


button.thm-search-btn {
    display: flex;
    aspect-ratio: 1;
    width: 36px;
    height: 36px;
    padding: 4px;
    border-radius: 50%;
    border: 2px solid #2170E8;
    fill: #2170E8;
    background: none;
}

.thm-search-btn svg {
    width: 100%;
    height: 100%
}

.thm-search-btn:hover,
.thm-search-btn:focus,
.thm-search-btn:active {
    background-color: transparent !important;
}

#thm-header-search-form {
    height: 54px;
    padding: 8px;
    border: 2px solid #2170E8;
    background-color: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
}

#thm-header-search-input {
    font-size: 15px;
    color: #353535;
    border: none;
    padding: 0;
    line-height: 1.5;
    margin-left: 10px;
}

#thm-header-search-input::placeholder {
    color: #8d8d8d;
}

.thm-search-results {
    background: #fff;
    position: absolute;
    width: 100vw;
    max-width: 867px;
    border-radius: 20px;
    box-shadow: 7px 8px 19px 1px rgba(0, 0, 0, 0.15);
    margin-top: 2px;
    z-index: 9999;
    right: 0;
    transform: translateX(0) translateY(-10px);
    overflow: hidden;

    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    display: block;
}

body:has(.thm-search-results.opened) {
    overflow-y: hidden;
}

.thm-search-results.opened {
    opacity: 1;
    transform: translateX(0) translateY(0);
    pointer-events: auto;
}

.thm-search-results__items {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.thm-search-more-btn {
    border-radius: 100px;
    color: #2170e8;
    line-height: 30px;
    font-size: 12px;
    font-weight: 600;
    display: block;
    text-align: center;
    border: 1px solid #2170e8;
    margin: 8px 16px;

    &:hover, &:focus, &:active {
        color: #1a67dd;
    }
}

.thm-result-item {
    padding: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.thm-result-item:hover {
    background: #f5f5f5;
}

.thm-result-item__info {
    flex: 1 1 auto;
    max-width: 500px;
}

.no-res {
    padding: 16px;
    color: #353535;
}

.thm-search-spinner {
    display: none;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 4px solid #2170e8;
    border-right-color: transparent !important;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 22px;
    animation: rotate-simple 0.8s linear infinite;
}

.thm-search-clear-btn {
    display: none !important;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: none !important;
    padding: 0 !important;
    margin-right: 8px;
    border-radius: 50% !important;
    background-color: #353535 !important;
    fill: #fff !important;
}

.thm-result-item img {
    width: 90px;
    height: 90px;
    margin-right: 12px;
    object-fit: cover;
    border-radius: 14px !important;;
}

.thm-result-item__title {
    font-weight: 400;
    font-size: 20px;
    line-height: 151%;
    color: #353535;
    margin-bottom: 4px;
}

.thm-result-item__meta {
    display: flex;
    gap: 20px;
}

.thm-result-item__sku {
    font-weight: 300;
    font-size: 16px;
    color: #b5bec7;

    b {
        font-weight: 500;
    }
}

.thm-result-item__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 84px;
    flex-wrap: wrap;
}

.thm-result-item__price {
    & > *:not(.amount) {
        display: none;
    }

    bdi {
        font-size: 25px;
        font-weight: 500;

        .woocommerce-Price-currencySymbol {
            font-size: inherit !important;
        }
    }
}

.thm-result-item__hcpc {
    font-weight: 300;
    font-size: 16px;
    color: #b5bec7;

    b {
        font-weight: 500;
    }
}

.thm-search-clear-btn.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart {
    margin-left: auto;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button {
    font-size: 0;
    width: 41px;
    height: 41px;
    padding: 0;
    background-color: #2170e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: none;
    box-shadow: none;
    transition: background-color 0.2s ease;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button:hover {
    background-color: #1a67dd;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button::before {
    content: "";
    display: block;
    width: 28px;
    height: 28px;
    background-image: url('data:image/svg+xml,<svg width="30" height="29" viewBox="0 0 30 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.35706 24.6839C9.35706 25.552 10.0414 26.238 10.9073 26.238C11.7731 26.238 12.4575 25.552 12.4575 24.6839C12.4575 23.8158 11.7731 23.1298 10.9073 23.1298C10.0414 23.1298 9.35706 23.8158 9.35706 24.6839ZM7.47168 24.6839C7.47168 22.7937 9.02188 21.2676 10.9073 21.2676C12.7926 21.2676 14.3428 22.7937 14.3428 24.6839C14.3428 26.574 12.7926 28.1282 10.9073 28.1282C9.02188 28.1282 7.47168 26.602 7.47168 24.6839ZM19.9571 24.6839C19.9571 22.7937 21.4793 21.2676 23.3926 21.2676C25.306 21.2676 26.8003 22.7937 26.8003 24.6839C26.8003 26.574 25.278 28.1282 23.3926 28.1282C21.5073 28.1282 19.9571 26.602 19.9571 24.6839ZM6.57787 5.64243L8.1979 13.7631H24.9149C25.697 13.7631 26.3534 13.161 26.4651 12.3769L27.3031 5.62843H6.57787V5.64243ZM6.18683 3.75229H28.3505C28.9231 3.75229 29.37 4.25633 29.2722 4.80237L28.3086 12.629C28.0991 14.3371 26.6327 15.6252 24.9009 15.6252H8.58894L8.7705 16.4933C9.00792 17.8094 10.181 18.7474 11.5218 18.7474H25.8786C26.3813 18.7474 26.8003 19.1675 26.8003 19.6715C26.8003 20.1755 26.3813 20.6376 25.8786 20.6376H11.4938C9.27326 20.6376 7.33202 19.0415 6.91305 16.8573L3.92438 1.89014H0.963637C0.46087 1.89014 0 1.47011 0 0.924071C0 0.378029 0.446904 0 0.963637 0H4.70646C5.15337 0 5.54441 0.336026 5.6282 0.756058L6.2008 3.75229H6.18683ZM21.8424 24.6839C21.8424 25.552 22.5268 26.238 23.3926 26.238C24.2585 26.238 24.9428 25.552 24.9428 24.6839C24.9428 23.8158 24.2306 23.1298 23.3926 23.1298C22.5547 23.1298 21.8424 23.8158 21.8424 24.6839Z" fill="white" /></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button.loading {
    opacity: 0.7;
    padding: 0;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button.loading::before {
    display: none;
}

.thm-search-results:not(.thm-search-results--partners) .thm-add-to-cart .button.loading::after {
    font-family: WooCommerce;
    content: "\e01c";
    font-size: 20px;
    color: white;
    position: static;
    margin: 0;
}

@keyframes rotate-simple {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

.search-results-page {
    padding: 60px 10px;
}

.search-results-page__container {
    max-width: 1420px;
    margin: 0 auto;
}

.search-results-page__title {
    text-align: center;
    margin-bottom: 30px;
}

.search-results-page__list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.search-results-page__item {
    flex: 0 0 calc(25% - 15px);
    display: block;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card__image {
    width: 100%;
    display: block;
    object-fit: cover;
}

.product-card__content {
    padding: 15px;
    flex-grow: 1;
}

.product-card__title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.product-card__price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.product-card__actions {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}

.product-card__btn {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.product-card__btn--add-to-cart {
    pointer-events: none;
    opacity: .5;
    background-color: #2171E8;
    color: #fff;
}

.product-card__btn--add-to-cart.loading {
    opacity: .5 !important;
    pointer-events: none !important;
    display: flex;
    gap: .53em;
    justify-content: center;
    align-items: center;
}

.product-card__btn--add-to-cart.loading:after {
    font-family: WooCommerce;
    content: "\e01c";
    font-weight: 400;
    vertical-align: top;
    display: inline-block;
    animation: spin 2s linear infinite;
    transform-origin: center center;
    width: 1em;
    height: 1em;
    line-height: 1em;
}

.product-card__btn--add-to-cart.added {
    display: flex;
    gap: .53em;
    justify-content: center;
    align-items: center;
}

.product-card__btn--add-to-cart.added:after {
    font-family: WooCommerce;
    content: "\e017";
    vertical-align: top;
    width: 1em;
    height: 1em;
    line-height: 1em;
}

.product-card__btn--add-to-cart:hover {
    background-color: #0056b3;
    color: #fff;
}

.product-card__btn--explore {
    border: 1px solid #2171E8;
    color: #2171E8;
    background-color: #fff;
}

.product-card__btn--explore:hover {
    background-color: #2171E8;
    color: #fff;
}

.search-results-page__pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
    font-family: inherit;
}

.search-results-page__pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    min-width: 36px;
    text-align: center;
    text-decoration: none;
    color: #2171E8;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.search-results-page__pagination .page-numbers:hover {
    background-color: #2171E8;
    color: #fff;
    border-color: #2171E8;
}

.search-results-page__pagination .page-numbers.current {
    background-color: #2171E8;
    color: #fff;
    border-color: #2171E8;
    cursor: default;
}

@media (max-width: 1165px) {
    .thm-search-results {
        position: fixed;
        top: auto;
        width: 100vw;
        max-width: 90vw;
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }

    .thm-search-results.opened {
        transform: translateX(50%) translateY(0px);
    }
}

@media (max-width: 768px) {
    .product-card__content {
        padding: 10px;
    }

    .product-card__title {
        font-size: 14px;
    }

    .product-card__actions {
        padding: 10px;
    }

    .product-card__price {
        font-size: 13px;
    }

    .search-results-page__title {
        font-size: 32px;
    }

    .search-results-page__item {
        flex: 0 0 calc(50% - 10px);
    }

    .search-results-page__list {
        gap: 10px;
    }

    .thm-search-results {
        max-width: 96vw;
        top: auto;
        position: absolute;
        right: 0;
    }

    .thm-search-results.opened {
        transform: translateX(0%) translateY(0px);
    }

    .thm-result-item {
        flex-wrap: wrap;
    }

    .thm-result-item__actions {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .thm-result-item__title {
        word-break: break-all;
    }
}
