/* Busca Page Styles */
.search-page-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 400px);
}

/* Sidebar Filtros */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #009933;
    border-radius: 10px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.filters-header h2 {
    font-size: 1.4rem;
    color: #009933;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.btn-clear {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-clear:hover {
    background: #e0e0e0;
    color: #333;
}

/* Category Buttons */
.category-selector {
    margin-bottom: 1.5rem;
}

.category-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.category-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #666;
}

.category-btn i {
    font-size: 1.5rem;
}

.category-btn:hover {
    border-color: #009933;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 153, 51, 0.1);
}

.category-btn.active {
    background: linear-gradient(135deg, #009933 0%, #006622 100%);
    border-color: #009933;
    color: white;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.filter-input-group {
    margin-bottom: 1rem;
}

.filter-input-group:last-child {
    margin-bottom: 0;
}

.filter-input-group label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filter-input-group input,
.filter-input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.filter-input-group input:focus,
.filter-input-group select:focus {
    outline: none;
    border-color: #009933;
    box-shadow: 0 0 0 3px rgba(0, 153, 51, 0.1);
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Dynamic Filters */
#dynamic-filters {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results Area */
.results-area {
    min-height: 600px;
}

.results-header {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.results-header h1 {
    font-size: 1.8rem;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.results-header p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #009933;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.result-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f5f5f5;
}

.result-card-body {
    padding: 1.25rem;
}

.result-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.result-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #009933;
    margin: 0 0 0.75rem 0;
}

.result-card-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.result-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #888;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.result-card-specs span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #999;
    font-size: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: #666;
}

.page-btn:hover:not(:disabled) {
    background: #009933;
    color: white;
    border-color: #009933;
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.active {
    background: linear-gradient(135deg, #009933 0%, #006622 100%);
    color: white;
    border-color: #009933;
}

.page-info {
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-page-container {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .search-page-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem auto;
    }

    .filters-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 1rem;
    }

    .filters-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        margin: -1.5rem -1.5rem 1rem;
        padding: 1rem 1.5rem;
    }

    .category-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .category-btn i {
        font-size: 1.2rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .results-header h1 {
        font-size: 1.4rem;
    }

    .result-card-image {
        height: 200px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .page-btn {
        min-width: 35px;
        height: 35px;
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-page-container {
        padding: 0 0.5rem;
    }

    .filters-sidebar {
        padding: 1rem;
    }

    .filters-header h2 {
        font-size: 1.2rem;
    }

    .btn-clear {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .btn-clear span {
        display: none;
    }

    .category-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.6rem;
    }

    .category-btn span {
        font-size: 0.85rem;
    }

    .price-range {
        grid-template-columns: 1fr;
    }

    .results-header {
        padding: 1rem;
    }

    .results-header h1 {
        font-size: 1.2rem;
    }

    .result-card-body {
        padding: 1rem;
    }

    .result-card-title {
        font-size: 1rem;
    }

    .result-card-price {
        font-size: 1.3rem;
    }
}

/* Mobile Filter Toggle (para telas pequenas) */
@media (max-width: 768px) {
    .filters-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #009933 0%, #006622 100%);
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        display: none;
    }

    .filters-sidebar.mobile-hidden {
        display: none;
    }

    .filters-sidebar.mobile-visible {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }
}
