/* ===============================
   MARKETPLACE STYLES
   =============================== */

/* Hero Marketplace Section */
.hero-marketplace {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-marketplace::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cars" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><text x="10" y="15" text-anchor="middle" fill="rgba(255,255,255,0.1)" font-size="12">🚗</text></pattern></defs><rect width="100" height="100" fill="url(%23cars)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.hero-marketplace h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-marketplace p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Search & Filter Section */
.search-filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

/* New Simplified Search Bar */
.search-bar-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-input-group {
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-wrap: nowrap !important; /* NEVER allow wrapping */
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
}

.main-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 50px;
    background: #f8f9fa;
    color: #333;
    min-width: 0; /* Allow shrinking */
    width: auto;
}

.main-search-input::placeholder {
    color: #999;
}

.main-search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    min-width: 44px;
    height: 44px;
}

.main-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.main-filter-toggle-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.main-filter-toggle-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: rotate(15deg) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.main-filter-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: rotate(45deg) scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Extra protection against wrapping on ultra-small screens */
@media (max-width: 360px) {
    .search-input-group {
        gap: 4px !important;
        padding: 4px !important;
        flex-wrap: nowrap !important;
    }
    
    .main-search-input {
        padding: 8px 10px !important;
        font-size: 13px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .main-search-btn {
        padding: 8px 10px !important;
        min-width: 36px !important;
        font-size: 0 !important; /* Hide text, show only icon */
    }
    
    .main-filter-toggle-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .main-search-btn svg,
    .main-filter-toggle-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Mobile responsive for new search bar */
@media (max-width: 768px) {
    .search-bar-container {
        padding: 0 15px;
    }
    
    .search-input-group {
        gap: 6px !important;
        padding: 6px !important;
        flex-wrap: nowrap !important; /* NEVER wrap */
        display: flex !important;
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .main-search-input {
        padding: 10px 12px !important;
        font-size: 14px !important;
        flex: 1 !important; /* Take remaining space after buttons */
        min-width: 100px !important; /* Minimum width before buttons wrap */
        max-width: calc(100% - 90px) !important; /* Reserve space for 2 buttons */
        border-radius: 50px !important;
        background: #f8f9fa !important;
        box-sizing: border-box;
    }
    
    .main-search-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important; /* NEVER shrink */
        flex-grow: 0 !important; /* NEVER grow */
        width: 38px !important; /* Fixed width */
        height: 38px !important; /* Fixed height */
        min-width: 38px !important;
        max-width: 38px !important;
        white-space: nowrap;
        overflow: hidden;
    }
    
    .main-filter-toggle-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important; /* NEVER shrink */
        flex-grow: 0 !important; /* NEVER grow */
        min-width: 38px !important;
        max-width: 38px !important;
    }
    
    .sort-section {
        flex-direction: row; /* Keep in row for better mobile UX */
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }
    
    .sort-options {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .sort-options label {
        font-size: 14px;
        white-space: nowrap;
    }
    
    .sort-options select {
        min-width: 120px;
        width: auto;
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Extra small screens - even more aggressive input shrinking */
@media (max-width: 480px) {
    .search-input-group {
        gap: 4px !important;
        padding: 4px !important;
    }
    
    .main-search-input {
        padding: 8px 10px !important;
        font-size: 13px !important;
        min-width: 80px !important; /* Even smaller minimum */
        max-width: calc(100% - 80px) !important; /* More space for buttons */
    }
    
    .main-search-btn {
        width: 34px !important;
        height: 34px !important;
        padding: 6px !important;
        font-size: 0 !important; /* Hide text, show only icon */
        min-width: 34px !important;
        max-width: 34px !important;
    }
    
    .main-filter-toggle-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
    }
    
    .main-search-btn svg,
    .main-filter-toggle-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Ultra small screens - maximum input shrinking */
@media (max-width: 360px) {
    .search-input-group {
        gap: 3px !important;
        padding: 3px !important;
    }
    
    .main-search-input {
        padding: 6px 8px !important;
        font-size: 12px !important;
        min-width: 60px !important; /* Very small minimum */
        max-width: calc(100% - 75px) !important; /* Maximum space for buttons */
    }
    
    .main-search-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 4px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
    
    .main-filter-toggle-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
    
    .main-search-btn svg,
    .main-filter-toggle-btn svg {
        width: 12px !important;
        height: 12px !important;
    }
}

.search-header {
    text-align: center;
    margin-bottom: 50px;
}

.search-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
}

.search-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.search-filters {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Quick Search */
.quick-search {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quick-search input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.quick-search input:focus {
    border-color: #667eea;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
}

/* Advanced Filters */
.advanced-filters {
    border-top: 1px solid #e9ecef;
    padding-top: 30px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.advanced-filters.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.filter-group select,
.filter-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #667eea;
}

/* Searchable Dropdown */
.searchable-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.searchable-dropdown input {
    order: 1;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #495057;
}

.searchable-dropdown input:focus {
    border-color: #667eea;
    background: #fff;
}

.searchable-dropdown select {
    order: 2;
    margin-top: 0;
}

/* Modern Searchable Select */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.searchable-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.searchable-select:hover {
    border-color: #c7d2fe;
}

/* Custom dropdown styling for searchable behavior */
.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.searchable-select-dropdown.open {
    display: block;
}

.searchable-select-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    outline: none;
    background: #f8f9fa;
}

.searchable-select-search:focus {
    background: white;
}

.searchable-select-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.searchable-select-option:hover {
    background-color: #f8f9fa;
}

.searchable-select-option.selected {
    background-color: #667eea;
    color: white;
}

.searchable-select-option.hidden {
    display: none;
}

/* Loading state */
.searchable-select.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .searchable-select {
        padding: 10px 12px;
        font-size: 0.9rem;
        padding-right: 35px;
    }
    
    .searchable-select-dropdown {
        max-height: 150px;
    }
}

/* ===========================
   NEW IMAGE GALLERY SYSTEM
   =========================== */

/* Card Image Gallery */
.image-gallery {
    position: relative;
    width: 100%;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    background: #f5f5f5;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-main:hover .main-image {
    transform: scale(1.05);
}

/* Gallery Arrows */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 5;
}

.gallery-main:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow.prev {
    left: 10px;
}

.gallery-arrow.next {
    right: 10px;
}

/* Image Counter */
.image-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Thumbnail Strip */
.thumbnail-strip {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumbnail-strip::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    flex-shrink: 0;
    width: 50px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: #667eea;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================
   FULL-SCREEN IMAGE MODAL
   =========================== */

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    z-index: 10001;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 10002;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
}

.modal-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.modal-arrow.prev {
    left: -70px;
}

.modal-arrow.next {
    right: -70px;
}

.modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Modal Thumbnails */
.modal-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding: 0 20px;
    overflow-x: auto;
    max-width: 90vw;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.modal-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.modal-thumb:hover,
.modal-thumb.active {
    opacity: 1;
    border-color: #667eea;
}

.modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .gallery-arrow {
        width: 30px;
        height: 30px;
        opacity: 1; /* Always show on mobile */
    }
    
    .thumbnail {
        width: 40px;
        height: 32px;
    }
    
    .modal-arrow {
        width: 40px;
        height: 40px;
    }
    
    .modal-arrow.prev {
        left: -50px;
    }
    
    .modal-arrow.next {
        right: -50px;
    }
    
    .modal-content {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .modal-gallery {
        max-width: 100vw;
        max-height: 70vh;
    }
    
    .modal-close {
        top: -40px;
        right: 10px;
    }
    
    .modal-thumbnails {
        padding: 0 10px;
        max-width: 100vw;
    }
    
    .modal-thumb {
        width: 50px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .modal-arrow.prev {
        left: 10px;
    }
    
    .modal-arrow.next {
        right: 10px;
    }
    
    .modal-close {
        top: 10px;
    }
}

/* Remove old gallery styles that conflict */
.gallery-thumbnails,
.gallery-nav,
.gallery-indicators,
.gallery-counter,
.gallery-container,
.gallery-main-image,
.gallery-thumbnail,
.gallery-dot {
    display: none !important;
}

/* Price and Year Range */
.price-range,
.year-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-range input,
.year-range input {
    flex: 1;
}

.price-range span,
.year-range span {
    color: #666;
    font-weight: 500;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 25px;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.apply-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.reset-btn {
    background: transparent;
    color: #dc3545;
    border-color: #dc3545;
}

.reset-btn:hover {
    background: #dc3545;
    color: white;
}

.toggle-btn {
    background: transparent;
    color: #667eea;
    border-color: #667eea;
}

.toggle-btn:hover {
    background: #667eea;
    color: white;
}

/* Sort Section */
.sort-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    flex-wrap: wrap;
    gap: 20px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-options label {
    font-weight: 600;
    color: #333;
}

.sort-options select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    outline: none;
    font-size: 1rem;
    min-width: 200px;
}

.results-info {
    color: #666;
    font-weight: 500;
}

.results-info span:first-child {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Listings Section */
.listings-section {
    padding: 60px 0;
    background: #f8f9fa;
    min-height: 500px;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1.1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 20px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-results h3 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.reset-search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.reset-search-btn:hover {
    transform: translateY(-2px);
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Car Card */
.car-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.car-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.car-card:hover .car-image img {
    transform: scale(1.05);
}

.car-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.car-badge.featured {
    background: #ffd700;
    color: #333;
}

.car-badge.new {
    background: #007bff;
}

.car-info {
    padding: 25px;
}

.car-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.car-location {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.car-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.car-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.car-detail-icon {
    width: 16px;
    text-align: center;
}

.car-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
}

.car-actions {
    display: flex;
    gap: 10px;
}

.car-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.contact-btn:hover {
    transform: translateY(-2px);
}

.details-btn {
    background: transparent;
    color: #333;
    border-color: #e9ecef;
}

.details-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 50px;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
}

.load-more-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-marketplace h1 {
        font-size: 2.5rem;
    }
    
    .hero-marketplace p {
        font-size: 1.2rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-item {
        padding: 20px 30px;
        min-width: 140px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .search-filters {
        padding: 25px;
    }
    
    .quick-search {
        flex-direction: column;
    }
    
    .search-btn {
        align-self: stretch;
        justify-content: center;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-btn {
        min-width: auto;
    }
    
    .sort-section {
        flex-direction: column;
        text-align: center;
    }
    
    .sort-options {
        flex-direction: column;
        align-items: center;
    }
    
    .sort-options select {
        min-width: auto;
        width: 100%;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .car-card {
        margin: 0 10px;
    }
    
    .car-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-marketplace {
        padding: 100px 0 60px;
    }
    
    .hero-marketplace h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .search-filter-section {
        padding: 40px 0;
    }
    
    .search-header h2 {
        font-size: 2rem;
    }
    
    .listings-section {
        padding: 40px 0;
    }
    
    .car-info {
        padding: 20px;
    }
    
    .car-title {
        font-size: 1.2rem;
    }
    
    .sort-section {
        padding: 12px 15px;
    }
    
    .sort-options label {
        font-size: 13px;
    }
    
    .sort-options select {
        min-width: 100px;
        font-size: 13px;
        padding: 6px 8px;
    }
    
    .car-price {
        font-size: 1.6rem;
    }
}

/* Car Card Animation */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.car-card {
    animation: cardSlideIn 0.5s ease forwards;
}

/* Verification Badge */
.verified-seller {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

.verified-seller::before {
    content: '✓';
}

/* Featured Listing Glow */
.car-card.featured {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
}

.car-card.featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    border-radius: 22px;
    z-index: -1;
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}

/* ===============================
   IMAGE GALLERY WITH NAVIGATION
   =============================== */

/* Image Gallery for Car Cards */
.car-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.car-card:hover .gallery-main-image {
    transform: scale(1.05);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.car-card:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

.gallery-nav:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.gallery-nav:disabled:hover {
    transform: translateY(-50%);
}

.gallery-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.car-card:hover .gallery-indicators {
    opacity: 1;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.3);
}

.gallery-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.car-card:hover .gallery-counter {
    opacity: 1;
}

/* Hide navigation for single images */
.gallery-container[data-count="1"] .gallery-nav,
.gallery-container[data-count="1"] .gallery-indicators,
.gallery-container[data-count="1"] .gallery-counter {
    display: none !important;
}

/* ===============================
   CONTACT SYSTEM STYLES
   =============================== */

.contact-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.contact-btn {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-btn-phone {
    background: linear-gradient(135deg, #25D366, #20BA5A);
    color: white;
}

.contact-btn-app {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.contact-btn-details {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* App Store / Google Play Icons */
.app-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

/* Modal for Contact Options */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.contact-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
}

.contact-modal h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.contact-option {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.contact-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.contact-option-phone {
    background: linear-gradient(135deg, #25D366, #20BA5A);
}

.contact-option-app {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* New Contact Choice Modal Styles */
.contact-choice-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.contact-choice-btn {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.contact-choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.phone-btn {
    background: linear-gradient(135deg, #25D366, #20BA5A);
}

.chat-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* App Store Choice Modal Styles */
.app-store-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.app-store-btn {
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.app-store-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.google-play-btn {
    background: linear-gradient(135deg, #34A853, #137333);
}

.ios-app-btn {
    background: linear-gradient(135deg, #007AFF, #0051D5);
}

.modal-subtitle {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Mobile responsive for new modals */
@media (max-width: 480px) {
    .contact-choice-buttons {
        flex-direction: column;
    }
    
    .contact-choice-btn {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .app-store-btn {
        padding: 15px;
        font-size: 1rem;
    }
}

.contact-option-details {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

/* Mobile Responsiveness for Gallery */
@media (max-width: 768px) {
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .gallery-nav.prev {
        left: 8px;
    }
    
    .gallery-nav.next {
        right: 8px;
    }
    
    .gallery-counter {
        top: 8px;
        right: 8px;
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .contact-options {
        flex-direction: column;
    }
    
    .contact-btn {
        padding: 15px;
        font-size: 1rem;
    }
}

/* ===============================
   MODAL GALLERY STYLES
   =============================== */

.modal-gallery-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.modal-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.modal-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.modal-gallery-nav.prev {
    left: 15px;
}

.modal-gallery-nav.next {
    right: 15px;
}

.modal-gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.modal-gallery-nav:disabled:hover {
    transform: translateY(-50%);
}

.modal-gallery-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.modal-gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-gallery-dot.active {
    background: white;
    transform: scale(1.3);
}

.modal-gallery-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
}

.modal-thumbnail-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 15px;
}

.modal-thumbnail {
    min-width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.modal-thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.modal-thumbnail.active {
    border-color: #667eea;
    transform: scale(1.05);
}

/* Hide modal gallery elements for single images */
.modal-gallery-container[data-count="1"] .modal-gallery-nav,
.modal-gallery-container[data-count="1"] .modal-gallery-indicators,
.modal-gallery-container[data-count="1"] .modal-gallery-counter {
    display: none !important;
}

/* ===============================
   COUNTRY DETECTION NOTIFICATION
   =============================== */

.country-detection-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: slideInNotification 0.5s ease-out;
    max-width: 350px;
    min-width: 280px;
}

@keyframes slideInNotification {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.country-detection-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    position: relative;
}

.country-flag {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.country-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.country-detection-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.8;
}

.country-detection-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .country-detection-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
    
    .country-detection-content {
        padding: 14px 16px;
    }
    
    .country-text {
        font-size: 0.9rem;
    }
}

/* ===============================
   FILTER TOGGLE FUNCTIONALITY
   =============================== */

.filter-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.filter-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.filter-toggle-btn:active {
    transform: translateY(0);
}

.filter-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.filter-text {
    font-weight: 500;
}

.toggle-arrow {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.filter-toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}

.filter-toggle-btn.active .filter-icon {
    transform: rotate(15deg);
}

/* Hide the old toggle advanced button */
#toggleAdvanced {
    display: none !important;
}

/* Smooth animation for filters */
.advanced-filters {
    transition: all 0.4s ease;
    overflow: hidden;
}

.advanced-filters.showing {
    display: block !important;
    animation: slideDown 0.4s ease-out;
}

.advanced-filters.hiding {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    0% {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
}

/* Mobile responsive for filter toggle */
@media (max-width: 768px) {
    .filter-toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .filter-icon {
        font-size: 16px;
    }
}