/**
 * Simple Search Styles
 */

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.simple-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.simple-search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Results Container */
.simple-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

/* When inside search overlay, use relative positioning to stay inside */
.search-overlay-content .simple-search-results,
.search-results-container.simple-search-results {
    position: relative;
    top: 0;
    box-shadow: none;
    border-radius: 0;
    max-height: 60vh;
}

/* Loading State */
.search-loading {
    padding: 32px;
    text-align: center;
    color: #666;
}

.search-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Items */
.search-results-list {
    padding: 8px 0;
}

.search-result-item {
    display: flex;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 80px;
    height: 60px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    margin-left: 16px;
    min-width: 0;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.search-result-type {
    font-size: 12px;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-weight: 500;
}

.search-result-category {
    font-size: 12px;
    color: #666;
}

.search-result-price {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
    margin-left: auto;
}

/* No Results */
.search-no-results,
.search-error {
    padding: 32px 16px;
    text-align: center;
    color: #666;
}

.search-no-results p,
.search-error p {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.search-no-results small,
.search-error small {
    font-size: 14px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .simple-search-results {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 60px);
        border-radius: 0;
    }
    
    .search-result-image {
        width: 60px;
        height: 45px;
    }
    
    .search-result-title {
        font-size: 14px;
    }
    
    .search-result-subtitle {
        font-size: 12px;
    }
}
