/* ==================== SEARCH PAGE CONTAINER ==================== */

.search-page-container {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    background-color: #FFFFFF;
}

.search-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ==================== SEARCH PAGE HEADER ==================== */

.search-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #FFFFFF;
    box-sizing: border-box;
}

/* ==================== SEARCH INPUT WRAPPER ==================== */

.search-input-wrapper {
    flex: 1;
    min-width: 0;
}

/* Override custom input border to purple */
.search-input-wrapper .custom-input-container {
    border: 2px solid #B704F6;
}

.search-input-wrapper .custom-input-container:focus-within {
    border-color: #9003CC;
    box-shadow: 0 0 0 3px rgba(183, 4, 246, 0.1);
}

/* ==================== SEARCH RESULTS ==================== */

.search-results-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.search-results-list {
    display: flex;
    flex-direction: column;
}

/* ==================== SEARCH RESULT ITEM ==================== */

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
    border-bottom: 1px solid #F3F4F6;
}

.search-result-item:hover {
    background-color: #F9FAFB;
}

.search-result-item:active {
    background-color: #F3F4F6;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Image */
.search-result-image {
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* Content */
.search-result-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

/* Title with highlighted text */
.search-result-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.search-result-text {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #0F0F0F;
    line-height: 1.5;
}

.search-highlight {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0F0F0F;
    line-height: 1.5;
}

/* Subtitle row */
.search-result-subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.search-result-price {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.5;
}

.search-result-separator {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6B7280;
}

.search-result-category {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.5;
}

/* ==================== EMPTY SEARCH STATE ==================== */

.empty-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 400px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.empty-search-icon {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-search-icon svg {
    width: 100px;
    height: 100px;
}

.empty-search-title {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F0F0F;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.empty-search-message {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #8B8D97;
    margin: 0;
    line-height: 1.6;
    max-width: 400px;
}

/* ==================== EMPTY STATE (BEFORE TYPING) ==================== */

.search-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.search-empty-text {
    font-family: 'PlusJakartaSans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #9CA3AF;
    text-align: center;
    margin: 0;
}

/* ==================== TABLET RESPONSIVE (768px - 1020px) ==================== */

@media (max-width: 1020px) {
    .search-page-header {
        padding: 0.875rem;
    }

    .search-result-item {
        padding: 0.875rem;
    }

    .empty-search-container {
        padding: 2.5rem 1.5rem;
        min-height: 350px;
    }

    .empty-search-icon svg {
        width: 90px;
        height: 90px;
    }

    .empty-search-title {
        font-size: 1.125rem;
    }

    .empty-search-message {
        font-size: 0.875rem;
        max-width: 350px;
    }
}

/* ==================== MOBILE RESPONSIVE (max-width: 768px) ==================== */

@media (max-width: 768px) {
    .search-page-header {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .search-result-item {
        gap: 0.625rem;
        padding: 0.75rem;
    }

    .search-result-image {
        width: 2.5rem;
        height: 2.5rem;
    }

    .search-result-text,
    .search-highlight {
        font-size: 0.875rem;
    }

    .search-result-price,
    .search-result-category {
        font-size: 0.75rem;
    }

    .empty-search-container {
        padding: 2rem 1.25rem;
        min-height: 300px;
    }

    .empty-search-icon svg {
        width: 80px;
        height: 80px;
    }

    .empty-search-title {
        font-size: 1.0625rem;
        margin-bottom: 0.625rem;
    }

    .empty-search-message {
        font-size: 0.8125rem;
        max-width: 300px;
    }
}

/* ==================== SMALL MOBILE (max-width: 480px) ==================== */

@media (max-width: 480px) {
    .search-page-header {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .search-result-item {
        gap: 0.5rem;
        padding: 0.625rem;
    }

    .search-result-image {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 6px;
    }

    .search-result-content {
        gap: 0.1875rem;
    }

    .search-result-text,
    .search-highlight {
        font-size: 0.8125rem;
    }

    .search-result-price,
    .search-result-category {
        font-size: 0.6875rem;
    }

    .empty-search-container {
        padding: 1.5rem 1rem;
        min-height: 250px;
    }

    .empty-search-icon {
        margin-bottom: 1.25rem;
    }

    .empty-search-icon svg {
        width: 70px;
        height: 70px;
    }

    .empty-search-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .empty-search-message {
        font-size: 0.75rem;
        max-width: 260px;
        line-height: 1.5;
    }

    .search-empty-text {
        font-size: 0.8125rem;
    }
}

/* ==================== SCROLLBAR STYLING ==================== */

.search-results-container::-webkit-scrollbar {
    width: 6px;
}

.search-results-container::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 0.25rem;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 0.25rem;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-contrast: high) {
    .search-input-wrapper .custom-input-container {
        border-width: 3px;
    }

    .search-result-item {
        border-bottom-width: 2px;
    }

    .empty-search-title {
        color: #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-result-item {
        transition: none;
    }
}
