/* Car Drive - Filtros Responsivos */

/* ===== DESKTOP - Filtros Inline ===== */
@media (min-width: 769px) {
    .filters-container {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
    }
    
    .filters-row {
        display: flex;
        align-items: flex-end;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .filters-inputs {
        display: flex;
        gap: 15px;
        flex: 1;
        align-items: flex-end;
        flex-wrap: wrap;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        min-width: 150px;
        flex: 1;
    }
    
    .filter-group.filter-search {
        flex: 2;
        max-width: 400px;
    }
    
    .filter-group label {
        font-size: 0.875rem;
        font-weight: 600;
        color: #495057;
        margin-bottom: 5px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 0.875rem;
        background-color: white;
        transition: border-color 0.15s ease-in-out;
    }
    
    .filter-group input:focus,
    .filter-group select:focus {
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    }
    
    .filter-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .btn-filter {
        padding: 8px 20px;
        border-radius: 4px;
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
    }
    
    .btn-filter-primary {
        background-color: #007cba;
        color: white;
    }
    
    .btn-filter-primary:hover {
        background-color: #005a87;
    }
    
    .btn-filter-secondary {
        background-color: #6c757d;
        color: white;
    }
    
    .btn-filter-secondary:hover {
        background-color: #545b62;
    }
    
    /* Esconde o toggle no desktop */
    .filter-toggle {
        display: none;
    }
}

/* ===== MOBILE - Filtros em Sanfona ===== */
@media (max-width: 768px) {
    .filters-container {
        background: white;
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        overflow: hidden;
    }
    
    /* Botão Toggle */
    .filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 15px 20px;
        background: #f8f9fa;
        border: none;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        color: #333;
        transition: background-color 0.2s;
    }
    
    .filter-toggle:hover {
        background-color: #e9ecef;
    }
    
    .filter-toggle-icon {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .filter-toggle-arrow {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
        display: inline-block;
    }
    
    .filter-toggle.active .filter-toggle-arrow {
        transform: rotate(180deg);
    }
    
    /* Conteúdo dos Filtros */
    .filters-form {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background: white;
    }
    
    .filters-form.show {
        max-height: 600px;
        transition: max-height 0.3s ease-in;
    }
    
    .filters-row {
        padding: 20px;
    }
    
    .filters-inputs {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
    }
    
    .filter-group label {
        font-size: 0.875rem;
        font-weight: 600;
        color: #495057;
        margin-bottom: 5px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 16px; /* Previne zoom no iOS */
        background-color: white;
    }
    
    .filter-actions {
        display: flex;
        gap: 10px;
        margin-top: 20px;
        flex-direction: column;
    }
    
    .btn-filter {
        width: 100%;
        padding: 12px 20px;
        border-radius: 4px;
        font-size: 1rem;
        font-weight: 500;
        text-decoration: none;
        border: none;
        cursor: pointer;
        text-align: center;
        display: block;
    }
    
    .btn-filter-primary {
        background-color: #007cba;
        color: white;
    }
    
    .btn-filter-secondary {
        background-color: #6c757d;
        color: white;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== ÍCONE DA SETA ===== */
.filter-toggle-arrow::before {
    content: "▼";
    display: inline-block;
    font-size: 12px;
}

/* ===== BADGE DE FILTROS ATIVOS ===== */
.filter-badge {
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* ===== MELHORIAS VISUAIS ===== */
.filters-container {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

input::placeholder {
    color: #6c757d;
    opacity: 1;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

/* ===== ESTADO DE LOADING ===== */
.filters-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.filters-container.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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