/* =============================================
   PROFESSIONAL SEARCH RESULTS
   Live search overlay with modern UI
   ============================================= */

/* Search Results Overlay */
.search-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    animation: fadeIn 0.2s ease-out;
}

.search-results-overlay.active {
    display: flex;
}

/* Search Results Container */
.search-results-container {
    max-width: 900px;
    width: 90%;
    max-height: calc(100vh - 150px);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(31, 41, 55, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Search Header */
.search-results-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(251, 146, 60, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), rgba(249, 115, 22, 0.05));
}

.search-results-title {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-results-count {
    font-size: 0.9375rem;
    color: rgba(156, 163, 175, 0.9);
    margin-top: 4px;
}

.search-close-btn {
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fb923c;
    font-size: 18px;
}

.search-close-btn:hover {
    background: rgba(251, 146, 60, 0.2);
    transform: scale(1.1);
}

/* Search Results Grid */
.search-results-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

/* Search Result Card */
.search-result-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(17, 24, 39, 0.4));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 146, 60, 0.15);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-result-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-result-item:hover::before {
    opacity: 1;
}

.search-result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -8px rgba(251, 146, 60, 0.3);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(17, 24, 39, 0.6));
}

/* Result Image */
.search-result-image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    background: rgba(17, 24, 39, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-image img {
    transform: scale(1.08);
}

.search-result-image i {
    font-size: 48px;
    color: rgba(251, 146, 60, 0.3);
}

/* Result Info */
.search-result-info {
    padding: 0;
}

.search-result-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fb923c;
    font-weight: 600;
    margin-bottom: 6px;
}

.search-result-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.search-result-price {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* No Results State */
.search-no-results {
    padding: 60px 24px;
    text-align: center;
    color: rgba(156, 163, 175, 0.9);
}

.search-no-results i {
    font-size: 64px;
    color: rgba(251, 146, 60, 0.3);
    margin-bottom: 20px;
}

.search-no-results h3 {
    font-size: 1.25rem;
    color: #f9fafb;
    margin-bottom: 10px;
}

.search-no-results p {
    font-size: 0.9375rem;
    color: rgba(156, 163, 175, 0.7);
}

/* Scrollbar for results */
.search-results-grid::-webkit-scrollbar {
    width: 8px;
}

.search-results-grid::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
}

.search-results-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fb923c, #f97316);
    border-radius: 10px;
}

.search-results-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result item stagger animation */
.search-result-item {
    animation: resultFadeIn 0.4s ease-out backwards;
}

.search-result-item:nth-child(1) {
    animation-delay: 0.05s;
}

.search-result-item:nth-child(2) {
    animation-delay: 0.1s;
}

.search-result-item:nth-child(3) {
    animation-delay: 0.15s;
}

.search-result-item:nth-child(4) {
    animation-delay: 0.2s;
}

.search-result-item:nth-child(5) {
    animation-delay: 0.25s;
}

.search-result-item:nth-child(6) {
    animation-delay: 0.3s;
}

.search-result-item:nth-child(7) {
    animation-delay: 0.35s;
}

.search-result-item:nth-child(8) {
    animation-delay: 0.4s;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-results-container {
        width: 95%;
        max-height: calc(100vh - 120px);
    }

    .search-results-header {
        padding: 20px 20px;
    }

    .search-results-title {
        font-size: 1.125rem;
    }

    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .search-result-image {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .search-results-overlay {
        padding-top: 80px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .search-result-image {
        height: 160px;
    }
}