/* Weglot Product Search Styles */

/* Search Icon Container */
.wps-search-icon-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.wps-search-icon {
    font-size: 30px;
    color: white !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wps-search-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wps-search-icon {
        font-size: 25px;
    }
}

/* Search Overlay Modal */
#wps-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
}

.wps-search-box {
    background: #1c1c1c;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Close Button */
#wps-close-search {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#wps-close-search:hover {
    background: #6563ff;
}

/* Search Form */
#wps-product-search-form {
    margin-bottom: 20px;
}

#wps-product-search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #444;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background: #2a2a2a;
    color: #fff;
}

#wps-product-search-input:focus {
    border-color: #6563ff;
}

/* Search Results */
#wps-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.wps-search-result-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #333;
    transition: background-color 0.3s ease;
    color: #fff;
}

.wps-search-result-item:hover {
    background-color: #6563ff;
}

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

.wps-search-result-item a {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: #fff;
}

.wps-search-result-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.wps-product-info {
    flex: 1;
    min-width: 0;
}

.wps-product-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wps-product-price {
    color: #ccc;
    font-size: 14px;
}

.wps-product-price .woocommerce-Price-amount {
    font-weight: 600;
    color: #6563ff;
}

/* No results message */
.wps-search-result-item:only-child {
    text-align: center;
    color: #ccc;
    font-style: italic;
    padding: 30px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wps-search-box {
        width: 95%;
        padding: 20px;
        margin: 0 10px;
        max-height: 90vh;
    }

    #wps-search-overlay {
        padding-top: 5vh;
    }

    .wps-search-result-item img {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }

    .wps-product-title {
        font-size: 14px;
    }

    .wps-product-price {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wps-search-box {
        padding: 15px;
    }

    #wps-product-search-input {
        padding: 12px 15px;
        font-size: 14px;
    }

    .wps-search-result-item img {
        width: 45px;
        height: 45px;
    }
}

/* Loading state */
.wps-search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.wps-search-loading:before {
    content: "⏳";
    margin-right: 10px;
}

/* Custom scrollbar for search results */
#wps-search-results::-webkit-scrollbar {
    width: 6px;
}

#wps-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#wps-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#wps-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}