/**
 * Simple Search Styles for RD Advanced Search
 * Minimal search bar with dropdown results
 *
 * @package RD_Advanced_Search
 */

/* Container */
.rd-search-simple-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.rd-search-simple-form {
    position: relative;
}

/* Search Input */
.rd-search-simple-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.rd-search-simple-icon {
    position: absolute;
    left: 15px;
    color: #fff;
    pointer-events: none;
    z-index: 2;
}

.rd-search-simple-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    font-size: 16px;
    border: 2px solid rgba(148, 163, 184, .5);
    border-radius: 8px;
    background: #101b34;
    transition: all 0.3s ease;
    outline: none;
    color: #fff;
}

.rd-search-simple-input:focus {
    border-color: #7b70aa;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.rd-search-simple-input::placeholder {
    color: #fff;
}

.rd-search-simple-clear {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #fff;
    transition: color 0.2s;
    z-index: 2;
}

.rd-search-simple-clear:hover {
    color: red;
}

/* Loading Indicator */
.rd-search-simple-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #007cba;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
    z-index: 1000;
}

.rd-search-simple-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: rd-simple-spin 1s linear infinite;
}

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

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

/* Results Dropdown */
.rd-search-simple-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #007cba;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -2px;
    max-height: 500px;
    overflow-y: hidden;
    z-index: 1000;
}

.rd-search-simple-results-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.rd-search-simple-results-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Result Item */
.rd-search-simple-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.rd-search-simple-result-item:hover {
    background: #f8f9fa;
}

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

.rd-search-simple-result-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
}

.rd-search-simple-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rd-search-simple-result-content {
    flex: 1;
    min-width: 0;
}

.rd-search-simple-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-search-simple-result-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.rd-search-simple-result-sku {
    color: #007cba;
}

.rd-search-simple-result-brand {
    color: #666;
    text-transform: uppercase;
    font-size: 11px;
}

.rd-search-simple-result-price {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    color: #007cba;
}

/* Stock Badge */
.rd-search-simple-result-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.rd-search-simple-badge-instock {
    background: #d4edda;
    color: #155724;
}

.rd-search-simple-badge-outofstock {
    background: #f8d7da;
    color: #721c24;
}

/* View All Link */
.rd-search-simple-view-all {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.rd-search-simple-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.rd-search-simple-view-all-link:hover {
    color: #005a87;
}

/* No Results */
.rd-search-simple-no-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #007cba;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 30px 20px;
    text-align: center;
    margin-top: -2px;
    z-index: 1000;
}

.rd-search-simple-no-results p {
    margin: 0;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .rd-search-simple-container {
        max-width: 100%;
    }

    .rd-search-simple-input {
        font-size: 14px;
        padding: 8px 40px 8px 40px;
    }

    .rd-search-simple-result-item {
        padding: 10px;
    }

    .rd-search-simple-result-image {
        width: 50px;
        height: 50px;
    }

    .rd-search-simple-result-title {
        font-size: 13px;
    }

    .rd-search-simple-result-price {
        font-size: 14px;
    }
}

/* Scrollbar Styling */
.rd-search-simple-results-list::-webkit-scrollbar {
    width: 8px;
}

.rd-search-simple-results-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.rd-search-simple-results-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.rd-search-simple-results-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation */
.rd-search-simple-results,
.rd-search-simple-no-results,
.rd-search-simple-loading {
    animation: rd-simple-slide-down 0.2s ease-out;
}

@keyframes rd-simple-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight Matching Text */
.rd-search-simple-highlight {
    background: #fff3cd;
    font-weight: 600;
}