/* Advanced Search Overlay Styles */
.aso-search-overlay:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aso-search-overlay.active:before {
    display: block;
    opacity: 1;
}

.aso-search-container {
    background: white;
    width: 100%;
    max-width: 650px;
    padding: 30px 30px 20px;
    max-height: calc(100% - 32px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 9999999;
    margin: auto;
    left: unset;
    position: fixed;
    height: 100%;
}

.aso-search-overlay.active .aso-search-container {
    transform: translateX(0);
    visibility: unset;
    overflow-y: auto;
}

/* Close Button */
.aso-search-close {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.aso-search-close:hover {
    background-color: #f5f5f5;
}

/* Search Input */
.aso-search-form-content {
    position: relative;
}
.aso-search-input-container .aso-search-input {
    width: 100%;
    border: none;
    outline: none;
    color: #333;
    background: transparent;
    padding: 0 0 10px;
    margin-bottom: 0;
    border-bottom: 2px solid rgb(26 26 26 / .12);
    box-shadow: unset !important;
    font-size: 28px;
    margin-bottom: 0;
    line-height: 45px;
    font-weight: 700;
    height: unset;
}
.aso-search-input-container .aso-search-input:focus {
    border-bottom: 2px solid rgb(26, 26, 26);
}
.aso-search-input::placeholder {
    color: #999;
}

/* Search Tabs */
.aso-search-tabs {
    display: flex;
    padding-top: 34px;
}

.aso-search-tab {
    background: none;
    border: none;
    margin: 0 20px 24px 0;
    padding: 0;
    font-weight: 700;
    text-transform: capitalize;
    line-height: 31px;
    font-size: 22px;
    color: rgb(26,26,26);
    opacity: 0.3;
    min-height: unset;
    cursor: pointer;
    transition: opacity .2s ease-in-out;
}

.aso-search-tab.active ,
.aso-search-tab:hover {
    opacity: 1;
}

/* Search Results */
.aso-search-results {
    overflow-y: auto;
}

.aso-search-loading {
    text-align: center;
    padding: 40px 20px;
}

.aso-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: aso-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes aso-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Product Results */
.aso-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.aso-result-item:hover .aso-result-title{
    background-size: 100% 1px;
}

.aso-result-item:last-child {
    border-bottom: none;
}

.aso-result-image {
    width: 80px;
    overflow: hidden;
    flex-shrink: 0;
}

.aso-result-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.aso-result-info {
    flex: 1;
}

.aso-result-title {
    font-size: 16px;
    line-height: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    width: fit-content;
    line-height: 1.3;
    background: linear-gradient(to right, currentColor, currentColor) 0 min(100%, 1.35em) / 0 1px no-repeat;
    transition: background-size .3s ease-in-out;
}

.aso-result-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.aso-result-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aso-price-current {
    color: rgb(217 0 0);
    font-weight: 600;
    font-size: 16px;
}

.aso-price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.aso-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.aso-result-type {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.aso-result-count {
    color: #666;
}

/* No Results */
.aso-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.aso-no-results h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.aso-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Search Button Styles */
.aso-search-button {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0;
    background: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.aso-search-button:hover {
    border-color: #333;
    color: #333;
    text-decoration: none;
}

/* Widget Styles */
.widget .aso-search-button {
    width: 100%;
    justify-content: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.widget .aso-search-button:hover {
    background: #e9ecef;
}

@media (max-width: 849px) {
    #header .header-main li.html.custom {
        display: block;
    }
    #header .header-main .nav-left {
        justify-content: space-between;
    }
    .aso-search-overlay.active .aso-search-container {
        transform: translateY(0);
    }
    .aso-search-container {
        transform: translateY(-100%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .aso-search-overlay.active {
        padding-top: 20px;
    }
    .aso-search-input-container .aso-search-input {
        font-size: 18px;
        line-height: 29px;
    }
    .aso-search-form-content {
        margin-bottom: 20px;
    }
    .aso-search-container {
        width: calc(100% - 16px);
        max-height: 90vh;
        height: fit-content;
        top: 8px;
        left: 0;
        bottom: unset;
        overflow-y: auto;
    }

    .aso-search-input {
        font-size: 20px;
    }

    .aso-search-tab {
        font-size: 14px;
    }

    .aso-result-item {
        gap: 12px;
    }

    .aso-result-image {
        width: 60px;
    }

    .aso-result-title {
        font-size: 14px;
    }

    .aso-result-excerpt {
        font-size: 13px;
    }

    .aso-price-current {
        font-size: 14px;
    }
    .aso-search-tabs {
        padding-top: 0px;
    }
    .aso-search-tab {
        margin: 0 16px 16px 0;
    }
    .aso-search-container {
        padding: 20px 24px 24px 24px;
    }
}