/**
 * Listing cards stylesheet (Phase 1-B of the Explore V2 centralization plan).
 *
 * Source-of-truth: copied byte-for-byte from V1's inline <style> block in
 * explore-services.php (lines 758-980 of the V1 template). Selectors and
 * rules are identical so V1 (which still carries its inline block during
 * Phases 1-3) and V2 (which only has this external stylesheet) compute
 * identical visual output.
 *
 * Removal of V1's inline block is deferred to Phase 4 cutover (the only
 * edit V1 ever receives across the rollout).
 *
 * Loaded on both /explore-services/ (V1) and /explore-services-v2/ (V2)
 * via the centralized enqueue in inc/listing/v2-routing.php.
 */

/* Page Header with Search */
.page-header-large {
    padding: 4rem 0;
    position: relative;
    z-index: 10;
    overflow: visible !important;
}

.page-header-large .container {
    overflow: visible !important;
}

.page-header-large .row {
    overflow: visible !important;
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    z-index: 9999;
}
.input-group-text {
    padding: 0.75rem 1rem;
}
#search-input {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}
#search-input:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    margin-top: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Hide any duplicate live-search-results containers from external JS */
.live-search-results {
    display: none !important;
}
.search-dropdown.show {
    display: block !important;
}
.search-result-item {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}
.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}
.search-result-item:hover,
.search-result-item-active {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    transform: translateX(4px);
}
.search-result-image {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #f0f0f0;
}
.search-result-placeholder {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 20px;
}
.search-result-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.search-result-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
}
.search-result-business {
    color: #4a5568;
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #718096;
}
.search-result-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.search-result-meta i {
    font-size: 10px;
    opacity: 0.7;
}
.search-loading {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}
.no-results-message {
    padding: 30px 20px;
    text-align: center;
    color: #718096;
}
.no-results-message i {
    font-size: 2.5rem;
    opacity: 0.5;
    margin-bottom: 12px;
    display: block;
}

/* Scrollbar */
.search-dropdown::-webkit-scrollbar {
    width: 8px;
}
.search-dropdown::-webkit-scrollbar-track {
    background: #f7fafc;
}
.search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}
.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Provider Card Styles */
.provider-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
    overflow: hidden;
}
.provider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}
.provider-card .btn-outline-success {
    border-color: #198754;
    color: #198754;
}
.provider-card .btn-outline-success:hover {
    background-color: #198754;
    color: #fff;
}

/* Price Range (inline in card meta) */
.price-range {
    color: #1a7a34;
    font-weight: 600;
}
.price-range .currency-code {
    font-weight: 400;
    opacity: 0.7;
    font-size: 10px;
}
.price-contact {
    color: #5a6268;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 767.98px) {
    .search-result-meta {
        font-size: 10px;
    }
    .search-result-image,
    .search-result-placeholder {
        width: 45px;
        height: 45px;
    }
    .search-dropdown {
        max-height: 60vh;
    }
    .input-group-lg .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    .input-group-lg .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
